diff options
| author | 2016-07-26 22:48:13 +0000 | |
|---|---|---|
| committer | 2016-07-26 22:48:14 +0000 | |
| commit | 7853ba63cd8b0d79a7bd99ca91035399ac00d73f (patch) | |
| tree | 81b93e66b1780f8e06625a263c6f190f6323bc6f | |
| parent | 6da665785869f0dadba9763f37076b4741960810 (diff) | |
| parent | 034ec49b19058284c7e123cfe8d239761a75b632 (diff) | |
Merge "Persist configuration for the calling or current user" into nyc-mr1-dev
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 8e4af12f2d0e..3aa2125a978d 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -1087,9 +1087,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); } } } @@ -18722,23 +18722,28 @@ public final class ActivityManagerService extends ActivityManagerNative int userId = UserHandle.getCallingUserId(); synchronized(this) { - final long origId = Binder.clearCallingIdentity(); + 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); + } } } |