Loading core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -4343,4 +4343,9 @@ <!-- Boolean indicating whether frameworks needs to reset cell broadcast geo-fencing check after reboot or airplane mode toggling --> <bool translatable="false" name="reset_geo_fencing_check_after_boot_or_apm">false</bool> <!-- Screen Wake Keys Determines whether the specified key groups can be used to wake up the device. --> <bool name="config_wakeOnDpadKeyPress">true</bool> <bool name="config_wakeOnAssistKeyPress">true</bool> </resources> core/res/res/values/symbols.xml +4 −0 Original line number Diff line number Diff line Loading @@ -3027,6 +3027,10 @@ <java-symbol type="id" name="notification_action_list_margin_target" /> <java-symbol type="dimen" name="notification_action_disabled_alpha" /> <!-- Override Wake Key Behavior When Screen is Off --> <java-symbol type="bool" name="config_wakeOnDpadKeyPress" /> <java-symbol type="bool" name="config_wakeOnAssistKeyPress" /> <!-- Pinner Service --> <java-symbol type="array" name="config_defaultPinnerServiceFiles" /> <java-symbol type="bool" name="config_pinnerCameraApp" /> Loading services/core/java/com/android/server/policy/PhoneWindowManager.java +20 −2 Original line number Diff line number Diff line Loading @@ -481,6 +481,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mVeryLongPressTimeout; boolean mAllowStartActivityForLongPressOnPowerDuringSetup; MetricsLogger mLogger; boolean mWakeOnDpadKeyPress; boolean mWakeOnAssistKeyPress; private boolean mHandleVolumeKeysInWM; Loading Loading @@ -1729,6 +1731,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { mAccessibilityShortcutController = new AccessibilityShortcutController(mContext, new Handler(), mCurrentUserId); mLogger = new MetricsLogger(); Resources res = mContext.getResources(); mWakeOnDpadKeyPress = res.getBoolean(com.android.internal.R.bool.config_wakeOnDpadKeyPress); mWakeOnAssistKeyPress = res.getBoolean(com.android.internal.R.bool.config_wakeOnAssistKeyPress); // Init display burn-in protection boolean burnInProtectionEnabled = context.getResources().getBoolean( com.android.internal.R.bool.config_enableBurnInProtection); Loading Loading @@ -4072,13 +4081,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { */ private boolean isWakeKeyWhenScreenOff(int keyCode) { switch (keyCode) { // ignore volume keys unless docked case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_MUTE: return mDefaultDisplayPolicy.getDockMode() != Intent.EXTRA_DOCK_STATE_UNDOCKED; // ignore media keys case KeyEvent.KEYCODE_MUTE: case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_MEDIA_PLAY: Loading @@ -4092,7 +4099,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: case KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK: return false; case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_DPAD_DOWN: case KeyEvent.KEYCODE_DPAD_LEFT: case KeyEvent.KEYCODE_DPAD_RIGHT: case KeyEvent.KEYCODE_DPAD_CENTER: return mWakeOnDpadKeyPress; case KeyEvent.KEYCODE_ASSIST: return mWakeOnAssistKeyPress; } return true; } Loading Loading
core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -4343,4 +4343,9 @@ <!-- Boolean indicating whether frameworks needs to reset cell broadcast geo-fencing check after reboot or airplane mode toggling --> <bool translatable="false" name="reset_geo_fencing_check_after_boot_or_apm">false</bool> <!-- Screen Wake Keys Determines whether the specified key groups can be used to wake up the device. --> <bool name="config_wakeOnDpadKeyPress">true</bool> <bool name="config_wakeOnAssistKeyPress">true</bool> </resources>
core/res/res/values/symbols.xml +4 −0 Original line number Diff line number Diff line Loading @@ -3027,6 +3027,10 @@ <java-symbol type="id" name="notification_action_list_margin_target" /> <java-symbol type="dimen" name="notification_action_disabled_alpha" /> <!-- Override Wake Key Behavior When Screen is Off --> <java-symbol type="bool" name="config_wakeOnDpadKeyPress" /> <java-symbol type="bool" name="config_wakeOnAssistKeyPress" /> <!-- Pinner Service --> <java-symbol type="array" name="config_defaultPinnerServiceFiles" /> <java-symbol type="bool" name="config_pinnerCameraApp" /> Loading
services/core/java/com/android/server/policy/PhoneWindowManager.java +20 −2 Original line number Diff line number Diff line Loading @@ -481,6 +481,8 @@ public class PhoneWindowManager implements WindowManagerPolicy { int mVeryLongPressTimeout; boolean mAllowStartActivityForLongPressOnPowerDuringSetup; MetricsLogger mLogger; boolean mWakeOnDpadKeyPress; boolean mWakeOnAssistKeyPress; private boolean mHandleVolumeKeysInWM; Loading Loading @@ -1729,6 +1731,13 @@ public class PhoneWindowManager implements WindowManagerPolicy { mAccessibilityShortcutController = new AccessibilityShortcutController(mContext, new Handler(), mCurrentUserId); mLogger = new MetricsLogger(); Resources res = mContext.getResources(); mWakeOnDpadKeyPress = res.getBoolean(com.android.internal.R.bool.config_wakeOnDpadKeyPress); mWakeOnAssistKeyPress = res.getBoolean(com.android.internal.R.bool.config_wakeOnAssistKeyPress); // Init display burn-in protection boolean burnInProtectionEnabled = context.getResources().getBoolean( com.android.internal.R.bool.config_enableBurnInProtection); Loading Loading @@ -4072,13 +4081,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { */ private boolean isWakeKeyWhenScreenOff(int keyCode) { switch (keyCode) { // ignore volume keys unless docked case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: case KeyEvent.KEYCODE_VOLUME_MUTE: return mDefaultDisplayPolicy.getDockMode() != Intent.EXTRA_DOCK_STATE_UNDOCKED; // ignore media keys case KeyEvent.KEYCODE_MUTE: case KeyEvent.KEYCODE_HEADSETHOOK: case KeyEvent.KEYCODE_MEDIA_PLAY: Loading @@ -4092,7 +4099,18 @@ public class PhoneWindowManager implements WindowManagerPolicy { case KeyEvent.KEYCODE_MEDIA_FAST_FORWARD: case KeyEvent.KEYCODE_MEDIA_AUDIO_TRACK: return false; case KeyEvent.KEYCODE_DPAD_UP: case KeyEvent.KEYCODE_DPAD_DOWN: case KeyEvent.KEYCODE_DPAD_LEFT: case KeyEvent.KEYCODE_DPAD_RIGHT: case KeyEvent.KEYCODE_DPAD_CENTER: return mWakeOnDpadKeyPress; case KeyEvent.KEYCODE_ASSIST: return mWakeOnAssistKeyPress; } return true; } Loading