Prevent crash if detachWallpaperLocked is called multiple times

Test: no, minor change
Bug: 242851438
Change-Id: I22b6e60ff4047fcb78624acbb1e30d84bca7df3d
This commit is contained in:
Marzia Favaro
2023-02-28 14:31:09 +00:00
parent a2abc8fb12
commit 6e312b9b71

View File

@@ -945,7 +945,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
mWindowManagerInternal.removeWindowToken(mToken, false/* removeWindows */,
mDisplayId);
try {
connection.mService.detach(mToken);
if (connection.mService != null) {
connection.mService.detach(mToken);
}
} catch (RemoteException e) {
Slog.w(TAG, "connection.mService.destroy() threw a RemoteException");
}