diff options
| author | 2024-09-09 15:50:00 +0000 | |
|---|---|---|
| committer | 2024-09-09 15:50:00 +0000 | |
| commit | 5885c0fdd43d8c21130c7f413d3b3ca13ffb0f50 (patch) | |
| tree | 715bcd656d9591d8d194c709122f52e4b35bc774 | |
| parent | ccd1feda63d69ebb8d9c80a196d30c343a7c1626 (diff) | |
| parent | 87ca2ade920b568c04b38605bcc01e53ced5778b (diff) | |
Merge "Clarify semantics of changingToSame function" into main
| -rw-r--r-- | services/core/java/com/android/server/wallpaper/WallpaperManagerService.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java index f53dda6ee35b..4dcc6e112ecc 100644 --- a/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +++ b/services/core/java/com/android/server/wallpaper/WallpaperManagerService.java @@ -3169,7 +3169,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub final WallpaperDestinationChangeHandler liveSync = new WallpaperDestinationChangeHandler( newWallpaper); - boolean same = changingToSame(name, newWallpaper); + boolean same = changingToSame(name, newWallpaper.connection, + newWallpaper.wallpaperComponent); /* * If we have a shared system+lock wallpaper, and we reapply the same wallpaper @@ -3257,14 +3258,15 @@ public class WallpaperManagerService extends IWallpaperManager.Stub return name == null || name.equals(mDefaultWallpaperComponent); } - private boolean changingToSame(ComponentName componentName, WallpaperData wallpaper) { - if (wallpaper.connection != null) { - final ComponentName wallpaperName = wallpaper.wallpaperComponent; - if (isDefaultComponent(componentName) && isDefaultComponent(wallpaperName)) { + private boolean changingToSame(ComponentName newComponentName, + WallpaperConnection currentConnection, ComponentName currentComponentName) { + if (currentConnection != null) { + if (isDefaultComponent(newComponentName) && isDefaultComponent(currentComponentName)) { if (DEBUG) Slog.v(TAG, "changingToSame: still using default"); // Still using default wallpaper. return true; - } else if (wallpaperName != null && wallpaperName.equals(componentName)) { + } else if (currentComponentName != null && currentComponentName.equals( + newComponentName)) { // Changing to same wallpaper. if (DEBUG) Slog.v(TAG, "same wallpaper"); return true; @@ -3279,7 +3281,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub Slog.v(TAG, "bindWallpaperComponentLocked: componentName=" + componentName); } // Has the component changed? - if (!force && changingToSame(componentName, wallpaper)) { + if (!force && changingToSame(componentName, wallpaper.connection, + wallpaper.wallpaperComponent)) { try { if (DEBUG_LIVE) { Slog.v(TAG, "Changing to the same component, ignoring"); |