diff options
author | Michael Bestas <mikeioannina@gmail.com> | 2013-11-05 16:43:50 +0200 |
---|---|---|
committer | Arne Coucheron <arco68@gmail.com> | 2018-01-26 00:53:42 +0100 |
commit | 3ca89c6437e7689388e2d94853afe7a2235bcd01 (patch) | |
tree | 3915d4462d48a66db6a21dff51a6f90207eb423d /src/com/android/camera/util | |
parent | 641acd0dae922ae4e0688f58e7a60088e19f01c0 (diff) | |
download | android_packages_apps_Snap-3ca89c6437e7689388e2d94853afe7a2235bcd01.tar.gz android_packages_apps_Snap-3ca89c6437e7689388e2d94853afe7a2235bcd01.tar.bz2 android_packages_apps_Snap-3ca89c6437e7689388e2d94853afe7a2235bcd01.zip |
Camera: Cleanup hardware key handling
* Fix power shutter behaviour in camcorder mode
* Disable volume change while in panorama mode, volume buttons should only
handle camera operations while in the camera
* Add camera/power/volume key shutter handling in panorama mode
On devices with a hardware camera key:
* Disable power & volume shutter features
* Volume buttons control the zoom
On devices without a hardware camera key:
* When power shutter is disabled, volume buttons control the shutter (like AOSP)
* When power shutter is enabled, volume buttons control the zoom
Change-Id: I141946d5b6f5aec8b1e9a9f99270d30295596079
Diffstat (limited to 'src/com/android/camera/util')
-rw-r--r-- | src/com/android/camera/util/CameraUtil.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java index 5954b6e41..b1d3e8c72 100644 --- a/src/com/android/camera/util/CameraUtil.java +++ b/src/com/android/camera/util/CameraUtil.java @@ -142,6 +142,9 @@ public class CameraUtil { public static final String TRUE = "true"; public static final String FALSE = "false"; + // Hardware camera key mask + private static final int KEY_MASK_CAMERA = 0x20; + // Fields for the show-on-maps-functionality private static final String MAPS_PACKAGE_NAME = "com.google.android.apps.maps"; private static final String MAPS_CLASS_NAME = "com.google.android.maps.MapsActivity"; @@ -186,6 +189,10 @@ public class CameraUtil { return (supported != null) && supported.contains(SCENE_MODE_HDR); } + public static boolean hasCameraKey() { + return (sDeviceKeysPresent & KEY_MASK_CAMERA) != 0; + } + public static boolean isMeteringAreaSupported(Parameters params) { return params.getMaxNumMeteringAreas() > 0; } @@ -211,6 +218,9 @@ public class CameraUtil { private static float sPixelDensity = 1; private static ImageFileNamer sImageFileNamer; + // Get available hardware keys + private static int sDeviceKeysPresent; + private CameraUtil() { } @@ -222,6 +232,8 @@ public class CameraUtil { sPixelDensity = metrics.density; sImageFileNamer = new ImageFileNamer( context.getString(R.string.image_file_name_format)); + sDeviceKeysPresent = context.getResources().getInteger( + org.lineageos.platform.internal.R.integer.config_deviceHardwareKeys); } public static int dpToPixel(int dp) { |