|
|
@@ -4060,11 +4060,6 @@ public class PhoneWindowManager implements WindowManagerPolicy { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
// Disable hw keys in Ambient and when screen off |
|
|
|
if ((isDozeMode() || !isScreenOn()) && (appSwitchKey || homeKey || menuKey || backKey)) { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
// Basic policy based on interactive state. |
|
|
|
boolean isVolumeRockerWake = !isScreenOn() |
|
|
|
&& mVolumeRockerWake |
|
|
@@ -4074,6 +4069,11 @@ public class PhoneWindowManager implements WindowManagerPolicy { |
|
|
|
int result; |
|
|
|
boolean isWakeKey = (policyFlags & WindowManagerPolicy.FLAG_WAKE) != 0 |
|
|
|
|| event.isWakeKey() || isVolumeRockerWake; |
|
|
|
// Disable hw keys in Ambient and when screen off |
|
|
|
if ((isDozeMode() || !isScreenOn()) && (appSwitchKey || homeKey || menuKey || backKey) && !isWakeKey) { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
if (interactive || (isInjected && !isWakeKey)) { |
|
|
|
// When the device is interactive or the key is injected pass the |
|
|
|
// key to the application. |