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

Commit 403cb519 authored by Amith Yamasani's avatar Amith Yamasani Committed by android-build-merger
Browse files

Persist configuration for the calling or current user am: 034ec49b

am: cd1b117b

Change-Id: I7d06ccfdeab31c5f2b3bdcdbb955dcc6a64925c4
parents a212c9f6 cd1b117b
Loading
Loading
Loading
Loading
+15 −10
Original line number Diff line number Diff line
@@ -1083,9 +1083,9 @@ public final class ActivityManagerService extends ActivityManagerNative
        }
        @Override
        public void onChange(boolean selfChange, Uri uri) {
        public void onChange(boolean selfChange, Uri uri, @UserIdInt int userId) {
            if (mFontScaleUri.equals(uri)) {
                updateFontScaleIfNeeded();
                updateFontScaleIfNeeded(userId);
            }
        }
    }
@@ -18695,23 +18695,28 @@ public final class ActivityManagerService extends ActivityManagerNative
        int userId = UserHandle.getCallingUserId();
        synchronized(this) {
            updatePersistentConfigurationLocked(values, userId);
        }
    }
    private void updatePersistentConfigurationLocked(Configuration values, @UserIdInt int userId) {
        final long origId = Binder.clearCallingIdentity();
        try {
            updateConfigurationLocked(values, null, false, true, userId, false /* deferResume */);
        } finally {
            Binder.restoreCallingIdentity(origId);
        }
    }
    private void updateFontScaleIfNeeded() {
        final int currentUserId;
        synchronized(this) {
            currentUserId = mUserController.getCurrentUserIdLocked();
        }
    private void updateFontScaleIfNeeded(@UserIdInt int userId) {
        final float scaleFactor = Settings.System.getFloatForUser(mContext.getContentResolver(),
                FONT_SCALE, 1.0f, currentUserId);
                FONT_SCALE, 1.0f, userId);
        if (mConfiguration.fontScale != scaleFactor) {
            final Configuration configuration = mWindowManager.computeNewConfiguration();
            configuration.fontScale = scaleFactor;
            updatePersistentConfiguration(configuration);
            synchronized (this) {
                updatePersistentConfigurationLocked(configuration, userId);
            }
        }
    }