am eccaf729: Allow going to home action to work for SHORT_PRESS_POWER_GO_HOME with keyguard enabled.
* commit 'eccaf7290ab833d12049a184747603cd74261490': Allow going to home action to work for SHORT_PRESS_POWER_GO_HOME with keyguard enabled.
This commit is contained in:
@@ -992,7 +992,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
launchHomeFromHotKey();
|
launchHomeFromHotKey();
|
||||||
break;
|
break;
|
||||||
case SHORT_PRESS_POWER_GO_HOME:
|
case SHORT_PRESS_POWER_GO_HOME:
|
||||||
launchHomeFromHotKey();
|
launchHomeFromHotKey(true /* awakenFromDreams */, false /*respectKeyguard*/);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1070,7 +1070,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
PowerManager.GO_TO_SLEEP_REASON_SLEEP_BUTTON, 0);
|
PowerManager.GO_TO_SLEEP_REASON_SLEEP_BUTTON, 0);
|
||||||
break;
|
break;
|
||||||
case SHORT_PRESS_SLEEP_GO_TO_SLEEP_AND_GO_HOME:
|
case SHORT_PRESS_SLEEP_GO_TO_SLEEP_AND_GO_HOME:
|
||||||
launchHomeFromHotKey(false /* awakenDreams */);
|
launchHomeFromHotKey(false /* awakenDreams */, true /*respectKeyguard*/);
|
||||||
mPowerManager.goToSleep(event.getEventTime(),
|
mPowerManager.goToSleep(event.getEventTime(),
|
||||||
PowerManager.GO_TO_SLEEP_REASON_SLEEP_BUTTON, 0);
|
PowerManager.GO_TO_SLEEP_REASON_SLEEP_BUTTON, 0);
|
||||||
break;
|
break;
|
||||||
@@ -3064,17 +3064,21 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void launchHomeFromHotKey() {
|
void launchHomeFromHotKey() {
|
||||||
launchHomeFromHotKey(true /* awakenFromDreams */);
|
launchHomeFromHotKey(true /* awakenFromDreams */, true /*respectKeyguard*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A home key -> launch home action was detected. Take the appropriate action
|
* A home key -> launch home action was detected. Take the appropriate action
|
||||||
* given the situation with the keyguard.
|
* given the situation with the keyguard.
|
||||||
*/
|
*/
|
||||||
void launchHomeFromHotKey(final boolean awakenFromDreams) {
|
void launchHomeFromHotKey(final boolean awakenFromDreams, final boolean respectKeyguard) {
|
||||||
|
if (respectKeyguard) {
|
||||||
if (isKeyguardShowingAndNotOccluded()) {
|
if (isKeyguardShowingAndNotOccluded()) {
|
||||||
// don't launch home if keyguard showing
|
// don't launch home if keyguard showing
|
||||||
} else if (!mHideLockScreen && mKeyguardDelegate.isInputRestricted()) {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mHideLockScreen && mKeyguardDelegate.isInputRestricted()) {
|
||||||
// when in keyguard restricted mode, must first verify unlock
|
// when in keyguard restricted mode, must first verify unlock
|
||||||
// before launching home
|
// before launching home
|
||||||
mKeyguardDelegate.verifyUnlock(new OnKeyguardExitResult() {
|
mKeyguardDelegate.verifyUnlock(new OnKeyguardExitResult() {
|
||||||
@@ -3090,7 +3094,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// no keyguard stuff to worry about, just launch home!
|
// no keyguard stuff to worry about, just launch home!
|
||||||
try {
|
try {
|
||||||
ActivityManagerNative.getDefault().stopAppSwitches();
|
ActivityManagerNative.getDefault().stopAppSwitches();
|
||||||
@@ -3109,7 +3116,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
|||||||
startDockOrHome(true /*fromHomeKey*/, awakenFromDreams);
|
startDockOrHome(true /*fromHomeKey*/, awakenFromDreams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private final Runnable mClearHideNavigationFlag = new Runnable() {
|
private final Runnable mClearHideNavigationFlag = new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user