summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/CameraActivity.java')
-rwxr-xr-xsrc/com/android/camera/CameraActivity.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index a330f6a5f..1ebc3f047 100755
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -69,7 +69,6 @@ import android.os.PowerManager.WakeLock;
import android.os.SystemProperties;
import android.preference.PreferenceManager;
import android.provider.MediaStore;
-import android.provider.Settings;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
@@ -226,6 +225,7 @@ public class CameraActivity extends Activity
private FrameLayout mPreviewContentLayout;
private boolean mPaused = true;
private boolean mHasCriticalPermissions;
+ private boolean mForceReleaseCamera = false;
private Uri[] mNfcPushUris = new Uri[1];
@@ -1912,9 +1912,9 @@ public class CameraActivity extends Activity
switch (requestCode) {
case PERMISSIONS_REQUEST_ACCESS_COARSE_LOCATION: {
// If request is cancelled, the result arrays are empty.
- mCurrentModule.waitingLocationPermissionResult(false);
+ mCurrentModule.waitingLocationPermissionResult(false);
if (grantResults.length > 0
- && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
+ && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
Log.v(TAG, "Location permission is granted");
mCurrentModule.enableRecordingLocation(true);
} else {
@@ -1926,11 +1926,17 @@ public class CameraActivity extends Activity
}
}
+ public boolean isForceReleaseCamera() {
+ return mForceReleaseCamera;
+ }
+
@Override
public void onModuleSelected(int moduleIndex) {
boolean cam2on = SettingsManager.getInstance().isCamera2On();
- if (cam2on && moduleIndex == ModuleSwitcher.PHOTO_MODULE_INDEX)
+ mForceReleaseCamera = cam2on && moduleIndex == ModuleSwitcher.PHOTO_MODULE_INDEX;
+ if (mForceReleaseCamera) {
moduleIndex = ModuleSwitcher.CAPTURE_MODULE_INDEX;
+ }
if (mCurrentModuleIndex == moduleIndex) {
if (mCurrentModuleIndex != ModuleSwitcher.CAPTURE_MODULE_INDEX) {
return;
@@ -1941,6 +1947,7 @@ public class CameraActivity extends Activity
setModuleFromIndex(moduleIndex);
openModule(mCurrentModule);
+ mForceReleaseCamera = false;
mCurrentModule.onOrientationChanged(mLastRawOrientation);
if (mMediaSaveService != null) {
mCurrentModule.onMediaSaveServiceConnected(mMediaSaveService);