Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ce8cfbe authored by Christopher Tate's avatar Christopher Tate Committed by android-build-merger
Browse files

Merge \"Run the SELinux wallpaper restorecon operations on all users\" into nyc-mr1-dev

am: bf9fa828

Change-Id: I06a8e2f5510f019f6c553a7b26ce602a690f9732
parents 7da697a7 bf9fa828
Loading
Loading
Loading
Loading
+20 −13
Original line number Diff line number Diff line
@@ -487,6 +487,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
    final SparseArray<WallpaperData> mWallpaperMap = new SparseArray<WallpaperData>();
    final SparseArray<WallpaperData> mLockWallpaperMap = new SparseArray<WallpaperData>();

    final SparseArray<Boolean> mUserRestorecon = new SparseArray<Boolean>();
    int mCurrentUserId;

    static class WallpaperData {
@@ -944,13 +945,18 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {

    void onUnlockUser(final int userId) {
        synchronized (mLock) {
            if (mCurrentUserId == userId && mWaitingForUnlock) {
            if (mCurrentUserId == userId) {
                if (mWaitingForUnlock) {
                    // If we're switching users, now is when we transition the wallpaper
                    switchUser(userId, null);
                }

                // Make sure that the SELinux labeling of all the relevant files is correct.
                // This corrects for mislabeling bugs that might have arisen from move-to
                // operations involving the wallpaper files.  This isn't timing-critical,
                // so we do it in the background to avoid holding up the user unlock operation.
                if (mUserRestorecon.get(userId) != Boolean.TRUE) {
                    mUserRestorecon.put(userId, Boolean.TRUE);
                    Runnable relabeler = new Runnable() {
                        @Override
                        public void run() {
@@ -967,6 +973,7 @@ public class WallpaperManagerService extends IWallpaperManager.Stub {
                }
            }
        }
    }

    void onRemoveUser(int userId) {
        if (userId < 1) return;