Support getDynamicSummary in BasePreferenceController

Adds dynamic summary getter in relevant BasePreferenceControllers.
Preferece controllers that don't have dynamic summaries or which
are not yet BasePreferenceControllers are not changed right now.

Change-Id: I435ccab7758d90515583fd8ca10a9b1ef0c858b9
Fixes: 71514936
Test: robotests
This commit is contained in:
Matthew Fritze
2018-01-02 16:39:39 -08:00
parent ce3633be80
commit c69f73f4d1
14 changed files with 94 additions and 62 deletions

View File

@@ -77,7 +77,8 @@ public class HeaderPreferenceController extends NotificationPreferenceController
: mAppRow.label;
}
CharSequence getSummary() {
@Override
public String getSummary() {
if (mChannel != null) {
if (mChannelGroup != null && mChannelGroup.getGroup() != null
&& !TextUtils.isEmpty(mChannelGroup.getGroup().getName())) {
@@ -87,12 +88,12 @@ public class HeaderPreferenceController extends NotificationPreferenceController
summary.append(bidi.unicodeWrap(mContext.getText(
R.string.notification_header_divider_symbol_with_spaces)));
summary.append(bidi.unicodeWrap(mChannelGroup.getGroup().getName().toString()));
return summary;
return summary.toString();
} else {
return mAppRow.label;
return mAppRow.label.toString();
}
} else if (mChannelGroup != null && mChannelGroup.getGroup() != null) {
return mAppRow.label;
return mAppRow.label.toString();
} else {
return "";
}