Remove ActivityManagerNative dependency for adjusting font scale

ActivityManagerService now holds a ContentObserver for
Settings.System.FONT_SCALE, so it is no longer necessary to notify
ActivityManagerNative of a configuration update involving the font scale
directly.

Bug:23033258
Change-Id: Ifd002bd25724b133e83a1285be2953019178c65a
This commit is contained in:
Casey Burkhardt
2016-01-31 10:53:20 -08:00
parent b7a7158b18
commit a8b2a5072c
4 changed files with 35 additions and 45 deletions

View File

@@ -86,8 +86,6 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
private Preference mFontSizePref;
private final Configuration mCurConfig = new Configuration();
private RestrictedListPreference mScreenTimeoutPreference;
private ListPreference mNightModePreference;
private Preference mScreenSaverPreference;
@@ -401,11 +399,14 @@ public class DisplaySettings extends SettingsPreferenceFragment implements
}
private void updateFontSizeSummary() {
final Resources res = mFontSizePref.getContext().getResources();
final Context context = mFontSizePref.getContext();
final float currentScale = Settings.System.getFloat(context.getContentResolver(),
Settings.System.FONT_SCALE, 1.0f);
final Resources res = context.getResources();
final String[] entries = res.getStringArray(R.array.entries_font_size);
final String[] strEntryValues = res.getStringArray(R.array.entryvalues_font_size);
final int index = ToggleFontSizePreferenceFragment.fontSizeValueToIndex(
res.getConfiguration().fontScale, strEntryValues);
final int index = ToggleFontSizePreferenceFragment.fontSizeValueToIndex(currentScale,
strEntryValues);
mFontSizePref.setSummary(entries[index]);
}