diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/camera/CameraWrapper.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/camera/CameraWrapper.java index e847cd95af..73a5b7e9ae 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/camera/CameraWrapper.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/camera/CameraWrapper.java @@ -551,6 +551,9 @@ public synchronized void stopRecording() throws CameraWrapperException { close(); if (mIsPreview) { startPreview(mPreviewSurface, true); + } else if (mIsTouchOn) { + mIsTouchOn = false; + turnOnTorch(); } notifyCameraEvent(CameraEvent.STOPPED_VIDEO_RECORDING); } @@ -623,17 +626,21 @@ public void onCaptureBufferLost(@NonNull CameraCaptureSession session, @NonNull } resumeRepeatingRequest(); throw new CameraWrapperException(e); + } finally { + mIsTakingStillImage = false; } } private void resumeRepeatingRequest() { - mIsTakingStillImage = false; try { if (mIsRecording) { startRecording(mRecordingSurface, true); } else if (mIsPreview) { startPreview(mPreviewSurface, true); + } else if (mIsTouchOn) { + mIsTouchOn = false; + turnOnTorch(); } else { close(); } @@ -794,7 +801,12 @@ public synchronized void turnOnTorch(final @Nullable TorchOnListener listener, if (mTargetSurface != null) { requestBuilder.addTarget(mTargetSurface); } - } else { + } + if (mIsRecording) { + requestBuilder.addTarget(mRecordingSurface); + } + + if (!mIsPreview && !mIsRecording) { requestBuilder.addTarget(mDummyPreviewReader.getSurface()); } requestBuilder.set(CaptureRequest.FLASH_MODE, CameraMetadata.FLASH_MODE_TORCH); @@ -848,6 +860,8 @@ public synchronized void turnOffTorch(final @Nullable TorchOffListener listener, throw new IllegalArgumentException(e); } catch (CameraWrapperException e) { throw new IllegalArgumentException(e); + } finally { + resumeRepeatingRequest(); } notifyTorchOffEvent(listener, handler); } diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostLightProfile.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostLightProfile.java index 9548d07be4..762c59a7f7 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostLightProfile.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostLightProfile.java @@ -89,12 +89,6 @@ public boolean onRequest(final Intent request, final Intent response) { new PermissionUtility.PermissionRequestCallback() { @Override public void onSuccess() { - if (!(isCameraAvailable())) { - MessageUtils.setIllegalDeviceStateError(response, "Camera device is already running."); - sendResponse(response); - return; - } - Bundle lightParam = new Bundle(); setName(lightParam, HOST_DEFAULT_LIGHT_NAME); setConfig(lightParam, ""); @@ -144,12 +138,6 @@ public boolean onRequest(final Intent request, final Intent response) { new PermissionUtility.PermissionRequestCallback() { @Override public void onSuccess() { - if (!(isCameraAvailable())) { - MessageUtils.setIllegalDeviceStateError(response, "Camera device is already running."); - sendResponse(response); - return; - } - if (flashing != null) { flashing(HOST_LIGHT_ID, flashing); setResult(response, DConnectMessage.RESULT_OK); @@ -213,12 +201,6 @@ public boolean onRequest(final Intent request, final Intent response) { new PermissionUtility.PermissionRequestCallback() { @Override public void onSuccess() { - if (!(isCameraAvailable())) { - MessageUtils.setIllegalDeviceStateError(response, "Camera device is already running."); - sendResponse(response); - return; - } - mPhotoRec.turnOffFlashLight(new HostDevicePhotoRecorder.TurnOffFlashLightListener() { @Override public void onRequested() { @@ -294,18 +276,6 @@ private Handler createHandler(final String name) { return new Handler(thread.getLooper()); } - /** - * カメラが使用可能どうかをチェックする. - * - * @return 使用可能の場合は true, そうでない場合は false. - */ - private boolean isCameraAvailable() { - if (((HostMediaRecorder) mPhotoRec).getState() != HostMediaRecorder.RecorderState.INACTTIVE) { - return false; - } - return true; - } - /** * 点滅制御. * diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostLiveStreamingProfile.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostLiveStreamingProfile.java index 5fe813f34b..6cd2ee9007 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostLiveStreamingProfile.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostLiveStreamingProfile.java @@ -48,6 +48,8 @@ public class HostLiveStreamingProfile extends DConnectProfile implements LiveStr private static final String VIDEO_URI_FALSE = "false"; private static final String VIDEO_URI_CAMERA_FRONT = "camera-front"; private static final String VIDEO_URI_CAMERA_BACK = "camera-back"; + private static final String VIDEO_URI_CAMERA_0 = "camera_0"; + private static final String VIDEO_URI_CAMERA_1 = "camera_1"; private static final String AUDIO_URI_TRUE = "true"; private static final String AUDIO_URI_FALSE = "false"; private static final int CAMERA_TYPE_FRONT = 0; @@ -108,6 +110,8 @@ public boolean onRequest(final Intent request, final Intent response) { case VIDEO_URI_FALSE: case VIDEO_URI_CAMERA_FRONT: case VIDEO_URI_CAMERA_BACK: + case VIDEO_URI_CAMERA_0: + case VIDEO_URI_CAMERA_1: break; default: MessageUtils.setInvalidRequestParameterError(response, "video parameter illegal"); @@ -353,35 +357,42 @@ public boolean onRequest(final Intent request, final Intent response) { }); } - private HostDeviceLiveStreamRecorder getHostDeviceLiveStreamRecorder() { + private HostDeviceLiveStreamRecorder getHostDeviceLiveStreamRecorder() { if (DEBUG) { Log.d(TAG, "getHostDeviceLiveStreamRecorder()"); Log.d(TAG, "mVideoURI : " + mVideoURI); } switch (mVideoURI) { - case VIDEO_URI_TRUE: { - HostMediaRecorder hostMediaRecorder = mHostMediaRecorderManager.getRecorder(null); - if (hostMediaRecorder instanceof HostDeviceLiveStreamRecorder) { - return (HostDeviceLiveStreamRecorder) hostMediaRecorder; - } - break; - } + case VIDEO_URI_TRUE: case VIDEO_URI_FALSE: { HostMediaRecorder hostMediaRecorder = mHostMediaRecorderManager.getRecorder(null); + if (mHostMediaRecorderManager.usingStreamingRecorder()) { + throw new RuntimeException("Another target in using."); + } + if (hostMediaRecorder instanceof HostDeviceLiveStreamRecorder) { return (HostDeviceLiveStreamRecorder) hostMediaRecorder; } break; } - case VIDEO_URI_CAMERA_FRONT: { - HostMediaRecorder hostMediaRecorder = getRecorder(CAMERA_TYPE_FRONT); + case VIDEO_URI_CAMERA_FRONT: + case VIDEO_URI_CAMERA_1: { + HostMediaRecorder hostMediaRecorder = mHostMediaRecorderManager.getRecorder(VIDEO_URI_CAMERA_1); + if (mHostMediaRecorderManager.usingStreamingRecorder()) { + throw new RuntimeException("Another target in using."); + } if (hostMediaRecorder instanceof HostDeviceLiveStreamRecorder) { return (HostDeviceLiveStreamRecorder) hostMediaRecorder; } break; } - case VIDEO_URI_CAMERA_BACK: { - HostMediaRecorder hostMediaRecorder = getRecorder(CAMERA_TYPE_BACK); + case VIDEO_URI_CAMERA_BACK: + case VIDEO_URI_CAMERA_0: { + HostMediaRecorder hostMediaRecorder = mHostMediaRecorderManager.getRecorder(VIDEO_URI_CAMERA_0); + if (mHostMediaRecorderManager.usingPreviewOrStreamingRecorder(hostMediaRecorder.getId())) { + throw new RuntimeException("Another target in using."); + } + if (hostMediaRecorder instanceof HostDeviceLiveStreamRecorder) { return (HostDeviceLiveStreamRecorder) hostMediaRecorder; } @@ -392,31 +403,6 @@ private HostDeviceLiveStreamRecorder getHostDeviceLiveStreamRecorder() { throw new RuntimeException("recorder not found"); } - - private HostMediaRecorder getRecorder(int type) { - if (DEBUG) { - Log.d(TAG, "getRecorder()"); - Log.d(TAG, "type" + type); - } - for(HostMediaRecorder hostMediaRecorder : mHostMediaRecorderManager.getRecorders()) { - if (DEBUG) { - Log.d(TAG, "name : " + hostMediaRecorder.getName()); - } - if (hostMediaRecorder.getName().matches("^Camera [0-9] \\((Front|Back)\\)")) { - if (type == CAMERA_TYPE_FRONT) { - if (hostMediaRecorder.getName().contains("Front")) { - return hostMediaRecorder; - } - } else if (type == CAMERA_TYPE_BACK) { - if (hostMediaRecorder.getName().contains("Back")) { - return hostMediaRecorder; - } - } - } - } - return null; - } - @Override public void onStart() { if (DEBUG) { diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostMediaStreamingRecordingProfile.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostMediaStreamingRecordingProfile.java index 7bd32910c9..2f97ac3cbe 100755 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostMediaStreamingRecordingProfile.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/profile/HostMediaStreamingRecordingProfile.java @@ -218,7 +218,8 @@ private void setOptions(final Intent request, final Intent response) { return; } - if (recorder.getState() != HostMediaRecorder.RecorderState.INACTTIVE) { + if (recorder.getState() != HostMediaRecorder.RecorderState.INACTIVE + && recorder.getState() != HostMediaRecorder.RecorderState.PREVIEW) { MessageUtils.setInvalidRequestParameterError(response, "settings of active target cannot be changed."); return; } @@ -431,6 +432,10 @@ public boolean onRequest(final Intent request, final Intent response) { MessageUtils.setInvalidRequestParameterError(response, "target is invalid."); return true; } + if (mRecorderMgr.usingPreviewOrStreamingRecorder(recorder.getId())) { + MessageUtils.setInvalidRequestParameterError(response, "Another target in using."); + return true; + } if (!(recorder instanceof HostDevicePhotoRecorder)) { MessageUtils.setNotSupportAttributeError(response, @@ -501,7 +506,10 @@ public boolean onRequest(final Intent request, final Intent response) { MessageUtils.setInvalidRequestParameterError(response, "target is invalid."); return true; } - + if (mRecorderMgr.usingPreviewOrStreamingRecorder(recorder.getId())) { + MessageUtils.setInvalidRequestParameterError(response, "Another target in using."); + return true; + } recorder.requestPermission(new HostMediaRecorder.PermissionCallback() { @Override public void onAllowed() { @@ -559,7 +567,6 @@ public boolean onRequest(final Intent request, final Intent response) { MessageUtils.setInvalidRequestParameterError(response, "target is invalid."); return true; } - recorder.requestPermission(new HostMediaRecorder.PermissionCallback() { @Override public void onAllowed() { @@ -678,6 +685,10 @@ public boolean onRequest(final Intent request, final Intent response) { MessageUtils.setInvalidRequestParameterError(response, "target is invalid."); return true; } + if (mRecorderMgr.usingPreviewOrStreamingRecorder(recorder.getId())) { + MessageUtils.setInvalidRequestParameterError(response, "Another target in using."); + return true; + } if (!(recorder instanceof HostDeviceStreamRecorder)) { MessageUtils.setNotSupportAttributeError(response, @@ -685,7 +696,8 @@ public boolean onRequest(final Intent request, final Intent response) { return true; } - if (recorder.getState() != HostMediaRecorder.RecorderState.INACTTIVE) { + if (recorder.getState() != HostMediaRecorder.RecorderState.INACTIVE + && recorder.getState() != HostMediaRecorder.RecorderState.PREVIEW) { MessageUtils.setIllegalDeviceStateError(response, recorder.getName() + " is already running."); return true; @@ -744,14 +756,13 @@ public boolean onRequest(final Intent request, final Intent response) { MessageUtils.setInvalidRequestParameterError(response, "target is invalid."); return true; } - if (!(recorder instanceof HostDeviceStreamRecorder)) { MessageUtils.setNotSupportAttributeError(response, "target does not support stream recording."); return true; } - if (recorder.getState() == HostMediaRecorder.RecorderState.INACTTIVE) { + if (recorder.getState() == HostMediaRecorder.RecorderState.INACTIVE) { MessageUtils.setIllegalDeviceStateError(response, "recorder is stopped already."); return true; } @@ -907,7 +918,6 @@ public void onDisallowed() { public HostMediaStreamingRecordingProfile(final HostMediaRecorderManager mgr, final FileManager fileMgr) { mRecorderMgr = mgr; mFileManager = fileMgr; - addApi(mGetMediaRecorderApi); addApi(mGetOptionsApi); addApi(mPutOptionsApi); diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/AbstractPreviewServerProvider.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/AbstractPreviewServerProvider.java index 375fb9c23c..9bd6b8adf8 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/AbstractPreviewServerProvider.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/AbstractPreviewServerProvider.java @@ -52,6 +52,7 @@ public abstract class AbstractPreviewServerProvider implements PreviewServerProv */ private HostMediaRecorder mRecorder; + private boolean mIsShownNotification; /** * コンストラクタ. * @param context コンテキスト @@ -60,6 +61,7 @@ public AbstractPreviewServerProvider(final Context context, final HostMediaRecor mContext = context; mRecorder = recorder; mNotificationId = notificationId; + mIsShownNotification = false; } // PreviewServerProvider @@ -118,6 +120,7 @@ public void onFail() { // TODO タイムアウト処理 } else { sendNotification(mRecorder.getId(), mRecorder.getName()); + mIsShownNotification = true; } } catch (InterruptedException e) { // ignore. @@ -171,6 +174,7 @@ private void hideNotification(String id) { .getSystemService(Service.NOTIFICATION_SERVICE); if (manager != null) { manager.cancel(id, getNotificationId()); + mIsShownNotification = false; } } @@ -252,4 +256,9 @@ private PendingIntent createPendingIntent(String id) { intent.putExtra(EXTRA_CAMERA_ID, id); return PendingIntent.getBroadcast(mContext, getNotificationId(), intent, 0); } + + @Override + public boolean isShownCameraNotification() { + return mIsShownNotification; + } } diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/HostMediaRecorder.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/HostMediaRecorder.java index a10d0cc460..7cd325a94c 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/HostMediaRecorder.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/HostMediaRecorder.java @@ -287,7 +287,7 @@ enum RecorderState { /** * 動作していない. */ - INACTTIVE, + INACTIVE, /** * 録画が一時停止中の状態. @@ -299,6 +299,11 @@ enum RecorderState { */ RECORDING, + /** + * プレビューが表示されている状態. + */ + PREVIEW, + /** * エラーで停止している状態. */ diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/HostMediaRecorderManager.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/HostMediaRecorderManager.java index 37fc9f78cd..68f9b6223c 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/HostMediaRecorderManager.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/HostMediaRecorderManager.java @@ -235,6 +235,52 @@ public HostMediaRecorder getRecorder(final String id) { return null; } + /** + * 指定された ID 以外のレコーダが. + * + *

+ * id に null が指定された場合には、デフォルトに設定されているレコーダを返却します。 + *

+ * + * @param id レコーダの識別子 + * @return 他のレコーダーが使用中であるかどうか true:使用中 false:使用されていない + */ + public boolean usingPreviewOrStreamingRecorder(String id) { + if (mRecorders.size() == 0) { + return false; + } + if (id == null) { + if (mDefaultPhotoRecorder != null) { + id = mDefaultPhotoRecorder.getId(); + } else { + id = mRecorders.get(0).getId(); + } + } + for (HostMediaRecorder recorder : mRecorders) { + if (!id.equals(recorder.getId()) + && (recorder.getState() == HostMediaRecorder.RecorderState.PREVIEW + || recorder.getState() == HostMediaRecorder.RecorderState.RECORDING)) { + return true; + } else if (recorder instanceof HostDeviceLiveStreamRecorder + && ((HostDeviceLiveStreamRecorder) recorder).isStreaming()) { + return true; + } + } + return false; + } + /** + * レコーダーが使用中である、あるいはストリーミングが開始している場合はtrueを返す. + * + * @return true:使用中 false:使用されていない + */ + public boolean usingStreamingRecorder() { + for (HostMediaRecorder recorder : mRecorders) { + return recorder.getState() == HostMediaRecorder.RecorderState.PREVIEW + || recorder.getState() == HostMediaRecorder.RecorderState.RECORDING + || ((HostDeviceLiveStreamRecorder) recorder).isStreaming(); + } + return false; + } /** * 指定された ID に対応する静止画用のレコーダを取得します. * @@ -311,7 +357,7 @@ public void sendEventForRecordingChange(final String serviceId, final HostMediaR case RECORDING: MediaStreamRecordingProfile.setStatus(record, MediaStreamRecordingProfileConstants.RecordingState.RECORDING); break; - case INACTTIVE: + case INACTIVE: MediaStreamRecordingProfile.setStatus(record, MediaStreamRecordingProfileConstants.RecordingState.STOP); break; case ERROR: diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/PreviewServerProvider.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/PreviewServerProvider.java index 3d2dc2d00d..d01be1e96d 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/PreviewServerProvider.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/PreviewServerProvider.java @@ -73,4 +73,10 @@ public interface PreviewServerProvider { * 設定が変更されたことを通知します. */ void onConfigChange(); + + /** + * Previewの状態を表すNotificationが表示されているかどうかのフラグを返します. + * return true:表示されている false:表示されていない + */ + boolean isShownCameraNotification(); } diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/audio/HostAudioRecorder.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/audio/HostAudioRecorder.java index d1237f12e6..17b48fca7c 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/audio/HostAudioRecorder.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/audio/HostAudioRecorder.java @@ -88,7 +88,7 @@ public class HostAudioRecorder implements HostMediaRecorder, HostDeviceStreamRec public HostAudioRecorder(final Context context) { mContext = context; - mState = RecorderState.INACTTIVE; + mState = RecorderState.INACTIVE; } @Override @@ -290,10 +290,10 @@ public synchronized void startRecording(final RecordingListener listener) { @Override public synchronized void stopRecording(final StoppingListener listener) { - if (getState() == RecorderState.INACTTIVE) { + if (getState() == RecorderState.INACTIVE) { listener.onFailed(this, "MediaRecorder is not running."); } else { - mState = RecorderState.INACTTIVE; + mState = RecorderState.INACTIVE; if (listener != null) { if (mMediaRecorder != null) { mMediaRecorder.stop(); diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/camera/Camera2Recorder.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/camera/Camera2Recorder.java index ca52d6afd8..892118f833 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/camera/Camera2Recorder.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/camera/Camera2Recorder.java @@ -252,7 +252,11 @@ public RecorderState getState() { if (mCameraWrapper.isRecording() || mCameraWrapper.isTakingStillImage()) { return RecorderState.RECORDING; } - return RecorderState.INACTTIVE; + // Preview用のNotificationが表示されている場合は、カメラをPreviewで占有しているものと判断する。 + if (mCamera2PreviewServerProvider.isShownCameraNotification()) { + return RecorderState.PREVIEW; + } + return RecorderState.INACTIVE; } @Override diff --git a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/screen/ScreenCastRecorder.java b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/screen/ScreenCastRecorder.java index cc28ee2885..7b286bd116 100644 --- a/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/screen/ScreenCastRecorder.java +++ b/dConnectDevicePlugin/dConnectDeviceHost/app/src/main/java/org/deviceconnect/android/deviceplugin/host/recorder/screen/ScreenCastRecorder.java @@ -82,7 +82,7 @@ public class ScreenCastRecorder implements HostMediaRecorder, HostDevicePhotoRec private int mPreviewBitRate = 1024 * 1024; private double mMaxFps = DEFAULT_MAX_FPS; private int mIFrameInterval = 2; - private RecorderState mState = RecorderState.INACTTIVE; + private RecorderState mState = RecorderState.INACTIVE; private final MediaSharing mMediaSharing = MediaSharing.getInstance(); @@ -420,7 +420,7 @@ private void takePhotoInternal(final @NonNull OnPhotoEventListener listener) { Bitmap bitmap = screenshot.get(); if (bitmap == null) { - mState = RecorderState.INACTTIVE; + mState = RecorderState.INACTIVE; listener.onFailedTakePhoto("Failed to take screenshot."); return; } @@ -433,14 +433,14 @@ private void takePhotoInternal(final @NonNull OnPhotoEventListener listener) { mFileMgr.saveFile(filename, media, true, new FileManager.SaveFileCallback() { @Override public void onSuccess(@NonNull final String uri) { - mState = RecorderState.INACTTIVE; + mState = RecorderState.INACTIVE; registerPhoto(new File(mFileMgr.getBasePath(), filename)); listener.onTakePhoto(uri, null, MIME_TYPE_JPEG); } @Override public void onFail(@NonNull final Throwable throwable) { - mState = RecorderState.INACTTIVE; + mState = RecorderState.INACTIVE; listener.onFailedTakePhoto(throwable.getMessage()); } });