Fix exception caused by system app setting wallpaper
It will cause NullPointerException if the system app set the wallpaper before the third-party app set the wallpaper. Change-Id: I7e68cf3f89b690c7b114fa087d1fd1203d8eb4d6
This commit is contained in:
@@ -2713,6 +2713,13 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
|
||||
checkPermission(android.Manifest.permission.SET_WALLPAPER_DIM_AMOUNT);
|
||||
synchronized (mLock) {
|
||||
WallpaperData data = mWallpaperMap.get(mCurrentUserId);
|
||||
if (data == null) {
|
||||
data = mWallpaperMap.get(UserHandle.USER_SYSTEM);
|
||||
if (data == null) {
|
||||
Slog.e(TAG, "getWallpaperDimAmount: wallpaperData is null");
|
||||
return 0.0f;
|
||||
}
|
||||
}
|
||||
return data.mWallpaperDimAmount;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user