Add subtext to Default apps.
Retrieve the default Sms app, default Browser app, and default Phone app and append the label together to form the summary text for Default apps settings. Bug: 36376411 Test: make RunSettingsRoboTests Change-Id: I8ccf71dde43bba04c4bc4a900c9a181513e7710b
This commit is contained in:
@@ -49,10 +49,7 @@ public abstract class DefaultAppPreferenceController extends PreferenceControlle
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
final DefaultAppInfo app = getDefaultAppInfo();
|
||||
CharSequence defaultAppLabel = null;
|
||||
if (app != null) {
|
||||
defaultAppLabel = app.loadLabel();
|
||||
}
|
||||
CharSequence defaultAppLabel = getDefaultAppLabel();
|
||||
if (!TextUtils.isEmpty(defaultAppLabel)) {
|
||||
preference.setSummary(defaultAppLabel);
|
||||
} else {
|
||||
@@ -84,4 +81,15 @@ public abstract class DefaultAppPreferenceController extends PreferenceControlle
|
||||
//By default return null. It's up to subclasses to provide logic.
|
||||
return null;
|
||||
}
|
||||
|
||||
public CharSequence getDefaultAppLabel() {
|
||||
if (!isAvailable()) {
|
||||
return null;
|
||||
}
|
||||
final DefaultAppInfo app = getDefaultAppInfo();
|
||||
if (app != null) {
|
||||
return app.loadLabel();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user