Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 403fec9e authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clean up flag android.app.fix_wallpaper_changed" into main

parents 9a488346 c2f04577
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
package: "android.app"
container: "system"

flag {
  name: "fix_wallpaper_changed"
  namespace: "systemui"
  description: "Fixes timing of wallpaper changed notification and adds extra information. Only effective after rebooting."
  bug: "369814294"
}

flag {
  name: "live_wallpaper_content_handling"
  namespace: "systemui"
+5 −23
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static android.Manifest.permission.MANAGE_EXTERNAL_STORAGE;
import static android.Manifest.permission.READ_WALLPAPER_INTERNAL;
import static android.app.ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND;
import static android.app.Flags.fixGetBitmapCrops;
import static android.app.Flags.fixWallpaperChanged;
import static android.app.Flags.liveWallpaperContentHandling;
import static android.app.Flags.notifyKeyguardEvents;
import static android.app.Flags.updateRecentsFromSystem;
@@ -367,10 +366,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                                Slog.d(TAG, "publish system wallpaper changed!");
                            }
                            notifyWallpaperComplete(wallpaper);
                            if (fixWallpaperChanged()) {
                            notifyWallpaperChanged(wallpaper);
                        }
                        }
                    };

                    // If this was the system wallpaper, rebind...
@@ -396,10 +393,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                                Slog.d(TAG, "publish lock wallpaper changed!");
                            }
                            notifyWallpaperComplete(wallpaper);
                            if (fixWallpaperChanged()) {
                            notifyWallpaperChanged(wallpaper);
                        }
                        }
                    };

                    wallpaper.mBindSource = BindSource.SET_STATIC;
@@ -1947,20 +1942,16 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                    switchWallpaper(systemWallpaper, null);
                    // TODO(b/278261563): call notifyCallbacksLocked inside switchWallpaper
                    notifyCallbacksLocked(systemWallpaper);
                    if (fixWallpaperChanged()) {
                    notifyWallpaperChanged(systemWallpaper);
                }
                }
                if (mLockWallpaperWaitingForUnlock) {
                    final WallpaperData lockWallpaper =
                            getWallpaperSafeLocked(userId, FLAG_LOCK);
                    lockWallpaper.mBindSource = BindSource.SWITCH_WALLPAPER_UNLOCK_USER;
                    switchWallpaper(lockWallpaper, null);
                    notifyCallbacksLocked(lockWallpaper);
                    if (fixWallpaperChanged()) {
                    notifyWallpaperChanged(lockWallpaper);
                }
                }

                // Make sure that the SELinux labeling of all the relevant files is correct.
                // This corrects for mislabeling bugs that might have arisen from move-to
@@ -3601,9 +3592,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
                    }
                    newWallpaper.wallpaperId = makeWallpaperIdLocked();
                    notifyCallbacksLocked(newWallpaper);
                    if (fixWallpaperChanged()) {
                    notifyWallpaperChanged(newWallpaper);
                    }
                    shouldNotifyColors = true;
                    if (offloadColorExtraction()) {
                        shouldNotifyColors = false;
@@ -4026,13 +4015,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
            }
        }
        wallpaper.callbacks.finishBroadcast();

        if (!fixWallpaperChanged()) {
            final Intent intent = new Intent(Intent.ACTION_WALLPAPER_CHANGED);
            intent.putExtra(WallpaperManager.EXTRA_FROM_FOREGROUND_APP,
                    wallpaper.fromForegroundApp);
            mContext.sendBroadcastAsUser(intent, new UserHandle(mCurrentUserId));
        }
    }

    private void notifyWallpaperChanged(WallpaperData wallpaper) {