Merge "Check for null appToken" into oc-mr1-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ba893e6a10
@@ -1646,14 +1646,17 @@ class WindowStateAnimator {
|
|||||||
// hidden while the screen is turning off.
|
// hidden while the screen is turning off.
|
||||||
// TODO(b/63773439): These cases should be eliminated, though we probably still
|
// TODO(b/63773439): These cases should be eliminated, though we probably still
|
||||||
// want to process mTurnOnScreen in this way for clarity.
|
// want to process mTurnOnScreen in this way for clarity.
|
||||||
if (mWin.mTurnOnScreen && mWin.mAppToken.canTurnScreenOn()) {
|
if (mWin.mTurnOnScreen &&
|
||||||
|
(mWin.mAppToken == null || mWin.mAppToken.canTurnScreenOn())) {
|
||||||
if (DEBUG_VISIBILITY) Slog.v(TAG, "Show surface turning screen on: " + mWin);
|
if (DEBUG_VISIBILITY) Slog.v(TAG, "Show surface turning screen on: " + mWin);
|
||||||
mWin.mTurnOnScreen = false;
|
mWin.mTurnOnScreen = false;
|
||||||
|
|
||||||
// The window should only turn the screen on once per resume, but
|
// The window should only turn the screen on once per resume, but
|
||||||
// prepareSurfaceLocked can be called multiple times. Set canTurnScreenOn to
|
// prepareSurfaceLocked can be called multiple times. Set canTurnScreenOn to
|
||||||
// false so the window doesn't turn the screen on again during this resume.
|
// false so the window doesn't turn the screen on again during this resume.
|
||||||
mWin.mAppToken.setCanTurnScreenOn(false);
|
if (mWin.mAppToken != null) {
|
||||||
|
mWin.mAppToken.setCanTurnScreenOn(false);
|
||||||
|
}
|
||||||
mAnimator.mBulkUpdateParams |= SET_TURN_ON_SCREEN;
|
mAnimator.mBulkUpdateParams |= SET_TURN_ON_SCREEN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user