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

Commit b4761c4d authored by d34d's avatar d34d
Browse files

Track current user id in ThemeService

Intent.ACTION_USER_SWITCHED is broadcasted on boot which causes the
ThemeService's reciever to fire off and request a theme change.
This patch tracks the current user ID, with the default being
UserHandle.USER_OWNER, and will only request the theme change when
the new user differs from the stored current user id.

Change-Id: I69a2d9d669a0605c44eabaf6bf541494370e1e09
REF: CYNGNOS-429
parent 12a2541a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ public class ThemeService extends IThemeService.Stub {
    private int mProgress;
    private boolean mWallpaperChangedByUs = false;
    private long mIconCacheSize = 0L;
    private int mCurrentUserId = UserHandle.USER_OWNER;

    private boolean mIsThemeApplying = false;

@@ -1155,7 +1156,8 @@ public class ThemeService extends IThemeService.Stub {
        @Override
        public void onReceive(Context context, Intent intent) {
            int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -1);
            if (userHandle >= 0) {
            if (userHandle >= 0 && userHandle != mCurrentUserId) {
                mCurrentUserId = userHandle;
                ThemeConfig config = ThemeConfig.getBootThemeForUser(mContext.getContentResolver(),
                        userHandle);
                if (DEBUG) {