summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoModule.java
diff options
context:
space:
mode:
authorlikaid <likaid@codeaurora.org>2015-07-01 11:32:26 +0800
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-01-08 22:48:07 -0800
commitb21af4d1c4fa7a773463208008a487db545b8a9d (patch)
treedbbd6e8aa0658703fe9ac60f5148eae924b60f5f /src/com/android/camera/VideoModule.java
parentee44a036cd384d8721122504bed11306f3180225 (diff)
downloadandroid_packages_apps_Snap-b21af4d1c4fa7a773463208008a487db545b8a9d.tar.gz
android_packages_apps_Snap-b21af4d1c4fa7a773463208008a487db545b8a9d.tar.bz2
android_packages_apps_Snap-b21af4d1c4fa7a773463208008a487db545b8a9d.zip
SnapdragonCamera: Fix the icons disappeared when start recording failed
The camera switch icon and color effect icon are hidden when start recording, they will be shown again in onStopVideoRecording. But if the start recording failed, the onStopVideoRecording will not be called, that causes the icons disappeared. Show the icons if start video recording failed. Change-Id: I05f64d6fc4928adbd6d8e43e0b31e21e8cb6ea9e CRs-Fixed: 863790
Diffstat (limited to 'src/com/android/camera/VideoModule.java')
-rw-r--r--src/com/android/camera/VideoModule.java22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/com/android/camera/VideoModule.java b/src/com/android/camera/VideoModule.java
index b9bf36d35..d19d9f465 100644
--- a/src/com/android/camera/VideoModule.java
+++ b/src/com/android/camera/VideoModule.java
@@ -776,7 +776,10 @@ public class VideoModule implements CameraModule,
if (stop) {
onStopVideoRecording();
} else {
- startVideoRecording();
+ if (!startVideoRecording()) {
+ // Show ui when start recording failed.
+ mUI.showUIafterRecording();
+ }
}
// Keep the shutter button disabled when in video capture intent
@@ -1832,7 +1835,7 @@ public class VideoModule implements CameraModule,
return mMediaRecorderRecording;
}
- private void startVideoRecording() {
+ private boolean startVideoRecording() {
Log.v(TAG, "startVideoRecording");
mStartRecPending = true;
mUI.cancelAnimations();
@@ -1843,7 +1846,7 @@ public class VideoModule implements CameraModule,
if (mActivity.getStorageSpaceBytes() <= Storage.LOW_STORAGE_THRESHOLD_BYTES) {
Log.v(TAG, "Storage issue, ignore the start request");
mStartRecPending = false;
- return;
+ return false;
}
if( mUnsupportedHFRVideoSize == true) {
@@ -1851,7 +1854,7 @@ public class VideoModule implements CameraModule,
RotateTextToast.makeText(mActivity,R.string.error_app_unsupported_hfr,
Toast.LENGTH_SHORT).show();
mStartRecPending = false;
- return;
+ return false;
}
if (mUnsupportedHSRVideoSize == true) {
@@ -1859,7 +1862,7 @@ public class VideoModule implements CameraModule,
RotateTextToast.makeText(mActivity,R.string.error_app_unsupported_hsr,
Toast.LENGTH_SHORT).show();
mStartRecPending = false;
- return;
+ return false;
}
if( mUnsupportedHFRVideoCodec == true) {
@@ -1867,7 +1870,7 @@ public class VideoModule implements CameraModule,
RotateTextToast.makeText(mActivity, R.string.error_app_unsupported_hfr_codec,
Toast.LENGTH_SHORT).show();
mStartRecPending = false;
- return;
+ return false;
}
//??
//if (!mCameraDevice.waitDone()) return;
@@ -1877,12 +1880,12 @@ public class VideoModule implements CameraModule,
if (mUnsupportedResolution == true) {
Log.v(TAG, "Unsupported Resolution according to target");
mStartRecPending = false;
- return;
+ return false;
}
if (mMediaRecorder == null) {
Log.e(TAG, "Fail to initialize media recorder");
mStartRecPending = false;
- return;
+ return false;
}
pauseAudioPlayback();
@@ -1895,7 +1898,7 @@ public class VideoModule implements CameraModule,
// If start fails, frameworks will not lock the camera for us.
mCameraDevice.lock();
mStartRecPending = false;
- return;
+ return false;
}
mUI.hideUIwhileRecording();
@@ -1928,6 +1931,7 @@ public class VideoModule implements CameraModule,
UsageStatistics.onEvent(UsageStatistics.COMPONENT_CAMERA,
UsageStatistics.ACTION_CAPTURE_START, "Video");
mStartRecPending = false;
+ return true;
}
private Bitmap getVideoThumbnail() {