Password settings: Fix duplicate title
For the autofill service settings, "Autofill service" is both the section title and the preference title. This change removes the duplicate preference title and promotes the app label from the summary string to the title in its place. Fix: 192403526 Test: manual - single profile, personal+work profile, change service and re-check Change-Id: Ia012232ba2856e0757289982bc3045d948ff4aa8
This commit is contained in:
@@ -65,11 +65,19 @@ public abstract class DefaultAppPreferenceController extends AbstractPreferenceC
|
||||
((TwoTargetPreference) preference).setIconSize(ICON_SIZE_MEDIUM);
|
||||
}
|
||||
if (!TextUtils.isEmpty(defaultAppLabel)) {
|
||||
preference.setSummary(defaultAppLabel);
|
||||
if (showLabelAsTitle()) {
|
||||
preference.setTitle(defaultAppLabel);
|
||||
} else {
|
||||
preference.setSummary(defaultAppLabel);
|
||||
}
|
||||
preference.setIcon(Utils.getSafeIcon(getDefaultAppIcon()));
|
||||
} else {
|
||||
Log.d(TAG, "No default app");
|
||||
preference.setSummary(R.string.app_list_preference_none);
|
||||
if (showLabelAsTitle()) {
|
||||
preference.setTitle(R.string.app_list_preference_none);
|
||||
} else {
|
||||
preference.setSummary(R.string.app_list_preference_none);
|
||||
}
|
||||
preference.setIcon(null);
|
||||
}
|
||||
mayUpdateGearIcon(app, preference);
|
||||
@@ -102,6 +110,13 @@ public abstract class DefaultAppPreferenceController extends AbstractPreferenceC
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to show the default app label as the title, instead of as the summary.
|
||||
*/
|
||||
protected boolean showLabelAsTitle() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Drawable getDefaultAppIcon() {
|
||||
if (!isAvailable()) {
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user