diff options
Diffstat (limited to 'services/java/com/android/server/WallpaperManagerService.java')
-rw-r--r-- | services/java/com/android/server/WallpaperManagerService.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/services/java/com/android/server/WallpaperManagerService.java b/services/java/com/android/server/WallpaperManagerService.java index c5243a2..afd7d0e 100644 --- a/services/java/com/android/server/WallpaperManagerService.java +++ b/services/java/com/android/server/WallpaperManagerService.java @@ -45,6 +45,7 @@ import android.os.RemoteException; import android.os.FileObserver; import android.os.ParcelFileDescriptor; import android.os.RemoteCallbackList; +import android.os.SELinux; import android.os.ServiceManager; import android.os.SystemClock; import android.os.UserHandle; @@ -422,9 +423,9 @@ class WallpaperManagerService extends IWallpaperManager.Stub { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (Intent.ACTION_USER_SWITCHED.equals(action)) { - switchUser(intent.getIntExtra(Intent.EXTRA_USERID, 0)); + switchUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } else if (Intent.ACTION_USER_REMOVED.equals(action)) { - removeUser(intent.getIntExtra(Intent.EXTRA_USERID, 0)); + removeUser(intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0)); } } }, userFilter); @@ -639,8 +640,12 @@ class WallpaperManagerService extends IWallpaperManager.Stub { FileUtils.S_IRWXU|FileUtils.S_IRWXG|FileUtils.S_IXOTH, -1, -1); } - ParcelFileDescriptor fd = ParcelFileDescriptor.open(new File(dir, WALLPAPER), + File file = new File(dir, WALLPAPER); + ParcelFileDescriptor fd = ParcelFileDescriptor.open(file, MODE_CREATE|MODE_READ_WRITE); + if (!SELinux.restorecon(file)) { + return null; + } wallpaper.name = name; return fd; } catch (FileNotFoundException e) { @@ -763,10 +768,6 @@ class WallpaperManagerService extends IWallpaperManager.Stub { WallpaperConnection newConn = new WallpaperConnection(wi, wallpaper); intent.setComponent(componentName); int serviceUserId = wallpaper.userId; - // Because the image wallpaper is running in the system ui - if (componentName.equals(wallpaper.imageWallpaperComponent)) { - serviceUserId = 0; - } intent.putExtra(Intent.EXTRA_CLIENT_LABEL, com.android.internal.R.string.wallpaper_binding_label); intent.putExtra(Intent.EXTRA_CLIENT_INTENT, PendingIntent.getActivity( |