summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjinwu <jinwu@codeaurora.org>2019-07-04 15:24:55 +0800
committerjinwu <jinwu@codeaurora.org>2019-07-18 10:32:11 +0800
commitc56a874bf360beb6ea44dca3cc9722475f3c5506 (patch)
tree00a72f15b2f5a7746cbe7d10c08f3c0fa6789a54
parent6e83a73e414f31044b692b3b7132b9b9c7d22ab2 (diff)
downloadandroid_packages_apps_Snap-c56a874bf360beb6ea44dca3cc9722475f3c5506.tar.gz
android_packages_apps_Snap-c56a874bf360beb6ea44dca3cc9722475f3c5506.tar.bz2
android_packages_apps_Snap-c56a874bf360beb6ea44dca3cc9722475f3c5506.zip
Fix GTS issues
1. USE_FRONT_CAMERA If USE_FRONT_CAMERA is true, use the front-facing camera to take a picture. 2. TIMER_DURATION_SECONDS If TIMER_DURATION_SECONDS has values, wait then capture. Change-Id: I09ec71118656c6ad1be41e2fe7a03bde911c14bb
-rwxr-xr-x[-rw-r--r--]src/com/android/camera/CaptureModule.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index 76f48a6d8..8be66474b 100644..100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -466,6 +466,8 @@ public class CaptureModule implements CameraModule, PhotoController,
private ParcelFileDescriptor mVideoFileDescriptor;
private Uri mSaveUri;
private boolean mQuickCapture;
+ private boolean mUseFrontCamera;
+ private int mTimer;
private byte[] mJpegImageData;
private boolean mSaveRaw = false;
private boolean mSupportZoomCapture = true;
@@ -1205,6 +1207,7 @@ public class CaptureModule implements CameraModule, PhotoController,
}
public boolean isBackCamera() {
+ if (mUseFrontCamera)return false;
String switchValue = mSettingsManager.getValue(SettingsManager.KEY_SWITCH_CAMERA);
if (switchValue != null && !switchValue.equals("-1") ) {
CharSequence[] value = mSettingsManager.getEntryValues(SettingsManager.KEY_SWITCH_CAMERA);
@@ -1862,6 +1865,9 @@ public class CaptureModule implements CameraModule, PhotoController,
if (myExtras != null) {
mSaveUri = (Uri) myExtras.getParcelable(MediaStore.EXTRA_OUTPUT);
mCropValue = myExtras.getString("crop");
+ mUseFrontCamera = myExtras.getBoolean("android.intent.extra.USE_FRONT_CAMERA", false);
+ mTimer = myExtras.getInt("android.intent.extra.TIMER_DURATION_SECONDS", 0);
+ Log.d(TAG, "mUseFrontCamera :" + mUseFrontCamera + ", mTimer :" + mTimer);
}
}
@@ -5695,6 +5701,7 @@ public class CaptureModule implements CameraModule, PhotoController,
String timer = mSettingsManager.getValue(SettingsManager.KEY_TIMER);
int seconds = Integer.parseInt(timer);
+ if (mTimer > 0) seconds = mTimer;
// When shutter button is pressed, check whether the previous countdown is
// finished. If not, cancel the previous countdown and start a new one.
if (mUI.isCountingDown()) {