summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Galia Peycheva <galinap@google.com> 2020-03-24 11:38:38 +0100
committer Galia Peycheva <galinap@google.com> 2020-03-24 15:31:19 +0100
commita37fc59fde30854a823ccd54ba0d0eaa6fea65f7 (patch)
tree6adb8ce1c996a2e947f0980dd24f1efefba5d3f1
parent5bd455ac5f0f09280ae59e3eeb74ea7e3b7e4823 (diff)
Remove usage of sleep tokens during dreams
Previously, a sleep token wass acquired when the dream starts. This was done because the dream was implemented as a floating window. Acquiring the sleep token puts all other activities in a sleeping state. Since ag/10493254, the dream is implemented using an activity. When the activity shows on top of other activities, the rest are automatically moved to a STOPPED state. Hence, the sleep token is no longer needed and can be removed. Bug: 152284980 Test: m && flash && verify dream start/stop works + it doesn't interfere with the keyguard Change-Id: I00fc4b0b0e63702086fb283329605556936ec084
-rw-r--r--services/core/java/com/android/server/wm/DisplayPolicy.java35
1 files changed, 0 insertions, 35 deletions
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index 34acabe76296..5e88fb0437c6 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -115,7 +115,6 @@ import static com.android.server.policy.WindowManagerPolicy.TRANSIT_HIDE;
import static com.android.server.policy.WindowManagerPolicy.TRANSIT_PREVIEW_DONE;
import static com.android.server.policy.WindowManagerPolicy.TRANSIT_SHOW;
import static com.android.server.policy.WindowManagerPolicy.WindowManagerFuncs.LID_ABSENT;
-import static com.android.server.wm.ActivityTaskManagerInternal.SleepToken;
import static com.android.server.wm.ProtoLogGroup.WM_DEBUG_SCREEN_ON;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_ANIM;
import static com.android.server.wm.WindowManagerDebugConfig.DEBUG_LAYOUT;
@@ -178,7 +177,6 @@ import android.view.WindowManagerPolicyConstants;
import android.view.accessibility.AccessibilityManager;
import com.android.internal.R;
-import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.policy.GestureNavigationSettingsObserver;
import com.android.internal.policy.ScreenDecorationsUtils;
@@ -333,9 +331,6 @@ public class DisplayPolicy {
}
};
- @GuardedBy("mHandler")
- private SleepToken mDreamingSleepToken;
-
// The windows we were told about in focusChanged.
private WindowState mFocusedWindow;
private WindowState mLastFocusedWindow;
@@ -394,7 +389,6 @@ public class DisplayPolicy {
private boolean mShowingDream;
private boolean mLastShowingDream;
private boolean mDreamingLockscreen;
- private boolean mDreamingSleepTokenNeeded;
private boolean mAllowLockscreenWhenOn;
private InputConsumer mInputConsumer = null;
@@ -414,7 +408,6 @@ public class DisplayPolicy {
private RefreshRatePolicy mRefreshRatePolicy;
// -------- PolicyHandler --------
- private static final int MSG_UPDATE_DREAMING_SLEEP_TOKEN = 1;
private static final int MSG_REQUEST_TRANSIENT_BARS = 2;
private static final int MSG_DISPOSE_INPUT_CONSUMER = 3;
private static final int MSG_ENABLE_POINTER_LOCATION = 4;
@@ -434,9 +427,6 @@ public class DisplayPolicy {
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
- case MSG_UPDATE_DREAMING_SLEEP_TOKEN:
- updateDreamingSleepToken(msg.arg1 != 0);
- break;
case MSG_REQUEST_TRANSIENT_BARS:
synchronized (mLock) {
WindowState targetBar = (msg.arg1 == MSG_REQUEST_TRANSIENT_BARS_ARG_STATUS)
@@ -2638,15 +2628,6 @@ public class DisplayPolicy {
// while the dream is showing.
if (!mShowingDream) {
mDreamingLockscreen = mService.mPolicy.isKeyguardShowingAndNotOccluded();
- if (mDreamingSleepTokenNeeded) {
- mDreamingSleepTokenNeeded = false;
- mHandler.obtainMessage(MSG_UPDATE_DREAMING_SLEEP_TOKEN, 0, 1).sendToTarget();
- }
- } else {
- if (!mDreamingSleepTokenNeeded) {
- mDreamingSleepTokenNeeded = true;
- mHandler.obtainMessage(MSG_UPDATE_DREAMING_SLEEP_TOKEN, 1, 1).sendToTarget();
- }
}
if (mStatusBar != null) {
@@ -3160,21 +3141,6 @@ public class DisplayPolicy {
return !mShowingDream;
}
- private void updateDreamingSleepToken(boolean acquire) {
- if (acquire) {
- final int displayId = getDisplayId();
- if (mDreamingSleepToken == null) {
- mDreamingSleepToken = mService.mAtmInternal.acquireSleepToken(
- "DreamOnDisplay" + displayId, displayId);
- }
- } else {
- if (mDreamingSleepToken != null) {
- mDreamingSleepToken.release();
- mDreamingSleepToken = null;
- }
- }
- }
-
private void requestTransientBars(WindowState swipeTarget) {
if (!mService.mPolicy.isUserSetupComplete()) {
// Swipe-up for navigation bar is disabled during setup
@@ -3854,7 +3820,6 @@ public class DisplayPolicy {
}
pw.print(prefix); pw.print("mShowingDream="); pw.print(mShowingDream);
pw.print(" mDreamingLockscreen="); pw.print(mDreamingLockscreen);
- pw.print(" mDreamingSleepToken="); pw.println(mDreamingSleepToken);
if (mStatusBar != null) {
pw.print(prefix); pw.print("mStatusBar="); pw.print(mStatusBar);
}