Loading core/java/android/provider/Settings.java +30 −0 Original line number Diff line number Diff line Loading @@ -5923,6 +5923,36 @@ public final class Settings { public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; /** * What happens when the user presses the Back button while in-call * and the screen is on.<br/> * <b>Values:</b><br/> * 0 - The Back buttons does nothing different.<br/> * 1 - The Back button hangs up the current call.<br/> * * @hide */ public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; /** * INCALL_BACK_BUTTON_BEHAVIOR value for no action. * @hide */ public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; /** * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". * @hide */ public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; /** * INCALL_POWER_BUTTON_BEHAVIOR default value. * @hide */ public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = INCALL_BACK_BUTTON_BEHAVIOR_NONE; /** * Whether the device should wake when the wake gesture sensor detects motion. * @hide Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +33 −1 Original line number Diff line number Diff line Loading @@ -647,6 +647,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { // (See Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR.) int mIncallPowerBehavior; // Behavior of Back button while in-call and screen on int mIncallBackBehavior; Display mDisplay; private int mDisplayRotation; Loading Loading @@ -837,6 +840,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { resolver.registerContentObserver(Settings.Secure.getUriFor( Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Secure.getUriFor( Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Secure.getUriFor( Settings.Secure.WAKE_GESTURE_ENABLED), false, this, UserHandle.USER_ALL); Loading Loading @@ -1069,6 +1075,27 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Reset back long press state cancelPendingBackKeyAction(); if (mHasFeatureWatch) { TelecomManager telecomManager = getTelecommService(); if (telecomManager != null) { if (telecomManager.isRinging()) { // Pressing back while there's a ringing incoming // call should silence the ringer. telecomManager.silenceRinger(); // It should not prevent navigating away return false; } else if ( (mIncallBackBehavior & Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR_HANGUP) != 0 && telecomManager.isInCall()) { // Otherwise, if "Back button ends call" is enabled, // the Back button will hang up any current active call. return telecomManager.endCall(); } } } return handled; } Loading Loading @@ -2020,6 +2047,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT, UserHandle.USER_CURRENT); mIncallBackBehavior = Settings.Secure.getIntForUser(resolver, Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR, Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT, UserHandle.USER_CURRENT); // Configure wake gesture. boolean wakeGestureEnabledSetting = Settings.Secure.getIntForUser(resolver, Loading Loading @@ -8040,6 +8071,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pw.print(" mLockScreenTimerActive="); pw.println(mLockScreenTimerActive); pw.print(prefix); pw.print("mEndcallBehavior="); pw.print(mEndcallBehavior); pw.print(" mIncallPowerBehavior="); pw.print(mIncallPowerBehavior); pw.print(" mIncallBackBehavior="); pw.print(mIncallBackBehavior); pw.print(" mLongPressOnHomeBehavior="); pw.println(mLongPressOnHomeBehavior); pw.print(prefix); pw.print("mLandscapeRotation="); pw.print(mLandscapeRotation); pw.print(" mSeascapeRotation="); pw.println(mSeascapeRotation); Loading Loading
core/java/android/provider/Settings.java +30 −0 Original line number Diff line number Diff line Loading @@ -5923,6 +5923,36 @@ public final class Settings { public static final int INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT = INCALL_POWER_BUTTON_BEHAVIOR_SCREEN_OFF; /** * What happens when the user presses the Back button while in-call * and the screen is on.<br/> * <b>Values:</b><br/> * 0 - The Back buttons does nothing different.<br/> * 1 - The Back button hangs up the current call.<br/> * * @hide */ public static final String INCALL_BACK_BUTTON_BEHAVIOR = "incall_back_button_behavior"; /** * INCALL_BACK_BUTTON_BEHAVIOR value for no action. * @hide */ public static final int INCALL_BACK_BUTTON_BEHAVIOR_NONE = 0x0; /** * INCALL_BACK_BUTTON_BEHAVIOR value for "hang up". * @hide */ public static final int INCALL_BACK_BUTTON_BEHAVIOR_HANGUP = 0x1; /** * INCALL_POWER_BUTTON_BEHAVIOR default value. * @hide */ public static final int INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT = INCALL_BACK_BUTTON_BEHAVIOR_NONE; /** * Whether the device should wake when the wake gesture sensor detects motion. * @hide Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +33 −1 Original line number Diff line number Diff line Loading @@ -647,6 +647,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { // (See Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR.) int mIncallPowerBehavior; // Behavior of Back button while in-call and screen on int mIncallBackBehavior; Display mDisplay; private int mDisplayRotation; Loading Loading @@ -837,6 +840,9 @@ public class PhoneWindowManager implements WindowManagerPolicy { resolver.registerContentObserver(Settings.Secure.getUriFor( Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Secure.getUriFor( Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR), false, this, UserHandle.USER_ALL); resolver.registerContentObserver(Settings.Secure.getUriFor( Settings.Secure.WAKE_GESTURE_ENABLED), false, this, UserHandle.USER_ALL); Loading Loading @@ -1069,6 +1075,27 @@ public class PhoneWindowManager implements WindowManagerPolicy { // Reset back long press state cancelPendingBackKeyAction(); if (mHasFeatureWatch) { TelecomManager telecomManager = getTelecommService(); if (telecomManager != null) { if (telecomManager.isRinging()) { // Pressing back while there's a ringing incoming // call should silence the ringer. telecomManager.silenceRinger(); // It should not prevent navigating away return false; } else if ( (mIncallBackBehavior & Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR_HANGUP) != 0 && telecomManager.isInCall()) { // Otherwise, if "Back button ends call" is enabled, // the Back button will hang up any current active call. return telecomManager.endCall(); } } } return handled; } Loading Loading @@ -2020,6 +2047,10 @@ public class PhoneWindowManager implements WindowManagerPolicy { Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR, Settings.Secure.INCALL_POWER_BUTTON_BEHAVIOR_DEFAULT, UserHandle.USER_CURRENT); mIncallBackBehavior = Settings.Secure.getIntForUser(resolver, Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR, Settings.Secure.INCALL_BACK_BUTTON_BEHAVIOR_DEFAULT, UserHandle.USER_CURRENT); // Configure wake gesture. boolean wakeGestureEnabledSetting = Settings.Secure.getIntForUser(resolver, Loading Loading @@ -8040,6 +8071,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { pw.print(" mLockScreenTimerActive="); pw.println(mLockScreenTimerActive); pw.print(prefix); pw.print("mEndcallBehavior="); pw.print(mEndcallBehavior); pw.print(" mIncallPowerBehavior="); pw.print(mIncallPowerBehavior); pw.print(" mIncallBackBehavior="); pw.print(mIncallBackBehavior); pw.print(" mLongPressOnHomeBehavior="); pw.println(mLongPressOnHomeBehavior); pw.print(prefix); pw.print("mLandscapeRotation="); pw.print(mLandscapeRotation); pw.print(" mSeascapeRotation="); pw.println(mSeascapeRotation); Loading