summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server/WallpaperManagerService.java
diff options
context:
space:
mode:
authorrpcraig <rpcraig@tycho.ncsc.mil>2012-07-05 06:41:43 -0400
committerrpcraig <rpcraig@tycho.ncsc.mil>2012-07-25 11:07:39 -0400
commit554cb0c290406f5bba34908489db5382a69d0a9a (patch)
treee72926289025da3220e138bb8152e71b6321a2c0 /services/java/com/android/server/WallpaperManagerService.java
parent2c932143ffe865d49c741e466b425bdbabbd1f2f (diff)
downloadframeworks_base-554cb0c290406f5bba34908489db5382a69d0a9a.zip
frameworks_base-554cb0c290406f5bba34908489db5382a69d0a9a.tar.gz
frameworks_base-554cb0c290406f5bba34908489db5382a69d0a9a.tar.bz2
Introduce a restorecon JNI binding.
Label the vmdl.*\.tmp files and the final .apk file differently. Modify the WallpaperManagerService to restorecon the wallpaper file. Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil> Change-Id: Idfc056e9ec0508d7e11100626a7114f341f1af70
Diffstat (limited to 'services/java/com/android/server/WallpaperManagerService.java')
-rw-r--r--services/java/com/android/server/WallpaperManagerService.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/services/java/com/android/server/WallpaperManagerService.java b/services/java/com/android/server/WallpaperManagerService.java
index d97d335..8a08277 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.UserId;
@@ -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) {