am a2e8365c: am 9b0da58e: Merge "Introduce a restorecon JNI binding."

* commit 'a2e8365cc883de0d3e56e9f4af350ecfe1b8fc4c':
  Introduce a restorecon JNI binding.
This commit is contained in:
Kenny Root
2012-08-16 15:32:52 -07:00
committed by Android Git Automerger
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.UserHandle;
@ -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) {