Merge "Fix wallpaper NPE caused by user switching before IWallpaperService connection"

This commit is contained in:
TreeHugger Robot
2019-04-01 13:53:09 +00:00
committed by Android (Google) Code Review

View File

@@ -2671,7 +2671,10 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
wallpaper.connection.mReply = null;
}
try {
wallpaper.connection.mService.detach();
// It can be null if user switching happens before service connection.
if (wallpaper.connection.mService != null) {
wallpaper.connection.mService.detach();
}
} catch (RemoteException e) {
Slog.w(TAG, "Failed detaching wallpaper service ", e);
}