Revert "Fix race condition triggered by quick stop/start of Dream"

Causes another race condition

This reverts commit 69515b2261.

Bug: 62147987
Change-Id: Ibe6f9bc14ed6cc35d3a23d52300657eaed9bb6d8
This commit is contained in:
Erik Wolsheimer
2017-06-05 16:49:28 +00:00
parent 69515b2261
commit a8e20176af

View File

@@ -86,7 +86,6 @@ public final class DreamManagerService extends SystemService {
private boolean mCurrentDreamCanDoze;
private boolean mCurrentDreamIsDozing;
private boolean mCurrentDreamIsWaking;
private Runnable mStopDreamRunnable;
private int mCurrentDreamDozeScreenState = Display.STATE_UNKNOWN;
private int mCurrentDreamDozeScreenBrightness = PowerManager.BRIGHTNESS_DEFAULT;
@@ -350,11 +349,6 @@ public final class DreamManagerService extends SystemService {
private void startDreamLocked(final ComponentName name,
final boolean isTest, final boolean canDoze, final int userId) {
if (mStopDreamRunnable != null) {
mHandler.removeCallbacks(mStopDreamRunnable);
mStopDreamRunnable = null;
}
if (Objects.equal(mCurrentDreamName, name)
&& mCurrentDreamIsTest == isTest
&& mCurrentDreamCanDoze == canDoze
@@ -392,15 +386,13 @@ public final class DreamManagerService extends SystemService {
mCurrentDreamIsWaking = true;
}
mStopDreamRunnable = new Runnable() {
mHandler.post(new Runnable() {
@Override
public void run() {
Slog.i(TAG, "Performing gentle wake from dream.");
mController.stopDream(immediate);
mStopDreamRunnable = null;
}
};
mHandler.post(mStopDreamRunnable);
});
}
}