Loading core/java/android/app/wallpaper.aconfig +0 −7 Original line number Diff line number Diff line package: "android.app" container: "system" flag { name: "remove_next_wallpaper_component" namespace: "systemui" description: "Remove deprecated field WallpaperData#nextWallpaperComponent. Only effective after rebooting." bug: "365991991" } flag { name: "fix_wallpaper_changed" namespace: "systemui" Loading services/core/java/com/android/server/wallpaper/WallpaperData.java +0 −8 Original line number Diff line number Diff line Loading @@ -93,14 +93,6 @@ class WallpaperData { */ private ComponentName mWallpaperComponent; // TODO(b/347235611) Remove this field /** * The component name of the wallpaper that should be set next. * * @deprecated */ ComponentName nextWallpaperComponent; /** * The ID of this wallpaper */ Loading services/core/java/com/android/server/wallpaper/WallpaperDataParser.java +2 −12 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.server.wallpaper; import static android.app.Flags.liveWallpaperContentHandling; import static android.app.Flags.removeNextWallpaperComponent; import static android.app.WallpaperManager.FLAG_LOCK; import static android.app.WallpaperManager.FLAG_SYSTEM; import static android.app.WallpaperManager.ORIENTATION_UNKNOWN; Loading Loading @@ -246,11 +245,7 @@ public class WallpaperDataParser { ComponentName comp = parseComponentName(parser); if (!liveWallpaperContentHandling()) { if (removeNextWallpaperComponent()) { wallpaperToParse.setComponent(comp); } else { wallpaperToParse.nextWallpaperComponent = comp; } } if (multiCrop()) { parseWallpaperAttributes(parser, wallpaperToParse, keepDimensionHints); Loading @@ -262,12 +257,7 @@ public class WallpaperDataParser { Slog.v(TAG, "cropRect:" + wallpaper.cropHint); Slog.v(TAG, "primaryColors:" + wallpaper.primaryColors); Slog.v(TAG, "mName:" + wallpaper.name); if (removeNextWallpaperComponent()) { Slog.v(TAG, "mWallpaperComponent:" + wallpaper.getComponent()); } else { Slog.v(TAG, "mNextWallpaperComponent:" + wallpaper.nextWallpaperComponent); } } } } Loading services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +4 −48 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ 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.removeNextWallpaperComponent; import static android.app.Flags.updateRecentsFromSystem; import static android.app.WallpaperManager.COMMAND_REAPPLY; import static android.app.WallpaperManager.FLAG_LOCK; Loading Loading @@ -82,7 +81,6 @@ import android.content.IntentFilter; import android.content.ServiceConnection; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManagerInternal; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; Loading Loading @@ -1630,16 +1628,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } } } if (!removeNextWallpaperComponent()) { if (wallpaper.nextWallpaperComponent != null) { int change = isPackageDisappearing(wallpaper.nextWallpaperComponent .getPackageName()); if (change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE) { wallpaper.nextWallpaperComponent = null; } } } if (wallpaper.getComponent() != null && isPackageModified(wallpaper.getComponent().getPackageName())) { ServiceInfo serviceInfo = null; Loading @@ -1656,19 +1644,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub clearWallpaperLocked(wallpaper.mWhich, wallpaper.userId, false, null); } } if (!removeNextWallpaperComponent()) { if (wallpaper.nextWallpaperComponent != null && isPackageModified(wallpaper.nextWallpaperComponent.getPackageName())) { try { mContext.getPackageManager().getServiceInfo( wallpaper.nextWallpaperComponent, PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE); } catch (NameNotFoundException e) { wallpaper.nextWallpaperComponent = null; } } } return changed; } } Loading Loading @@ -1823,13 +1798,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub WallpaperData wallpaper = mWallpaperMap.get(UserHandle.USER_SYSTEM); // If we think we're going to be using the system image wallpaper imagery, make // sure we have something to render boolean isImageComponent; if (removeNextWallpaperComponent()) { isImageComponent = wallpaper.getComponent() == null boolean isImageComponent = wallpaper.getComponent() == null || mImageWallpaper.equals(wallpaper.getComponent()); } else { isImageComponent = mImageWallpaper.equals(wallpaper.nextWallpaperComponent); } if (isImageComponent) { // No crop file? Make sure we've finished the processing sequence if necessary if (!wallpaper.cropExists()) { Loading Loading @@ -2102,13 +2072,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub return; } final ComponentName cname; if (removeNextWallpaperComponent()) { cname = wallpaper.getComponent(); } else { cname = (wallpaper.getComponent() != null) ? wallpaper.getComponent() : wallpaper.nextWallpaperComponent; } final ComponentName cname = wallpaper.getComponent(); if (!bindWallpaperComponentLocked(cname, true, false, wallpaper, reply)) { // We failed to bind the desired wallpaper, but that might // happen if the wallpaper isn't direct-boot aware Loading @@ -2135,12 +2099,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub return; } Slog.w(TAG, "Wallpaper isn't direct boot aware; using fallback until unlocked"); if (!removeNextWallpaperComponent()) { // We might end up persisting the current wallpaper data // while locked, so pretend like the component was actually // bound into place wallpaper.setComponent(wallpaper.nextWallpaperComponent); } final WallpaperData fallback = new WallpaperData(wallpaper.userId, wallpaper.mWhich); // files from the previous static wallpaper may still be stored in memory. Loading Loading @@ -4413,9 +4371,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub wallpaper = mWallpaperMap.get(UserHandle.USER_SYSTEM); wallpaper.wallpaperId = makeWallpaperIdLocked(); // always bump id at restore wallpaper.allowBackup = true; // by definition if it was restored ComponentName componentName = removeNextWallpaperComponent() ? wallpaper.getComponent() : wallpaper.nextWallpaperComponent; ComponentName componentName = wallpaper.getComponent(); if (liveWallpaperContentHandling()) { // Per b/373875373 this method should be removed, so we just set wallpapers to Loading services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java +2 −32 Original line number Diff line number Diff line Loading @@ -507,8 +507,7 @@ public class WallpaperManagerServiceTests { } @Test @EnableFlags({Flags.FLAG_REMOVE_NEXT_WALLPAPER_COMPONENT, Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING}) @EnableFlags(Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING) public void testSaveLoadSettings_withoutWallpaperDescription() throws IOException, XmlPullParserException { WallpaperData expectedData = mService.getCurrentWallpaperData(FLAG_SYSTEM, 0); Loading Loading @@ -548,8 +547,7 @@ public class WallpaperManagerServiceTests { } @Test @EnableFlags({Flags.FLAG_REMOVE_NEXT_WALLPAPER_COMPONENT, Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING}) @EnableFlags(Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING) public void testSaveLoadSettings_withWallpaperDescription() throws IOException, XmlPullParserException { WallpaperData expectedData = mService.getCurrentWallpaperData(FLAG_SYSTEM, 0); Loading Loading @@ -580,34 +578,6 @@ public class WallpaperManagerServiceTests { assertThat(actualData.getDescription()).isEqualTo(expectedData.getDescription()); } @Test @DisableFlags({Flags.FLAG_REMOVE_NEXT_WALLPAPER_COMPONENT, Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING}) public void testSaveLoadSettings_legacyNextComponent() throws IOException, XmlPullParserException { WallpaperData systemWallpaperData = mService.getCurrentWallpaperData(FLAG_SYSTEM, 0); systemWallpaperData.setComponent(sDefaultWallpaperComponent); ByteArrayOutputStream ostream = new ByteArrayOutputStream(); TypedXmlSerializer serializer = Xml.newBinarySerializer(); serializer.setOutput(ostream, StandardCharsets.UTF_8.name()); mService.mWallpaperDataParser.saveSettingsToSerializer(serializer, systemWallpaperData, null); ostream.close(); WallpaperData shouldMatchSystem = new WallpaperData(0, FLAG_SYSTEM); ByteArrayInputStream istream = new ByteArrayInputStream(ostream.toByteArray()); TypedXmlPullParser parser = Xml.newBinaryPullParser(); parser.setInput(istream, StandardCharsets.UTF_8.name()); mService.mWallpaperDataParser.loadSettingsFromSerializer(parser, shouldMatchSystem, /* userId= */0, /* loadSystem= */ true, /* loadLock= */ false, /* keepDimensionHints= */ true, new WallpaperDisplayHelper.DisplayData(0)); assertThat(shouldMatchSystem.nextWallpaperComponent).isEqualTo( systemWallpaperData.getComponent()); assertThat(shouldMatchSystem.primaryColors).isEqualTo(systemWallpaperData.primaryColors); } @Test @Ignore("b/372942682") public void testWallpaperManagerCallbackInRightOrder() throws RemoteException { Loading Loading
core/java/android/app/wallpaper.aconfig +0 −7 Original line number Diff line number Diff line package: "android.app" container: "system" flag { name: "remove_next_wallpaper_component" namespace: "systemui" description: "Remove deprecated field WallpaperData#nextWallpaperComponent. Only effective after rebooting." bug: "365991991" } flag { name: "fix_wallpaper_changed" namespace: "systemui" Loading
services/core/java/com/android/server/wallpaper/WallpaperData.java +0 −8 Original line number Diff line number Diff line Loading @@ -93,14 +93,6 @@ class WallpaperData { */ private ComponentName mWallpaperComponent; // TODO(b/347235611) Remove this field /** * The component name of the wallpaper that should be set next. * * @deprecated */ ComponentName nextWallpaperComponent; /** * The ID of this wallpaper */ Loading
services/core/java/com/android/server/wallpaper/WallpaperDataParser.java +2 −12 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.server.wallpaper; import static android.app.Flags.liveWallpaperContentHandling; import static android.app.Flags.removeNextWallpaperComponent; import static android.app.WallpaperManager.FLAG_LOCK; import static android.app.WallpaperManager.FLAG_SYSTEM; import static android.app.WallpaperManager.ORIENTATION_UNKNOWN; Loading Loading @@ -246,11 +245,7 @@ public class WallpaperDataParser { ComponentName comp = parseComponentName(parser); if (!liveWallpaperContentHandling()) { if (removeNextWallpaperComponent()) { wallpaperToParse.setComponent(comp); } else { wallpaperToParse.nextWallpaperComponent = comp; } } if (multiCrop()) { parseWallpaperAttributes(parser, wallpaperToParse, keepDimensionHints); Loading @@ -262,12 +257,7 @@ public class WallpaperDataParser { Slog.v(TAG, "cropRect:" + wallpaper.cropHint); Slog.v(TAG, "primaryColors:" + wallpaper.primaryColors); Slog.v(TAG, "mName:" + wallpaper.name); if (removeNextWallpaperComponent()) { Slog.v(TAG, "mWallpaperComponent:" + wallpaper.getComponent()); } else { Slog.v(TAG, "mNextWallpaperComponent:" + wallpaper.nextWallpaperComponent); } } } } Loading
services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +4 −48 Original line number Diff line number Diff line Loading @@ -24,7 +24,6 @@ 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.removeNextWallpaperComponent; import static android.app.Flags.updateRecentsFromSystem; import static android.app.WallpaperManager.COMMAND_REAPPLY; import static android.app.WallpaperManager.FLAG_LOCK; Loading Loading @@ -82,7 +81,6 @@ import android.content.IntentFilter; import android.content.ServiceConnection; import android.content.pm.IPackageManager; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManagerInternal; import android.content.pm.ResolveInfo; import android.content.pm.ServiceInfo; Loading Loading @@ -1630,16 +1628,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub } } } if (!removeNextWallpaperComponent()) { if (wallpaper.nextWallpaperComponent != null) { int change = isPackageDisappearing(wallpaper.nextWallpaperComponent .getPackageName()); if (change == PACKAGE_PERMANENT_CHANGE || change == PACKAGE_TEMPORARY_CHANGE) { wallpaper.nextWallpaperComponent = null; } } } if (wallpaper.getComponent() != null && isPackageModified(wallpaper.getComponent().getPackageName())) { ServiceInfo serviceInfo = null; Loading @@ -1656,19 +1644,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub clearWallpaperLocked(wallpaper.mWhich, wallpaper.userId, false, null); } } if (!removeNextWallpaperComponent()) { if (wallpaper.nextWallpaperComponent != null && isPackageModified(wallpaper.nextWallpaperComponent.getPackageName())) { try { mContext.getPackageManager().getServiceInfo( wallpaper.nextWallpaperComponent, PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE); } catch (NameNotFoundException e) { wallpaper.nextWallpaperComponent = null; } } } return changed; } } Loading Loading @@ -1823,13 +1798,8 @@ public class WallpaperManagerService extends IWallpaperManager.Stub WallpaperData wallpaper = mWallpaperMap.get(UserHandle.USER_SYSTEM); // If we think we're going to be using the system image wallpaper imagery, make // sure we have something to render boolean isImageComponent; if (removeNextWallpaperComponent()) { isImageComponent = wallpaper.getComponent() == null boolean isImageComponent = wallpaper.getComponent() == null || mImageWallpaper.equals(wallpaper.getComponent()); } else { isImageComponent = mImageWallpaper.equals(wallpaper.nextWallpaperComponent); } if (isImageComponent) { // No crop file? Make sure we've finished the processing sequence if necessary if (!wallpaper.cropExists()) { Loading Loading @@ -2102,13 +2072,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub return; } final ComponentName cname; if (removeNextWallpaperComponent()) { cname = wallpaper.getComponent(); } else { cname = (wallpaper.getComponent() != null) ? wallpaper.getComponent() : wallpaper.nextWallpaperComponent; } final ComponentName cname = wallpaper.getComponent(); if (!bindWallpaperComponentLocked(cname, true, false, wallpaper, reply)) { // We failed to bind the desired wallpaper, but that might // happen if the wallpaper isn't direct-boot aware Loading @@ -2135,12 +2099,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub return; } Slog.w(TAG, "Wallpaper isn't direct boot aware; using fallback until unlocked"); if (!removeNextWallpaperComponent()) { // We might end up persisting the current wallpaper data // while locked, so pretend like the component was actually // bound into place wallpaper.setComponent(wallpaper.nextWallpaperComponent); } final WallpaperData fallback = new WallpaperData(wallpaper.userId, wallpaper.mWhich); // files from the previous static wallpaper may still be stored in memory. Loading Loading @@ -4413,9 +4371,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub wallpaper = mWallpaperMap.get(UserHandle.USER_SYSTEM); wallpaper.wallpaperId = makeWallpaperIdLocked(); // always bump id at restore wallpaper.allowBackup = true; // by definition if it was restored ComponentName componentName = removeNextWallpaperComponent() ? wallpaper.getComponent() : wallpaper.nextWallpaperComponent; ComponentName componentName = wallpaper.getComponent(); if (liveWallpaperContentHandling()) { // Per b/373875373 this method should be removed, so we just set wallpapers to Loading
services/tests/mockingservicestests/src/com/android/server/wallpaper/WallpaperManagerServiceTests.java +2 −32 Original line number Diff line number Diff line Loading @@ -507,8 +507,7 @@ public class WallpaperManagerServiceTests { } @Test @EnableFlags({Flags.FLAG_REMOVE_NEXT_WALLPAPER_COMPONENT, Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING}) @EnableFlags(Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING) public void testSaveLoadSettings_withoutWallpaperDescription() throws IOException, XmlPullParserException { WallpaperData expectedData = mService.getCurrentWallpaperData(FLAG_SYSTEM, 0); Loading Loading @@ -548,8 +547,7 @@ public class WallpaperManagerServiceTests { } @Test @EnableFlags({Flags.FLAG_REMOVE_NEXT_WALLPAPER_COMPONENT, Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING}) @EnableFlags(Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING) public void testSaveLoadSettings_withWallpaperDescription() throws IOException, XmlPullParserException { WallpaperData expectedData = mService.getCurrentWallpaperData(FLAG_SYSTEM, 0); Loading Loading @@ -580,34 +578,6 @@ public class WallpaperManagerServiceTests { assertThat(actualData.getDescription()).isEqualTo(expectedData.getDescription()); } @Test @DisableFlags({Flags.FLAG_REMOVE_NEXT_WALLPAPER_COMPONENT, Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING}) public void testSaveLoadSettings_legacyNextComponent() throws IOException, XmlPullParserException { WallpaperData systemWallpaperData = mService.getCurrentWallpaperData(FLAG_SYSTEM, 0); systemWallpaperData.setComponent(sDefaultWallpaperComponent); ByteArrayOutputStream ostream = new ByteArrayOutputStream(); TypedXmlSerializer serializer = Xml.newBinarySerializer(); serializer.setOutput(ostream, StandardCharsets.UTF_8.name()); mService.mWallpaperDataParser.saveSettingsToSerializer(serializer, systemWallpaperData, null); ostream.close(); WallpaperData shouldMatchSystem = new WallpaperData(0, FLAG_SYSTEM); ByteArrayInputStream istream = new ByteArrayInputStream(ostream.toByteArray()); TypedXmlPullParser parser = Xml.newBinaryPullParser(); parser.setInput(istream, StandardCharsets.UTF_8.name()); mService.mWallpaperDataParser.loadSettingsFromSerializer(parser, shouldMatchSystem, /* userId= */0, /* loadSystem= */ true, /* loadLock= */ false, /* keepDimensionHints= */ true, new WallpaperDisplayHelper.DisplayData(0)); assertThat(shouldMatchSystem.nextWallpaperComponent).isEqualTo( systemWallpaperData.getComponent()); assertThat(shouldMatchSystem.primaryColors).isEqualTo(systemWallpaperData.primaryColors); } @Test @Ignore("b/372942682") public void testWallpaperManagerCallbackInRightOrder() throws RemoteException { Loading