Set display size to all displays
Bug: 197730930 Test: Open Settings, go to Display -> Display size and text -> Display size, change the value, fold/unfold the device, see that the value persists. Test: DisplaySizeDataTest Test: atest ScreenResolutionFragmentTest Test: ScreenZoomSettingsTest Change-Id: I3d6858a9b20798c2ad3b12a66db3484491682691
This commit is contained in:
@@ -36,13 +36,13 @@ public class ScreenZoomPreference extends Preference {
|
||||
android.R.attr.preferenceStyle));
|
||||
|
||||
final DisplayDensityUtils density = new DisplayDensityUtils(context);
|
||||
final int defaultIndex = density.getCurrentIndex();
|
||||
final int defaultIndex = density.getCurrentIndexForDefaultDisplay();
|
||||
if (defaultIndex < 0) {
|
||||
setVisible(false);
|
||||
setEnabled(false);
|
||||
} else if (TextUtils.isEmpty(getSummary())) {
|
||||
final String[] entries = density.getEntries();
|
||||
final int currentIndex = density.getCurrentIndex();
|
||||
final String[] entries = density.getDefaultDisplayDensityEntries();
|
||||
final int currentIndex = density.getCurrentIndexForDefaultDisplay();
|
||||
setSummary(entries[currentIndex]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user