Loading core/java/android/service/wallpaper/WallpaperService.java +6 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static android.view.View.SYSTEM_UI_FLAG_VISIBLE; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static com.android.window.flags.Flags.FLAG_OFFLOAD_COLOR_EXTRACTION; import static com.android.window.flags.Flags.noDuplicateSurfaceDestroyedEvents; import static com.android.window.flags.Flags.noConsecutiveVisibilityEvents; import static com.android.window.flags.Flags.noVisibilityEventOnDisplayStateChange; import static com.android.window.flags.Flags.offloadColorExtraction; Loading Loading @@ -255,6 +256,7 @@ public abstract class WallpaperService extends Service { */ private boolean mIsScreenTurningOn; boolean mReportedVisible; boolean mReportedSurfaceCreated; boolean mDestroyed; // Set to true after receiving WallpaperManager#COMMAND_FREEZE. It's reset back to false // after receiving WallpaperManager#COMMAND_UNFREEZE. COMMAND_FREEZE is fully applied once Loading Loading @@ -1381,6 +1383,7 @@ public abstract class WallpaperService extends Service { if (surfaceCreating) { mIsCreating = true; didSurface = true; mReportedSurfaceCreated = true; if (DEBUG) Log.v(TAG, "onSurfaceCreated(" + mSurfaceHolder + "): " + this); Trace.beginSection("WPMS.Engine.onSurfaceCreated"); Loading Loading @@ -2264,8 +2267,10 @@ public abstract class WallpaperService extends Service { } void reportSurfaceDestroyed() { if (mSurfaceCreated) { if ((!noDuplicateSurfaceDestroyedEvents() && mSurfaceCreated) || (noDuplicateSurfaceDestroyedEvents() && mReportedSurfaceCreated)) { mSurfaceCreated = false; mReportedSurfaceCreated = false; mSurfaceHolder.ungetCallbacks(); SurfaceHolder.Callback callbacks[] = mSurfaceHolder.getCallbacks(); if (callbacks != null) { Loading core/java/android/window/flags/wallpaper_manager.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -39,3 +39,13 @@ flag { description: "Prevent the system from sending visibility event on display state change." bug: "331725519" } flag { name: "no_duplicate_surface_destroyed_events" namespace: "systemui" description: "Prevent the system from sending onSurfaceDestroyed() twice." bug: "344461715" metadata { purpose: PURPOSE_BUGFIX } } Loading
core/java/android/service/wallpaper/WallpaperService.java +6 −1 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import static android.view.View.SYSTEM_UI_FLAG_VISIBLE; import static android.view.WindowManager.LayoutParams.TYPE_WALLPAPER; import static com.android.window.flags.Flags.FLAG_OFFLOAD_COLOR_EXTRACTION; import static com.android.window.flags.Flags.noDuplicateSurfaceDestroyedEvents; import static com.android.window.flags.Flags.noConsecutiveVisibilityEvents; import static com.android.window.flags.Flags.noVisibilityEventOnDisplayStateChange; import static com.android.window.flags.Flags.offloadColorExtraction; Loading Loading @@ -255,6 +256,7 @@ public abstract class WallpaperService extends Service { */ private boolean mIsScreenTurningOn; boolean mReportedVisible; boolean mReportedSurfaceCreated; boolean mDestroyed; // Set to true after receiving WallpaperManager#COMMAND_FREEZE. It's reset back to false // after receiving WallpaperManager#COMMAND_UNFREEZE. COMMAND_FREEZE is fully applied once Loading Loading @@ -1381,6 +1383,7 @@ public abstract class WallpaperService extends Service { if (surfaceCreating) { mIsCreating = true; didSurface = true; mReportedSurfaceCreated = true; if (DEBUG) Log.v(TAG, "onSurfaceCreated(" + mSurfaceHolder + "): " + this); Trace.beginSection("WPMS.Engine.onSurfaceCreated"); Loading Loading @@ -2264,8 +2267,10 @@ public abstract class WallpaperService extends Service { } void reportSurfaceDestroyed() { if (mSurfaceCreated) { if ((!noDuplicateSurfaceDestroyedEvents() && mSurfaceCreated) || (noDuplicateSurfaceDestroyedEvents() && mReportedSurfaceCreated)) { mSurfaceCreated = false; mReportedSurfaceCreated = false; mSurfaceHolder.ungetCallbacks(); SurfaceHolder.Callback callbacks[] = mSurfaceHolder.getCallbacks(); if (callbacks != null) { Loading
core/java/android/window/flags/wallpaper_manager.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -39,3 +39,13 @@ flag { description: "Prevent the system from sending visibility event on display state change." bug: "331725519" } flag { name: "no_duplicate_surface_destroyed_events" namespace: "systemui" description: "Prevent the system from sending onSurfaceDestroyed() twice." bug: "344461715" metadata { purpose: PURPOSE_BUGFIX } }