Loading core/java/android/app/IWallpaperManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ interface IWallpaperManager { */ ParcelFileDescriptor setWallpaper(String name, in String callingPackage, in Rect cropHint, boolean allowBackup, out Bundle extras, int which, IWallpaperManagerCallback completion); IWallpaperManagerCallback completion, int userId); /** * Set the live wallpaper. This only affects the system wallpaper. Loading core/java/android/app/WallpaperManager.java +18 −3 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; Loading Loading @@ -939,7 +940,8 @@ public class WallpaperManager { /* Set the wallpaper to the default values */ ParcelFileDescriptor fd = sGlobals.mService.setWallpaper( "res:" + resources.getResourceName(resid), mContext.getOpPackageName(), null, false, result, which, completion); mContext.getOpPackageName(), null, false, result, which, completion, UserHandle.myUserId()); if (fd != null) { FileOutputStream fos = null; boolean ok = false; Loading Loading @@ -1040,6 +1042,19 @@ public class WallpaperManager { public int setBitmap(Bitmap fullImage, Rect visibleCropHint, boolean allowBackup, @SetWallpaperFlags int which) throws IOException { return setBitmap(fullImage, visibleCropHint, allowBackup, which, UserHandle.myUserId()); } /** * Like {@link #setBitmap(Bitmap, Rect, boolean, int)}, but allows to pass in an explicit user * id. If the user id doesn't match the user id the process is running under, calling this * requires permission {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL}. * @hide */ public int setBitmap(Bitmap fullImage, Rect visibleCropHint, boolean allowBackup, @SetWallpaperFlags int which, int userId) throws IOException { validateRect(visibleCropHint); if (sGlobals.mService == null) { Log.w(TAG, "WallpaperService not running"); Loading @@ -1050,7 +1065,7 @@ public class WallpaperManager { try { ParcelFileDescriptor fd = sGlobals.mService.setWallpaper(null, mContext.getOpPackageName(), visibleCropHint, allowBackup, result, which, completion); result, which, completion, userId); if (fd != null) { FileOutputStream fos = null; try { Loading Loading @@ -1176,7 +1191,7 @@ public class WallpaperManager { try { ParcelFileDescriptor fd = sGlobals.mService.setWallpaper(null, mContext.getOpPackageName(), visibleCropHint, allowBackup, result, which, completion); result, which, completion, UserHandle.myUserId()); if (fd != null) { FileOutputStream fos = null; try { Loading services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -1350,7 +1350,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { @Override public ParcelFileDescriptor setWallpaper(String name, String callingPackage, Rect cropHint, boolean allowBackup, Bundle extras, int which, IWallpaperManagerCallback completion) { IWallpaperManagerCallback completion, int userId) { userId = ActivityManager.handleIncomingUser(getCallingPid(), getCallingUid(), userId, false /* all */, true /* full */, "changing wallpaper", null /* pkg */); checkPermission(android.Manifest.permission.SET_WALLPAPER); if ((which & (FLAG_LOCK|FLAG_SYSTEM)) == 0) { Loading @@ -1374,8 +1376,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { } } final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { if (DEBUG) Slog.v(TAG, "setWallpaper which=0x" + Integer.toHexString(which)); WallpaperData wallpaper; Loading Loading
core/java/android/app/IWallpaperManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ interface IWallpaperManager { */ ParcelFileDescriptor setWallpaper(String name, in String callingPackage, in Rect cropHint, boolean allowBackup, out Bundle extras, int which, IWallpaperManagerCallback completion); IWallpaperManagerCallback completion, int userId); /** * Set the live wallpaper. This only affects the system wallpaper. Loading
core/java/android/app/WallpaperManager.java +18 −3 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.ParcelFileDescriptor; import android.os.Process; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemProperties; Loading Loading @@ -939,7 +940,8 @@ public class WallpaperManager { /* Set the wallpaper to the default values */ ParcelFileDescriptor fd = sGlobals.mService.setWallpaper( "res:" + resources.getResourceName(resid), mContext.getOpPackageName(), null, false, result, which, completion); mContext.getOpPackageName(), null, false, result, which, completion, UserHandle.myUserId()); if (fd != null) { FileOutputStream fos = null; boolean ok = false; Loading Loading @@ -1040,6 +1042,19 @@ public class WallpaperManager { public int setBitmap(Bitmap fullImage, Rect visibleCropHint, boolean allowBackup, @SetWallpaperFlags int which) throws IOException { return setBitmap(fullImage, visibleCropHint, allowBackup, which, UserHandle.myUserId()); } /** * Like {@link #setBitmap(Bitmap, Rect, boolean, int)}, but allows to pass in an explicit user * id. If the user id doesn't match the user id the process is running under, calling this * requires permission {@link android.Manifest.permission#INTERACT_ACROSS_USERS_FULL}. * @hide */ public int setBitmap(Bitmap fullImage, Rect visibleCropHint, boolean allowBackup, @SetWallpaperFlags int which, int userId) throws IOException { validateRect(visibleCropHint); if (sGlobals.mService == null) { Log.w(TAG, "WallpaperService not running"); Loading @@ -1050,7 +1065,7 @@ public class WallpaperManager { try { ParcelFileDescriptor fd = sGlobals.mService.setWallpaper(null, mContext.getOpPackageName(), visibleCropHint, allowBackup, result, which, completion); result, which, completion, userId); if (fd != null) { FileOutputStream fos = null; try { Loading Loading @@ -1176,7 +1191,7 @@ public class WallpaperManager { try { ParcelFileDescriptor fd = sGlobals.mService.setWallpaper(null, mContext.getOpPackageName(), visibleCropHint, allowBackup, result, which, completion); result, which, completion, UserHandle.myUserId()); if (fd != null) { FileOutputStream fos = null; try { Loading
services/core/java/com/android/server/wallpaper/WallpaperManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -1350,7 +1350,9 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { @Override public ParcelFileDescriptor setWallpaper(String name, String callingPackage, Rect cropHint, boolean allowBackup, Bundle extras, int which, IWallpaperManagerCallback completion) { IWallpaperManagerCallback completion, int userId) { userId = ActivityManager.handleIncomingUser(getCallingPid(), getCallingUid(), userId, false /* all */, true /* full */, "changing wallpaper", null /* pkg */); checkPermission(android.Manifest.permission.SET_WALLPAPER); if ((which & (FLAG_LOCK|FLAG_SYSTEM)) == 0) { Loading @@ -1374,8 +1376,6 @@ public class WallpaperManagerService extends IWallpaperManager.Stub { } } final int userId = UserHandle.getCallingUserId(); synchronized (mLock) { if (DEBUG) Slog.v(TAG, "setWallpaper which=0x" + Integer.toHexString(which)); WallpaperData wallpaper; Loading