summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mady Mellor <madym@google.com> 2019-01-28 11:21:51 -0800
committer Mady Mellor <madym@google.com> 2019-01-28 14:08:15 -0800
commit9bad224fd0714bb6df50e153349b22d84b8dced8 (patch)
tree55e581bd3fd22c0a8fe32cebaf06a1d3cd994b4e
parentcba2c7c22673c9be3dbfeeacbd7ef73df999068a (diff)
Keep bubbles behind a flag
Alter tests to ignore the flags so they don't fail. Test: manual - make sure no bubbles show up atest BubbleControllerTest Bug: 111236845 Change-Id: Ieed38165a3699415686ef299cd54da69d7a37cea
-rw-r--r--packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java9
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java6
2 files changed, 12 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index b7bee30dc640..da29ab4e63d2 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -428,7 +428,7 @@ public class BubbleController {
entry.key).canBubble();
boolean hasOverlayIntent = n.getNotification().getBubbleMetadata() != null
&& n.getNotification().getBubbleMetadata().getIntent() != null;
- return hasOverlayIntent && canChannelOverlay && canAppOverlay;
+ return DEBUG_ENABLE_AUTO_BUBBLE && hasOverlayIntent && canChannelOverlay && canAppOverlay;
}
/**
@@ -438,7 +438,8 @@ public class BubbleController {
* message-like notification.
* </p>
*/
- private boolean shouldAutoBubble(Context context, NotificationEntry entry) {
+ @VisibleForTesting
+ protected boolean shouldAutoBubble(Context context, NotificationEntry entry) {
if (entry.isBubbleDismissed()) {
return false;
}
@@ -465,9 +466,11 @@ public class BubbleController {
Class<? extends Notification.Style> style = n.getNotification().getNotificationStyle();
boolean isMessageType = Notification.CATEGORY_MESSAGE.equals(n.getNotification().category);
boolean isMessageStyle = Notification.MessagingStyle.class.equals(style);
- return (((isMessageType && hasRemoteInput) || isMessageStyle) && autoBubbleMessages)
+ boolean shouldAutoBubble =
+ (((isMessageType && hasRemoteInput) || isMessageStyle) && autoBubbleMessages)
|| (isImportantOngoing && autoBubbleOngoing)
|| autoBubbleAll;
+ return DEBUG_ENABLE_AUTO_BUBBLE && shouldAutoBubble;
}
private static boolean shouldAutoBubbleMessages(Context context) {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java
index e80275793b28..44ff4a73a4a7 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleControllerTest.java
@@ -36,6 +36,7 @@ import com.android.systemui.statusbar.NotificationTestHelper;
import com.android.systemui.statusbar.notification.NotificationEntryListener;
import com.android.systemui.statusbar.notification.NotificationEntryManager;
import com.android.systemui.statusbar.notification.collection.NotificationData;
+import com.android.systemui.statusbar.notification.collection.NotificationEntry;
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
import com.android.systemui.statusbar.phone.DozeParameters;
import com.android.systemui.statusbar.phone.StatusBarWindowController;
@@ -189,5 +190,10 @@ public class BubbleControllerTest extends SysuiTestCase {
StatusBarWindowController statusBarWindowController) {
super(context, statusBarWindowController);
}
+
+ @Override
+ public boolean shouldAutoBubble(Context c, NotificationEntry entry) {
+ return entry.notification.getNotification().getBubbleMetadata() != null;
+ }
}
}