Use committed display state in WallpaperService
Uses committed display state instead of display state, so the wallpaper receive more up-to-date information about visibility as display power state could take a considerable amount of time. Test: manual, perfetto traces Bug: 273204503 Change-Id: If747112d610822df116971b60b9a0b82a686a37a
This commit is contained in:
@@ -1458,7 +1458,7 @@ public abstract class WallpaperService extends Service {
|
|||||||
com.android.internal.R.dimen.config_wallpaperDimAmount);
|
com.android.internal.R.dimen.config_wallpaperDimAmount);
|
||||||
mWallpaperDimAmount = mDefaultDimAmount;
|
mWallpaperDimAmount = mDefaultDimAmount;
|
||||||
mPreviousWallpaperDimAmount = mWallpaperDimAmount;
|
mPreviousWallpaperDimAmount = mWallpaperDimAmount;
|
||||||
mDisplayState = mDisplay.getState();
|
mDisplayState = mDisplay.getCommittedState();
|
||||||
|
|
||||||
if (DEBUG) Log.v(TAG, "onCreate(): " + this);
|
if (DEBUG) Log.v(TAG, "onCreate(): " + this);
|
||||||
Trace.beginSection("WPMS.Engine.onCreate");
|
Trace.beginSection("WPMS.Engine.onCreate");
|
||||||
@@ -1548,7 +1548,8 @@ public abstract class WallpaperService extends Service {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!mDestroyed) {
|
if (!mDestroyed) {
|
||||||
mDisplayState = mDisplay == null ? Display.STATE_UNKNOWN : mDisplay.getState();
|
mDisplayState = mDisplay == null ? Display.STATE_UNKNOWN :
|
||||||
|
mDisplay.getCommittedState();
|
||||||
boolean visible = mVisible && mDisplayState != Display.STATE_OFF;
|
boolean visible = mVisible && mDisplayState != Display.STATE_OFF;
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.v(
|
Log.v(
|
||||||
|
|||||||
Reference in New Issue
Block a user