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:
@@ -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]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user