Merge "Fix status bar animates when open bubble updates" into rvc-dev am: 89a5f7183e am: 56c4314fdf am: 2bf54af0f4 am: ef5099215b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11708150

Change-Id: Ieee036afad9239410ff63434e9c9300eb1c258fc
This commit is contained in:
Santhosh Thangaraj
2020-06-05 22:20:25 +00:00
committed by Automerger Merge Worker
4 changed files with 27 additions and 3 deletions

View File

@@ -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

View File

@@ -882,6 +882,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);

View File

@@ -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;
}

View File

@@ -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