summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-08-03 17:32:10 -0700
committerSteve Kondik <steve@cyngn.com>2016-08-03 17:32:10 -0700
commit45769aed47ada21e89084f6fd624700183ed185f (patch)
tree0f25b77c076062db1618f2610cae5046b4e38788
parent81110deb708bfb96b3b8be1e0549652955e05103 (diff)
downloadandroid_packages_apps_Snap-45769aed47ada21e89084f6fd624700183ed185f.zip
android_packages_apps_Snap-45769aed47ada21e89084f6fd624700183ed185f.tar.gz
android_packages_apps_Snap-45769aed47ada21e89084f6fd624700183ed185f.tar.bz2
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
-rw-r--r--src/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 268475a..d4344fb 100644
--- a/res/values/config.xml
+++ b/res/values/config.xml
@@ -64,4 +64,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 8db4d2e..081eb7b 100644
--- a/src/com/android/camera/PhotoModule.java
+++ b/src/com/android/camera/PhotoModule.java
@@ -1754,6 +1754,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;
@@ -1961,7 +1980,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 (flashMode == null) {