Add a secure setting for double twist gesture for camera flip.
Add Secure.CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED to control whether the
double twist gesture should flip the camera between front and back mode
is enabled or not. Also move SYSTEM_NAVIGATION_KEYS_ENABLED from
Global to Secure.
Bug: 29869445
Change-Id: I614289e6de7b1ee4221de7047a5e0dd784607bed
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 9fe3efc..56610ed 100755
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -6147,6 +6147,15 @@
"camera_double_tap_power_gesture_disabled";
/**
+ * Whether the camera double twist gesture to flip between front and back mode should be
+ * enabled.
+ *
+ * @hide
+ */
+ public static final String CAMERA_DOUBLE_TWIST_TO_FLIP_ENABLED =
+ "camera_double_twist_to_flip_enabled";
+
+ /**
* Control whether Night display is currently activated.
* @hide
*/
@@ -6301,6 +6310,14 @@
/**
+ * Whether SystemUI navigation keys is enabled.
+ * @hide
+ */
+ public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
+ "system_navigation_keys_enabled";
+
+
+ /**
* This are the settings to be backed up.
*
* NOTE: Settings are backed up and restored in the order they appear
@@ -9114,13 +9131,6 @@
public static final String MAX_NOTIFICATION_ENQUEUE_RATE = "max_notification_enqueue_rate";
/**
- * Whether SystemUI navigation keys is enabled.
- * @hide
- */
- public static final String SYSTEM_NAVIGATION_KEYS_ENABLED =
- "system_navigation_keys_enabled";
-
- /**
* Whether cell is enabled/disabled
* @hide
*/
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 45322b3..446c75c 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -7280,8 +7280,8 @@
}
private boolean areSystemNavigationKeysEnabled() {
- return Settings.Global.getInt(mContext.getContentResolver(),
- Settings.Global.SYSTEM_NAVIGATION_KEYS_ENABLED, 1) == 1;
+ return Settings.Secure.getInt(mContext.getContentResolver(),
+ Settings.Secure.SYSTEM_NAVIGATION_KEYS_ENABLED, 1) == 1;
}
@Override