summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-08-03 17:32:10 -0700
committerChippa-a <vusal1372@gmail.com>2019-10-25 15:55:25 +0300
commit0f6a9f3ca35706334950438a8605791dd7c7fc92 (patch)
treec9b9290f096f9c8e67c5771d082294d14decb0fc
parent80a00580a3fd97ae49cea0b455c00ef7dc79db06 (diff)
downloadandroid_packages_apps_Snap-0f6a9f3ca35706334950438a8605791dd7c7fc92.tar.gz
android_packages_apps_Snap-0f6a9f3ca35706334950438a8605791dd7c7fc92.tar.bz2
android_packages_apps_Snap-0f6a9f3ca35706334950438a8605791dd7c7fc92.zip
snap: Add constrained longshot mode
* On the OP3, we can only use Longshot in a single scene mode without conflicting with other built-in postprocessing features which cannot be disabled. Add support for this. When a scene specified in the longshot-scenemodes list is active, continuous shot will be enabled. Change-Id: I79878e5ac918e907ddc5b3ca168e49f4e06656c3
-rw-r--r--res/values/config.xml6
-rwxr-xr-xsrc/com/android/camera/PhotoModule.java21
2 files changed, 26 insertions, 1 deletions
diff --git a/res/values/config.xml b/res/values/config.xml
index 0db23305d..f0b611fe6 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -62,4 +62,10 @@
<!-- Set this to true to use device manufacturer and model for exif -->
<bool name="override_maker_and_model_tag">false</bool>
+
+ <!-- A list of scenemodes where Longshot should be enabled.
+ An empty list will use the default restrictions. If defined, longshot
+ will be enabled ONLY for these scenemodes and disabled for others. -->
+ <string-array name="longshot_scenemodes"></string-array>
+
</resources>
diff --git a/src/com/android/camera/PhotoModule.java b/src/com/android/camera/PhotoModule.java
index 97ef5fa54..1e8d8d9af 100755
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1884,6 +1884,25 @@ public class PhotoModule
}
}
+ private void updateLongshotScene() {
+ String[] longshotScenes = mActivity.getResources().getStringArray(
+ R.array.longshot_scenemodes);
+ if (longshotScenes.length == 0) {
+ mUI.overrideSettings(CameraSettings.KEY_LONGSHOT, null);
+ return;
+ }
+ boolean useLongshot = false;
+ for (String scene : longshotScenes) {
+ if (scene.equals(mSceneMode)) {
+ useLongshot = true;
+ break;
+ }
+ }
+ mUI.overrideSettings(CameraSettings.KEY_LONGSHOT,
+ useLongshot ? mActivity.getString(R.string.setting_on_value) :
+ mActivity.getString(R.string.setting_off_value));
+ }
+
private void updateCommonManual3ASettings() {
mSceneMode = Parameters.SCENE_MODE_AUTO;
String flashMode = Parameters.FLASH_MODE_OFF;
@@ -2088,7 +2107,7 @@ public class PhotoModule
mUI.overrideSettings(CameraSettings.KEY_LONGSHOT,
mActivity.getString(R.string.setting_off_value));
} else {
- mUI.overrideSettings(CameraSettings.KEY_LONGSHOT, null);
+ updateLongshotScene();
}
if(TsMakeupManager.HAS_TS_MAKEUP) {