Add INCALL_POWER_BUTTON_BEHAVIOR setting.
This is part 1 of the fix for bug 2364220 "Accessibility improvements for
ending calls". This change adds a new (hidden) constant
Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR, for a setting that controls
whether the Power button hangs up the current call, or just turns off the
screen.
Bug: 2364220
Change-Id: I14d4a89b27e99cac51dc16826d217072d999b2d6
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 4995cac..873e1a6f 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -1034,6 +1034,24 @@
public static final String END_BUTTON_BEHAVIOR = "end_button_behavior";
/**
+ * END_BUTTON_BEHAVIOR value for "go home".
+ * @hide
+ */
+ public static final int END_BUTTON_BEHAVIOR_HOME = 0x1;
+
+ /**
+ * END_BUTTON_BEHAVIOR value for "go to sleep".
+ * @hide
+ */
+ public static final int END_BUTTON_BEHAVIOR_SLEEP = 0x2;
+
+ /**
+ * END_BUTTON_BEHAVIOR default value.
+ * @hide
+ */
+ public static final int END_BUTTON_BEHAVIOR_DEFAULT = END_BUTTON_BEHAVIOR_SLEEP;
+
+ /**
* Whether Airplane Mode is on.
*/
public static final String AIRPLANE_MODE_ON = "airplane_mode_on";
@@ -3191,6 +3209,36 @@
public static final String VOICE_RECOGNITION_SERVICE = "voice_recognition_service";
/**
+ * What happens when the user presses the Power button while in-call
+ * and the screen is on.<br/>
+ * <b>Values:</b><br/>
+ * 1 - The Power button turns off the screen and locks the device. (Default behavior)<br/>
+ * 2 - The Power button hangs up the current call.<br/>
+ *
+ * @hide
+ */
+ public static final String INCALL_POWER_BUTTON_BEHAVIOR = "incall_power_button_behavior";
+
+ /**
+ * INCALL_POWER_BUTTON_BEHAVIOR value for "turn off screen".
+ * @hide
+ */
+ public static final int INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF = 0x1;
+
+ /**
+ * INCALL_POWER_BUTTON_BEHAVIOR value for "hang up".
+ * @hide
+ */
+ public static final int INCALL_POWER_BUTTON_BEHAVIOR_HANGUP = 0x2;
+
+ /**
+ * INCALL_POWER_BUTTON_BEHAVIOR default value.
+ * @hide
+ */
+ public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT =
+ INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF;
+
+ /**
* @hide
*/
public static final String[] SETTINGS_TO_BACKUP = {