Merge "Password settings: Fix duplicate title" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
d8cd67b52d
@@ -37,7 +37,6 @@
|
||||
<com.android.settings.widget.GearPreference
|
||||
android:fragment="com.android.settings.applications.defaultapps.DefaultAutofillPicker"
|
||||
android:key="default_autofill_main"
|
||||
android:title="@string/autofill_app"
|
||||
settings:keywords="@string/autofill_keywords">
|
||||
<extra
|
||||
android:name="for_work"
|
||||
|
@@ -38,7 +38,6 @@
|
||||
<com.android.settings.widget.GearPreference
|
||||
android:fragment="com.android.settings.applications.defaultapps.DefaultAutofillPicker"
|
||||
android:key="default_autofill_main"
|
||||
android:title="@string/autofill_app"
|
||||
settings:keywords="@string/autofill_keywords">
|
||||
<extra
|
||||
android:name="for_work"
|
||||
|
@@ -38,7 +38,6 @@
|
||||
<com.android.settings.widget.GearPreference
|
||||
android:fragment="com.android.settings.applications.defaultapps.DefaultAutofillPicker"
|
||||
android:key="default_autofill_work"
|
||||
android:title="@string/autofill_app"
|
||||
settings:searchable="false">
|
||||
<extra
|
||||
android:name="for_work"
|
||||
|
@@ -65,11 +65,19 @@ public abstract class DefaultAppPreferenceController extends AbstractPreferenceC
|
||||
((TwoTargetPreference) preference).setIconSize(ICON_SIZE_MEDIUM);
|
||||
}
|
||||
if (!TextUtils.isEmpty(defaultAppLabel)) {
|
||||
if (showLabelAsTitle()) {
|
||||
preference.setTitle(defaultAppLabel);
|
||||
} else {
|
||||
preference.setSummary(defaultAppLabel);
|
||||
}
|
||||
preference.setIcon(Utils.getSafeIcon(getDefaultAppIcon()));
|
||||
} else {
|
||||
Log.d(TAG, "No default app");
|
||||
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;
|
||||
|
@@ -69,4 +69,9 @@ public class DefaultAutofillPreferenceController extends DefaultAppPreferenceCon
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showLabelAsTitle() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user