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

Commit 81b8b82d authored by Chris Tate's avatar Chris Tate Committed by android-build-merger
Browse files

Merge \\"Run the SELinux wallpaper restorecon operations on all users\\" into...

Merge \\"Run the SELinux wallpaper restorecon operations on all users\\" into nyc-mr1-dev am: bf9fa828
am: 7ce8cfbe

Change-Id: I8e5e20a2a9b21ec6a704aa9c7abb3a0ef1878d12
parents 984d575d 7ce8cfbe
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;