diff options
author | ztenghui <ztenghui@google.com> | 2013-10-16 14:43:26 -0700 |
---|---|---|
committer | ztenghui <ztenghui@google.com> | 2013-10-16 15:16:12 -0700 |
commit | 367c7c82a22ec007771059beec4aeff3ef96310e (patch) | |
tree | 4a957c78c0004155c0487767dcca07c110adf330 /src/com | |
parent | 5e82f81a7c7daaf8ac86dbd688b344027f97ff64 (diff) | |
download | android_packages_apps_Snap-367c7c82a22ec007771059beec4aeff3ef96310e.tar.gz android_packages_apps_Snap-367c7c82a22ec007771059beec4aeff3ef96310e.tar.bz2 android_packages_apps_Snap-367c7c82a22ec007771059beec4aeff3ef96310e.zip |
Send an message to decouple the gcam module change.
In this particular case, we try to enter GCam module directly which cause the
mCameraDevice to become null for photo module.
Therefore we post a message to switch into GCam to make sure current mode
switch complete first.
bug:11252237
Change-Id: Ibd33815e7bee74425faa758247e1dec85a2f17cb
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/camera/PhotoModule.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java index bed8a2149..6256bfbf3 100644 --- a/src/com/android/camera/PhotoModule.java +++ b/src/com/android/camera/PhotoModule.java @@ -101,6 +101,7 @@ public class PhotoModule private static final int CAMERA_OPEN_DONE = 8; private static final int OPEN_CAMERA_FAIL = 9; private static final int CAMERA_DISABLED = 10; + private static final int SWITCH_TO_GCAM_MODULE = 11; // The subset of parameters we need to update in setCameraParameters(). private static final int UPDATE_PARAM_INITIALIZE = 1; @@ -340,6 +341,10 @@ public class PhotoModule R.string.camera_disabled); break; } + + case SWITCH_TO_GCAM_MODULE: { + mActivity.onModuleSelected(ModuleSwitcher.GCAM_MODULE_INDEX); + } } } } @@ -1740,7 +1745,7 @@ public class PhotoModule // Switch to gcam module if HDR+ was selected if (doModeSwitch && !mIsImageCaptureIntent) { - mActivity.onModuleSelected(ModuleSwitcher.GCAM_MODULE_INDEX); + mHandler.sendEmptyMessage(SWITCH_TO_GCAM_MODULE); } } |