am 7f2a9896
: Merge "Ignore invalid combination of PowerManager flags." into jb-mr1.1-dev
* commit '7f2a98967532138f3f962216ccf2d1a8307d42de': Ignore invalid combination of PowerManager flags.
This commit is contained in:
@ -182,6 +182,8 @@ public final class PowerManager {
|
||||
* </p><p>
|
||||
* Since not all devices have proximity sensors, use {@link #isWakeLockLevelSupported}
|
||||
* to determine whether this wake lock level is supported.
|
||||
* </p><p>
|
||||
* Cannot be used with {@link #ACQUIRE_CAUSES_WAKEUP}.
|
||||
* </p>
|
||||
*
|
||||
* {@hide}
|
||||
|
@ -618,8 +618,19 @@ public final class PowerManagerService extends IPowerManager.Stub
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean isScreenLock(final WakeLock wakeLock) {
|
||||
switch (wakeLock.mFlags & PowerManager.WAKE_LOCK_LEVEL_MASK) {
|
||||
case PowerManager.FULL_WAKE_LOCK:
|
||||
case PowerManager.SCREEN_BRIGHT_WAKE_LOCK:
|
||||
case PowerManager.SCREEN_DIM_WAKE_LOCK:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void applyWakeLockFlagsOnAcquireLocked(WakeLock wakeLock) {
|
||||
if ((wakeLock.mFlags & PowerManager.ACQUIRE_CAUSES_WAKEUP) != 0) {
|
||||
if ((wakeLock.mFlags & PowerManager.ACQUIRE_CAUSES_WAKEUP) != 0 &&
|
||||
isScreenLock(wakeLock)) {
|
||||
wakeUpNoUpdateLocked(SystemClock.uptimeMillis());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user