Set slice summary text to screentitle first

To improve context on search surfaces where the
setting may be ambiguous, we set the screentitle
as the summary text as the top priority. If there is
no screentitle or the it matches the title, then we
try to use the controller summary. If the controller
summary is not valid, then we show nothing.

Bug: 79780762
Test: robotests
Change-Id: If4f7f8d4a072125604ede14e3df2afd667fa24b7
This commit is contained in:
Matthew Fritze
2018-05-15 19:22:35 -07:00
parent b7b355a1c5
commit f9c13fc305
2 changed files with 37 additions and 29 deletions

View File

@@ -190,7 +190,12 @@ public class SliceBuilderUtils {
*/
public static CharSequence getSubtitleText(Context context,
AbstractPreferenceController controller, SliceData sliceData) {
CharSequence summaryText;
CharSequence summaryText = sliceData.getScreenTitle();
if (isValidSummary(context, summaryText) && !TextUtils.equals(summaryText,
sliceData.getTitle())) {
return summaryText;
}
if (controller != null) {
summaryText = controller.getSummary();