summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Santhosh Thangaraj <thangaraj@google.com> 2020-06-05 21:17:47 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-06-05 21:17:47 +0000
commit89a5f7183eee56b9af43d8fa2433b130cc66a23c (patch)
treef588e38d8b51656c7f3d6ce831cde6cd8981fe36
parent6bb0f4c6a12dc5593882aefb6a6df73006825f76 (diff)
parent837d4900a954d8e8defc4274c1880e6c50c473c7 (diff)
Merge "Fix status bar animates when open bubble updates" into rvc-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/SystemUIFactory.java4
-rw-r--r--packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java12
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java9
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java5
4 files changed, 27 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java
index be82a2d5325b..5674fdd3bb36 100644
--- a/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java
+++ b/packages/SystemUI/src/com/android/systemui/SystemUIFactory.java
@@ -28,6 +28,7 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.widget.LockPatternUtils;
import com.android.keyguard.KeyguardUpdateMonitor;
import com.android.keyguard.ViewMediatorCallback;
+import com.android.systemui.bubbles.BubbleController;
import com.android.systemui.dagger.DaggerSystemUIRootComponent;
import com.android.systemui.dagger.DependencyProvider;
import com.android.systemui.dagger.SystemUIRootComponent;
@@ -164,7 +165,8 @@ public class SystemUIFactory {
wakeUpCoordinator, keyguardBypassController,
Dependency.get(NotificationMediaManager.class),
Dependency.get(NotificationListener.class),
- Dependency.get(DozeParameters.class));
+ Dependency.get(DozeParameters.class),
+ Dependency.get(BubbleController.class));
}
@Module
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
index 734199eee72e..b4937e8bf767 100644
--- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
+++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleController.java
@@ -881,6 +881,18 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
return (isSummary && isSuppressedSummary) || isSuppressedBubble;
}
+ /**
+ * True if:
+ * (1) The current notification entry same as selected bubble notification entry and the
+ * stack is currently expanded.
+ *
+ * False otherwise.
+ */
+ public boolean isBubbleExpanded(NotificationEntry entry) {
+ return isStackExpanded() && mBubbleData != null && mBubbleData.getSelectedBubble() != null
+ && mBubbleData.getSelectedBubble().getKey().equals(entry.getKey()) ? true : false;
+ }
+
void promoteBubbleFromOverflow(Bubble bubble) {
bubble.setInflateSynchronously(mInflateSynchronously);
setIsBubble(bubble, /* isBubble */ true);
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java
index 76c51d61459a..9d3e915cad69 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconAreaController.java
@@ -19,6 +19,7 @@ import com.android.internal.util.ContrastColorUtil;
import com.android.settingslib.Utils;
import com.android.systemui.Interpolators;
import com.android.systemui.R;
+import com.android.systemui.bubbles.BubbleController;
import com.android.systemui.plugins.DarkIconDispatcher;
import com.android.systemui.plugins.DarkIconDispatcher.DarkReceiver;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
@@ -55,6 +56,7 @@ public class NotificationIconAreaController implements DarkReceiver,
private final NotificationWakeUpCoordinator mWakeUpCoordinator;
private final KeyguardBypassController mBypassController;
private final DozeParameters mDozeParameters;
+ private final BubbleController mBubbleController;
private int mIconSize;
private int mIconHPadding;
@@ -101,7 +103,8 @@ public class NotificationIconAreaController implements DarkReceiver,
KeyguardBypassController keyguardBypassController,
NotificationMediaManager notificationMediaManager,
NotificationListener notificationListener,
- DozeParameters dozeParameters) {
+ DozeParameters dozeParameters,
+ BubbleController bubbleController) {
mStatusBar = statusBar;
mContrastColorUtil = ContrastColorUtil.getInstance(context);
mContext = context;
@@ -112,6 +115,7 @@ public class NotificationIconAreaController implements DarkReceiver,
mWakeUpCoordinator = wakeUpCoordinator;
wakeUpCoordinator.addListener(this);
mBypassController = keyguardBypassController;
+ mBubbleController = bubbleController;
notificationListener.addNotificationSettingsListener(mSettingsListener);
initializeNotificationAreaViews(context);
@@ -291,6 +295,9 @@ public class NotificationIconAreaController implements DarkReceiver,
|| !entry.isPulseSuppressed())) {
return false;
}
+ if (mBubbleController.isBubbleExpanded(entry)) {
+ return false;
+ }
return true;
}
diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java
index 177e845bfead..d1a439f99702 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/NotificationIconAreaControllerTest.java
@@ -28,6 +28,7 @@ import android.testing.TestableLooper;
import androidx.test.filters.SmallTest;
import com.android.systemui.SysuiTestCase;
+import com.android.systemui.bubbles.BubbleController;
import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.statusbar.NotificationListener;
import com.android.systemui.statusbar.NotificationMediaManager;
@@ -63,6 +64,8 @@ public class NotificationIconAreaControllerTest extends SysuiTestCase {
@Mock
NotificationShadeWindowView mNotificationShadeWindowView;
private NotificationIconAreaController mController;
+ @Mock
+ private BubbleController mBubbleController;
@Before
public void setup() {
@@ -74,7 +77,7 @@ public class NotificationIconAreaControllerTest extends SysuiTestCase {
mController = new NotificationIconAreaController(mContext, mStatusBar,
mStatusBarStateController, mWakeUpCoordinator, mKeyguardBypassController,
- mNotificationMediaManager, mListener, mDozeParameters);
+ mNotificationMediaManager, mListener, mDozeParameters, mBubbleController);
}
@Test