Respect "power button instantly locks" setting for dream behavior.
Don't instantly lock the device on single power button click if the "power button instantly locks" setting is off. This is only on devices that have single power button press configured to start dreaming. Bug: 263161209 Test: manually by turning "power button instantly locks" setting off, enabling screen saver, docking device, and tapping the power button to start dreaming. The device should not be locked. Then, set up again with the same conditions, turn on the "power button instantly locks" setting, then tap the power button to start dreaming. The device should be locked. Merged-In: I991504805c534eb76269579a2e753318fe0f1811 Change-Id: If1f611c2ebc189ff294ea6f5b411d22eafc8e2ae
This commit is contained in:
@@ -199,6 +199,7 @@ import com.android.internal.policy.PhoneWindow;
|
||||
import com.android.internal.policy.TransitionAnimation;
|
||||
import com.android.internal.statusbar.IStatusBarService;
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.server.ExtconStateObserver;
|
||||
import com.android.server.ExtconUEventObserver;
|
||||
import com.android.server.GestureLauncherService;
|
||||
@@ -407,6 +408,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
AppOpsManager mAppOpsManager;
|
||||
PackageManager mPackageManager;
|
||||
SideFpsEventHandler mSideFpsEventHandler;
|
||||
LockPatternUtils mLockPatternUtils;
|
||||
private boolean mHasFeatureAuto;
|
||||
private boolean mHasFeatureWatch;
|
||||
private boolean mHasFeatureLeanback;
|
||||
@@ -1056,8 +1058,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
}
|
||||
|
||||
synchronized (mLock) {
|
||||
// Lock the device after the dream transition has finished.
|
||||
mLockAfterAppTransitionFinished = true;
|
||||
// If the setting to lock instantly on power button press is true, then set the flag to
|
||||
// lock after the dream transition has finished.
|
||||
mLockAfterAppTransitionFinished =
|
||||
mLockPatternUtils.getPowerButtonInstantlyLocks(mCurrentUserId);
|
||||
}
|
||||
|
||||
dreamManagerInternal.requestDream();
|
||||
@@ -1929,6 +1933,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
|
||||
mHasFeatureHdmiCec = mPackageManager.hasSystemFeature(FEATURE_HDMI_CEC);
|
||||
mAccessibilityShortcutController =
|
||||
new AccessibilityShortcutController(mContext, new Handler(), mCurrentUserId);
|
||||
mLockPatternUtils = new LockPatternUtils(mContext);
|
||||
mLogger = new MetricsLogger();
|
||||
|
||||
mScreenOffSleepTokenAcquirer = mActivityTaskManagerInternal
|
||||
|
||||
Reference in New Issue
Block a user