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
This commit is contained in:
rpcraig
2012-07-05 06:41:43 -04:00
parent 2c932143ff
commit 554cb0c290
4 changed files with 124 additions and 1 deletions

View File

@ -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) {