Merge "Only show Bubbles link for messaging apps" into rvc-dev
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 5f67c6a..a60a464 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -8241,6 +8241,10 @@
<string name="bubble_app_setting_selected_conversation_title">Conversations</string>
<!-- Bubble app settings: Title above a list of conversations that have been excluded from bubbling [CHAR LIMIT=100] -->
<string name="bubble_app_setting_excluded_conversation_title">All conversations can bubble except</string>
+ <!-- Bubble app settings: Content description - action to make a conversation no longer bubble -->
+ <string name="bubble_app_setting_unbubble_conversation">Turn off bubbles for this conversation</string>
+ <!-- Bubble app settings: Content description - action to make a conversation bubble -->
+ <string name="bubble_app_setting_bubble_conversation">Turn on bubbles for this conversation</string>
<!-- Configure notifications: title for swipe direction [CHAR LIMIT=60] -->
<string name="swipe_direction_title">Swipe actions</string>
@@ -9149,7 +9153,7 @@
allowed to bypass Do Not Disturb. For example, "Nest, Messages, and 2 more can interrupt". -->
<string name="zen_mode_apps_bypassing_list_count"><xliff:g id="number" example="2">%d</xliff:g> more</string>
<!-- [CHAR LIMIT=100] Zen mode settings: Allow apps to bypass DND title-->
- <string name="zen_mode_bypassing_apps_title">App exceptions</string>
+ <string name="zen_mode_bypassing_apps_title">Apps</string>
<!-- [CHAR LIMIT=100] Zen mode settings: App that can bypass DND's secondary text describing which notification channels from the app can bypass DND-->
<string name="zen_mode_bypassing_apps_all_summary">All notifications</string>
<!-- [CHAR LIMIT=100] Zen mode settings: App that can bypass DND's secondary text describing which notification channels from the app can bypass DND-->
diff --git a/src/com/android/settings/notification/AppBubbleListPreferenceController.java b/src/com/android/settings/notification/AppBubbleListPreferenceController.java
index 8701a1c..33842b6 100644
--- a/src/com/android/settings/notification/AppBubbleListPreferenceController.java
+++ b/src/com/android/settings/notification/AppBubbleListPreferenceController.java
@@ -122,6 +122,7 @@
public Preference createConversationPref(final ConversationChannelWrapper conversation) {
final ConversationPreference pref = new ConversationPreference(mContext);
populateConversationPreference(conversation, pref);
+ pref.setOnClickBubblesConversation(mAppRow.bubblePreference == BUBBLE_PREFERENCE_ALL);
pref.setOnClickListener((v) -> {
conversation.getNotificationChannel().setAllowBubbles(DEFAULT_ALLOW_BUBBLE);
mBackend.updateChannel(mAppRow.pkg, mAppRow.uid, conversation.getNotificationChannel());
@@ -138,6 +139,7 @@
public static class ConversationPreference extends Preference implements View.OnClickListener {
View.OnClickListener mOnClickListener;
+ boolean mOnClickBubbles;
ConversationPreference(Context context) {
super(context);
@@ -148,9 +150,16 @@
public void onBindViewHolder(final PreferenceViewHolder holder) {
super.onBindViewHolder(holder);
ImageView view = holder.itemView.findViewById(R.id.button);
+ view.setContentDescription(mOnClickBubbles
+ ? getContext().getString(R.string.bubble_app_setting_bubble_conversation)
+ : getContext().getString(R.string.bubble_app_setting_unbubble_conversation));
view.setOnClickListener(mOnClickListener);
}
+ public void setOnClickBubblesConversation(boolean enablesBubbles) {
+ mOnClickBubbles = enablesBubbles;
+ }
+
public void setOnClickListener(View.OnClickListener listener) {
mOnClickListener = listener;
}