From 871dbfe510bad3a27af70de2cbd4127bad0da898 Mon Sep 17 00:00:00 2001 From: Ivan Tkachenko Date: Thu, 13 Apr 2023 14:29:44 +0000 Subject: [PATCH] Remove don't bubble option for app bubbles * Remove `Don't bubble` option from Bubbles Manage menu for app bubbles * Remove unused `R.string.bubbles_dont_bubble` string Test: atest BubblesTest Bug: 278040060 Change-Id: Ia25ea330d5f04e63b54cbfacfec92adee04e87c7 --- .../Shell/res/layout/bubble_manage_menu.xml | 4 ++-- .../Shell/res/values/strings.xml | 2 -- .../wm/shell/bubbles/BubbleStackView.java | 21 ++++++++++++++----- .../android/systemui/wmshell/BubblesTest.java | 2 ++ 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml b/libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml index 8d1da0f7ad1b3..298ad3025b00d 100644 --- a/libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml +++ b/libs/WindowManager/Shell/res/layout/bubble_manage_menu.xml @@ -63,11 +63,11 @@ android:tint="@color/bubbles_icon_tint"/> + android:textAppearance="@*android:style/TextAppearance.DeviceDefault" + android:text="@string/bubbles_dont_bubble_conversation" /> diff --git a/libs/WindowManager/Shell/res/values/strings.xml b/libs/WindowManager/Shell/res/values/strings.xml index 87a7c3edf8260..b192fdf245e2c 100644 --- a/libs/WindowManager/Shell/res/values/strings.xml +++ b/libs/WindowManager/Shell/res/values/strings.xml @@ -146,8 +146,6 @@ %1$s settings Dismiss bubble - - Don\u2019t bubble Don\u2019t bubble conversation diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java index 66241628fc779..1b20f67e42abf 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java @@ -842,7 +842,7 @@ public class BubbleStackView extends FrameLayout private DismissView mDismissView; private ViewGroup mManageMenu; - private TextView mManageDontBubbleText; + private ViewGroup mManageDontBubbleView; private ViewGroup mManageSettingsView; private ImageView mManageSettingsIcon; private TextView mManageSettingsText; @@ -1217,8 +1217,8 @@ public class BubbleStackView extends FrameLayout mUnbubbleConversationCallback.accept(mBubbleData.getSelectedBubble().getKey()); }); - mManageDontBubbleText = mManageMenu - .findViewById(R.id.bubble_manage_menu_dont_bubble_text); + mManageDontBubbleView = mManageMenu + .findViewById(R.id.bubble_manage_menu_dont_bubble_container); mManageSettingsView = mManageMenu.findViewById(R.id.bubble_manage_menu_settings_container); mManageSettingsView.setOnClickListener( @@ -2890,14 +2890,16 @@ public class BubbleStackView extends FrameLayout final Bubble bubble = mBubbleData.getBubbleInStackWithKey(mExpandedBubble.getKey()); if (bubble != null && !bubble.isAppBubble()) { // Setup options for non app bubbles - mManageDontBubbleText.setText(R.string.bubbles_dont_bubble_conversation); + mManageDontBubbleView.setVisibility(VISIBLE); mManageSettingsIcon.setImageBitmap(bubble.getRawAppBadge()); mManageSettingsText.setText(getResources().getString( R.string.bubbles_app_settings, bubble.getAppName())); mManageSettingsView.setVisibility(VISIBLE); } else { // Setup options for app bubbles - mManageDontBubbleText.setText(R.string.bubbles_dont_bubble); + // App bubbles have no conversations + // so we don't show the option to not bubble conversation + mManageDontBubbleView.setVisibility(GONE); // App bubbles are not notification based // so we don't show the option to go to notification settings mManageSettingsView.setVisibility(GONE); @@ -2965,6 +2967,15 @@ public class BubbleStackView extends FrameLayout } } + /** + * Checks whether manage menu don't bubble conversation action is available and visible + * Used for testing + */ + @VisibleForTesting + public boolean isManageMenuDontBubbleVisible() { + return mManageDontBubbleView != null && mManageDontBubbleView.getVisibility() == VISIBLE; + } + /** * Checks whether manage menu notification settings action is available and visible * Used for testing diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java index e82456524012a..a42acd3464ba2 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java @@ -1257,6 +1257,7 @@ public class BubblesTest extends SysuiTestCase { stackView.showManageMenu(true); assertSysuiStates(true /* stackExpanded */, true /* mangeMenuExpanded */); assertTrue(stackView.isManageMenuSettingsVisible()); + assertTrue(stackView.isManageMenuDontBubbleVisible()); } @Test @@ -1274,6 +1275,7 @@ public class BubblesTest extends SysuiTestCase { stackView.showManageMenu(true); assertSysuiStates(true /* stackExpanded */, true /* mangeMenuExpanded */); assertFalse(stackView.isManageMenuSettingsVisible()); + assertFalse(stackView.isManageMenuDontBubbleVisible()); } @Test