Merge "Revert "use new clearWallpaperLocked method everywhere"" into udc-qpr-dev am: 41b1f98887

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23874257

Change-Id: I138f8ddf6a7c75e2c730de29f76f65afa1b7dcda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Aurélien Pomini
2023-07-03 15:55:49 +00:00
committed by Automerger Merge Worker

View File

@@ -2038,7 +2038,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
WallpaperData data = null; WallpaperData data = null;
synchronized (mLock) { synchronized (mLock) {
if (mIsLockscreenLiveWallpaperEnabled) { if (mIsLockscreenLiveWallpaperEnabled) {
clearWallpaperLocked(callingPackage, false, which, userId, null); clearWallpaperLocked(callingPackage, false, which, userId);
} else { } else {
clearWallpaperLocked(false, which, userId, null); clearWallpaperLocked(false, which, userId, null);
} }
@@ -2059,7 +2059,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
} }
private void clearWallpaperLocked(String callingPackage, boolean defaultFailed, private void clearWallpaperLocked(String callingPackage, boolean defaultFailed,
int which, int userId, IRemoteCallback reply) { int which, int userId) {
// Might need to bring it in the first time to establish our rewrite // Might need to bring it in the first time to establish our rewrite
if (!mWallpaperMap.contains(userId)) { if (!mWallpaperMap.contains(userId)) {
@@ -2113,15 +2113,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
withCleanCallingIdentity(() -> clearWallpaperComponentLocked(wallpaper)); withCleanCallingIdentity(() -> clearWallpaperComponentLocked(wallpaper));
} }
// TODO(b/266818039) remove this version of the method
private void clearWallpaperLocked(boolean defaultFailed, int which, int userId, private void clearWallpaperLocked(boolean defaultFailed, int which, int userId,
IRemoteCallback reply) { IRemoteCallback reply) {
if (mIsLockscreenLiveWallpaperEnabled) {
String callingPackage = mPackageManagerInternal.getNameForUid(getCallingUid());
clearWallpaperLocked(callingPackage, defaultFailed, which, userId, reply);
return;
}
if (which != FLAG_SYSTEM && which != FLAG_LOCK) { if (which != FLAG_SYSTEM && which != FLAG_LOCK) {
throw new IllegalArgumentException("Must specify exactly one kind of wallpaper to clear"); throw new IllegalArgumentException("Must specify exactly one kind of wallpaper to clear");
} }
@@ -3291,21 +3285,15 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
boolean setWallpaperComponent(ComponentName name, String callingPackage, boolean setWallpaperComponent(ComponentName name, String callingPackage,
@SetWallpaperFlags int which, int userId) { @SetWallpaperFlags int which, int userId) {
if (mIsLockscreenLiveWallpaperEnabled) { if (mIsLockscreenLiveWallpaperEnabled) {
return setWallpaperComponentInternal(name, callingPackage, which, userId, null); return setWallpaperComponentInternal(name, callingPackage, which, userId);
} else { } else {
setWallpaperComponentInternalLegacy(name, callingPackage, which, userId); setWallpaperComponentInternalLegacy(name, callingPackage, which, userId);
return true; return true;
} }
} }
private boolean setWallpaperComponent(ComponentName name, @SetWallpaperFlags int which,
int userId) {
String callingPackage = mPackageManagerInternal.getNameForUid(getCallingUid());
return setWallpaperComponentInternal(name, callingPackage, which, userId, null);
}
private boolean setWallpaperComponentInternal(ComponentName name, String callingPackage, private boolean setWallpaperComponentInternal(ComponentName name, String callingPackage,
@SetWallpaperFlags int which, int userIdIn, IRemoteCallback reply) { @SetWallpaperFlags int which, int userIdIn) {
if (DEBUG) { if (DEBUG) {
Slog.v(TAG, "Setting new live wallpaper: which=" + which + ", component: " + name); Slog.v(TAG, "Setting new live wallpaper: which=" + which + ", component: " + name);
} }
@@ -3354,7 +3342,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
Slog.d(TAG, "publish system wallpaper changed!"); Slog.d(TAG, "publish system wallpaper changed!");
} }
liveSync.complete(); liveSync.complete();
if (reply != null) reply.sendResult(null);
} }
}; };