OSDN Git Service

am 9db92826: Merge "Send an message to decouple the gcam module change." into gb...
authorztenghui <ztenghui@google.com>
Wed, 16 Oct 2013 23:32:59 +0000 (16:32 -0700)
committerAndroid Git Automerger <android-git-automerger@android.com>
Wed, 16 Oct 2013 23:32:59 +0000 (16:32 -0700)
* commit '9db9282667d9e272702cd2ee32d7415204084530':
  Send an message to decouple the gcam module change.

src/com/android/camera/PhotoModule.java

index bed8a21..6256bfb 100644 (file)
@@ -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);
         }
     }