Parcourir la source

Do not disable wake keys in ambient and when screen is off.

Signed-off-by: Jens Lody <jens@jenslody.de>
ten
Jens Lody il y a 1 an
Parent
révision
3dfed1158d

+ 5
- 5
services/core/java/com/android/server/policy/PhoneWindowManager.java Voir le fichier

@@ -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.

Chargement…
Annuler
Enregistrer