Merge "Use shortcut label for overflow conversation title" into rvc-dev am: 33f840317d am: 3f6cd5033c

Original change: undetermined

Change-Id: I919f2e01fbcde8f4282aa6a44f6bc8e9380905dc
This commit is contained in:
TreeHugger Robot
2020-06-02 13:36:51 +00:00
committed by Automerger Merge Worker

View File

@@ -22,6 +22,7 @@ import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.pm.ShortcutInfo;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.content.res.Resources; import android.content.res.Resources;
import android.content.res.TypedArray; import android.content.res.TypedArray;
@@ -204,6 +205,8 @@ public class BubbleOverflowActivity extends Activity {
} }
class BubbleOverflowAdapter extends RecyclerView.Adapter<BubbleOverflowAdapter.ViewHolder> { class BubbleOverflowAdapter extends RecyclerView.Adapter<BubbleOverflowAdapter.ViewHolder> {
private static final String TAG = TAG_WITH_CLASS_NAME ? "BubbleOverflowAdapter" : TAG_BUBBLES;
private Context mContext; private Context mContext;
private Consumer<Bubble> mPromoteBubbleFromOverflow; private Consumer<Bubble> mPromoteBubbleFromOverflow;
private List<Bubble> mBubbles; private List<Bubble> mBubbles;
@@ -282,11 +285,16 @@ class BubbleOverflowAdapter extends RecyclerView.Adapter<BubbleOverflowAdapter.V
} }
}); });
Bubble.FlyoutMessage message = b.getFlyoutMessage(); ShortcutInfo info = b.getEntry().getRanking().getShortcutInfo();
if (message != null && message.senderName != null) { if (info == null) {
vh.textView.setText(message.senderName.toString()); Log.d(TAG, "ShortcutInfo required to bubble but none found for " + b);
} else { } else {
vh.textView.setText(b.getAppName()); CharSequence label = info.getLabel();
if (label == null) {
vh.textView.setText(b.getAppName());
} else {
vh.textView.setText(label.toString());
}
} }
} }