summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Lyn Han <lynhan@google.com> 2020-03-05 16:34:37 -0800
committer Lyn Han <lynhan@google.com> 2020-03-05 17:08:01 -0800
commit8cc4bf84dd9402aff42fcc5aecbf014cea8d5cb4 (patch)
tree527868bf552a8f8026ac595d139971cbdac982b3
parentf3aea16bdbcff9f0a78ea1a68f3ea9aeb571a173 (diff)
Overflow dogfood flag
Bug: 150396294 Test: manual - disable flag, overflow hides; enable flag, overflow shows Test: atest SystemUITests Change-Id: I8714c89fd23b880431bb5beeb715060e30975a7a
-rw-r--r--packages/SystemUI/src/com/android/systemui/bubbles/BubbleExperimentConfig.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java19
2 files changed, 27 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExperimentConfig.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExperimentConfig.java
index 2873811aeffb..b33eeba5da70 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExperimentConfig.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleExperimentConfig.java
@@ -73,6 +73,9 @@ public class BubbleExperimentConfig {
private static final String WHITELISTED_AUTO_BUBBLE_APPS = "whitelisted_auto_bubble_apps";
+ private static final String ALLOW_BUBBLE_OVERFLOW = "allow_bubble_overflow";
+ private static final boolean ALLOW_BUBBLE_OVERFLOW_DEFAULT = false;
+
/**
* When true, if a notification has the information necessary to bubble (i.e. valid
* contentIntent and an icon or image), then a {@link android.app.Notification.BubbleMetadata}
@@ -87,6 +90,15 @@ public class BubbleExperimentConfig {
}
/**
+ * When true, show a menu with dismissed and aged-out bubbles.
+ */
+ static boolean allowBubbleOverflow(Context context) {
+ return Settings.Secure.getInt(context.getContentResolver(),
+ ALLOW_BUBBLE_OVERFLOW,
+ ALLOW_BUBBLE_OVERFLOW_DEFAULT ? 1 : 0) != 0;
+ }
+
+ /**
* Same as {@link #allowAnyNotifToBubble(Context)} except it filters for notifications that
* are using {@link Notification.MessagingStyle} and have remote input.
*/
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
index 6647069f2033..0cf6d89e8d74 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleStackView.java
@@ -589,6 +589,9 @@ public class BubbleStackView extends FrameLayout {
}
private void setUpOverflow() {
+ if (!BubbleExperimentConfig.allowBubbleOverflow(mContext)) {
+ return;
+ }
int overflowBtnIndex = 0;
if (mBubbleOverflow == null) {
mBubbleOverflow = new BubbleOverflow(getContext());
@@ -800,7 +803,8 @@ public class BubbleStackView extends FrameLayout {
@Nullable
Bubble getExpandedBubble() {
if (mExpandedBubble == null
- || (mExpandedBubble.getIconView() == mBubbleOverflow.getBtn()
+ || (BubbleExperimentConfig.allowBubbleOverflow(mContext)
+ && mExpandedBubble.getIconView() == mBubbleOverflow.getBtn()
&& BubbleOverflow.KEY.equals(mExpandedBubble.getKey()))) {
return null;
}
@@ -857,6 +861,9 @@ public class BubbleStackView extends FrameLayout {
}
private void updateOverflowBtnVisibility(boolean apply) {
+ if (!BubbleExperimentConfig.allowBubbleOverflow(mContext)) {
+ return;
+ }
if (mIsExpanded) {
if (DEBUG_BUBBLE_STACK_VIEW) {
Log.d(TAG, "Show overflow button.");
@@ -1083,7 +1090,8 @@ public class BubbleStackView extends FrameLayout {
float y = event.getRawY();
if (mIsExpanded) {
if (isIntersecting(mBubbleContainer, x, y)) {
- if (isIntersecting(mBubbleOverflow.getBtn(), x, y)) {
+ if (BubbleExperimentConfig.allowBubbleOverflow(mContext)
+ && isIntersecting(mBubbleOverflow.getBtn(), x, y)) {
return mBubbleOverflow.getBtn();
}
// Could be tapping or dragging a bubble while expanded
@@ -1820,8 +1828,11 @@ public class BubbleStackView extends FrameLayout {
* @return the number of bubbles in the stack view.
*/
public int getBubbleCount() {
- // Subtract 1 for the overflow button that is always in the bubble container.
- return mBubbleContainer.getChildCount() - 1;
+ if (BubbleExperimentConfig.allowBubbleOverflow(mContext)) {
+ // Subtract 1 for the overflow button that is always in the bubble container.
+ return mBubbleContainer.getChildCount() - 1;
+ }
+ return mBubbleContainer.getChildCount();
}
/**