Migrate Bubbles to wm-shell (1/n)
Create Bubbles interface and optional mechanism The Dependency using still remain in some class will remove or refactor in follow-up CL. Bug: 161980186 Test: atest SystemUITests Test: manual Change-Id: I88e5cc6ead1c56985aac07fe8eac39f08f114248
This commit is contained in:
@@ -37,7 +37,7 @@ import com.android.settingslib.bluetooth.LocalBluetoothManager;
|
||||
import com.android.systemui.appops.AppOpsController;
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
@@ -288,7 +288,7 @@ public class Dependency {
|
||||
@Inject Lazy<KeyguardDismissUtil> mKeyguardDismissUtil;
|
||||
@Inject Lazy<SmartReplyController> mSmartReplyController;
|
||||
@Inject Lazy<RemoteInputQuickSettingsDisabler> mRemoteInputQuickSettingsDisabler;
|
||||
@Inject Lazy<BubbleController> mBubbleController;
|
||||
@Inject Lazy<Bubbles> mBubbles;
|
||||
@Inject Lazy<NotificationEntryManager> mNotificationEntryManager;
|
||||
@Inject Lazy<SensorPrivacyManager> mSensorPrivacyManager;
|
||||
@Inject Lazy<AutoHideController> mAutoHideController;
|
||||
@@ -483,7 +483,7 @@ public class Dependency {
|
||||
mProviders.put(SmartReplyController.class, mSmartReplyController::get);
|
||||
mProviders.put(RemoteInputQuickSettingsDisabler.class,
|
||||
mRemoteInputQuickSettingsDisabler::get);
|
||||
mProviders.put(BubbleController.class, mBubbleController::get);
|
||||
mProviders.put(Bubbles.class, mBubbles::get);
|
||||
mProviders.put(NotificationEntryManager.class, mNotificationEntryManager::get);
|
||||
mProviders.put(ForegroundServiceNotificationListener.class,
|
||||
mForegroundServiceNotificationListener::get);
|
||||
|
||||
@@ -33,7 +33,6 @@ import static android.view.View.INVISIBLE;
|
||||
import static android.view.View.VISIBLE;
|
||||
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
|
||||
|
||||
import static com.android.systemui.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_CONTROLLER;
|
||||
import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES;
|
||||
import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME;
|
||||
import static com.android.systemui.statusbar.StatusBarState.SHADE;
|
||||
@@ -130,7 +129,8 @@ import java.util.Objects;
|
||||
*
|
||||
* The controller manages addition, removal, and visible state of bubbles on screen.
|
||||
*/
|
||||
public class BubbleController implements ConfigurationController.ConfigurationListener, Dumpable {
|
||||
public class BubbleController implements Bubbles, ConfigurationController.ConfigurationListener,
|
||||
Dumpable {
|
||||
|
||||
private static final String TAG = TAG_WITH_CLASS_NAME ? "BubbleController" : TAG_BUBBLES;
|
||||
|
||||
@@ -519,6 +519,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
/**
|
||||
* See {@link NotifCallback}.
|
||||
*/
|
||||
@Override
|
||||
public void addNotifCallback(NotifCallback callback) {
|
||||
mCallbacks.add(callback);
|
||||
}
|
||||
@@ -700,6 +701,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
* since we want the scrim's appearance and behavior to be identical to that of the notification
|
||||
* shade scrim.
|
||||
*/
|
||||
@Override
|
||||
public ScrimView getScrimForBubble() {
|
||||
return mBubbleScrim;
|
||||
}
|
||||
@@ -708,6 +710,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
* Called when the status bar has become visible or invisible (either permanently or
|
||||
* temporarily).
|
||||
*/
|
||||
@Override
|
||||
public void onStatusBarVisibilityChanged(boolean visible) {
|
||||
if (mStackView != null) {
|
||||
// Hide the stack temporarily if the status bar has been made invisible, and the stack
|
||||
@@ -725,14 +728,16 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
mInflateSynchronously = inflateSynchronously;
|
||||
}
|
||||
|
||||
void setOverflowListener(BubbleData.Listener listener) {
|
||||
@Override
|
||||
public void setOverflowListener(BubbleData.Listener listener) {
|
||||
mOverflowListener = listener;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Bubbles for updating overflow.
|
||||
*/
|
||||
List<Bubble> getOverflowBubbles() {
|
||||
@Override
|
||||
public List<Bubble> getOverflowBubbles() {
|
||||
return mBubbleData.getOverflowBubbles();
|
||||
}
|
||||
|
||||
@@ -955,13 +960,10 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
}
|
||||
}
|
||||
|
||||
boolean inLandscape() {
|
||||
return mOrientation == Configuration.ORIENTATION_LANDSCAPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a listener to be notified of bubble expand events.
|
||||
*/
|
||||
@Override
|
||||
public void setExpandListener(BubbleExpandListener listener) {
|
||||
mExpandListener = ((isExpanding, key) -> {
|
||||
if (listener != null) {
|
||||
@@ -987,29 +989,17 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
return mBubbleData.hasBubbles();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the stack of bubbles is expanded or not.
|
||||
*/
|
||||
@Override
|
||||
public boolean isStackExpanded() {
|
||||
return mBubbleData.isExpanded();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell the stack of bubbles to collapse.
|
||||
*/
|
||||
@Override
|
||||
public void collapseStack() {
|
||||
mBubbleData.setExpanded(false /* expanded */);
|
||||
}
|
||||
|
||||
/**
|
||||
* True if either:
|
||||
* (1) There is a bubble associated with the provided key and if its notification is hidden
|
||||
* from the shade.
|
||||
* (2) There is a group summary associated with the provided key that is hidden from the shade
|
||||
* because it has been dismissed but still has child bubbles active.
|
||||
*
|
||||
* False otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean isBubbleNotificationSuppressedFromShade(NotificationEntry entry) {
|
||||
String key = entry.getKey();
|
||||
boolean isSuppressedBubble = (mBubbleData.hasAnyBubbleWithKey(key)
|
||||
@@ -1021,19 +1011,14 @@ 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.
|
||||
*/
|
||||
@Override
|
||||
public boolean isBubbleExpanded(NotificationEntry entry) {
|
||||
return isStackExpanded() && mBubbleData != null && mBubbleData.getSelectedBubble() != null
|
||||
&& mBubbleData.getSelectedBubble().getKey().equals(entry.getKey()) ? true : false;
|
||||
}
|
||||
|
||||
void promoteBubbleFromOverflow(Bubble bubble) {
|
||||
@Override
|
||||
public void promoteBubbleFromOverflow(Bubble bubble) {
|
||||
mLogger.log(bubble, BubbleLogger.Event.BUBBLE_OVERFLOW_REMOVE_BACK_TO_STACK);
|
||||
bubble.setInflateSynchronously(mInflateSynchronously);
|
||||
bubble.setShouldAutoExpand(true);
|
||||
@@ -1041,12 +1026,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
setIsBubble(bubble, true /* isBubble */);
|
||||
}
|
||||
|
||||
/**
|
||||
* Request the stack expand if needed, then select the specified Bubble as current.
|
||||
* If no bubble exists for this entry, one is created.
|
||||
*
|
||||
* @param entry the notification for the bubble to be selected
|
||||
*/
|
||||
@Override
|
||||
public void expandStackAndSelectBubble(NotificationEntry entry) {
|
||||
if (mStatusBarStateListener.getCurrentState() == SHADE) {
|
||||
mNotifEntryToExpandOnShadeUnlock = null;
|
||||
@@ -1074,12 +1054,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* When a notification is marked Priority, expand the stack if needed,
|
||||
* then (maybe create and) select the given bubble.
|
||||
*
|
||||
* @param entry the notification for the bubble to show
|
||||
*/
|
||||
@Override
|
||||
public void onUserChangedImportance(NotificationEntry entry) {
|
||||
try {
|
||||
int flags = Notification.BubbleMetadata.FLAG_SUPPRESS_NOTIFICATION;
|
||||
@@ -1094,10 +1069,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Directs a back gesture at the bubble stack. When opened, the current expanded bubble
|
||||
* is forwarded a back key down/up pair.
|
||||
*/
|
||||
@Override
|
||||
public void performBackPressIfNeeded() {
|
||||
if (mStackView != null) {
|
||||
mStackView.performBackPressIfNeeded();
|
||||
@@ -1152,15 +1124,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
mContext, mStackView, mBubbleIconFactory, false /* skipInflation */);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a user has indicated that an active notification should be shown as a bubble.
|
||||
* <p>
|
||||
* This method will collapse the shade, create the bubble without a flyout or dot, and suppress
|
||||
* the notification from appearing in the shade.
|
||||
*
|
||||
* @param entry the notification to change bubble state for.
|
||||
* @param shouldBubble whether the notification should show as a bubble or not.
|
||||
*/
|
||||
@Override
|
||||
public void onUserChangedBubble(@NonNull final NotificationEntry entry, boolean shouldBubble) {
|
||||
NotificationChannel channel = entry.getChannel();
|
||||
final String appPkg = entry.getSbn().getPackageName();
|
||||
@@ -1199,13 +1163,9 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the bubble with the given key.
|
||||
* <p>
|
||||
* Must be called from the main thread.
|
||||
*/
|
||||
@MainThread
|
||||
void removeBubble(String key, int reason) {
|
||||
@Override
|
||||
public void removeBubble(String key, int reason) {
|
||||
if (mBubbleData.hasAnyBubbleWithKey(key)) {
|
||||
mBubbleData.dismissBubbleWithKey(key, reason);
|
||||
}
|
||||
@@ -1447,16 +1407,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* We intercept notification entries (including group summaries) dismissed by the user when
|
||||
* there is an active bubble associated with it. We do this so that developers can still
|
||||
* cancel it (and hence the bubbles associated with it). However, these intercepted
|
||||
* notifications should then be hidden from the shade since the user has cancelled them, so we
|
||||
* {@link Bubble#setSuppressNotification}. For the case of suppressed summaries, we also add
|
||||
* {@link BubbleData#addSummaryToSuppress}.
|
||||
*
|
||||
* @return true if we want to intercept the dismissal of the entry, else false.
|
||||
*/
|
||||
@Override
|
||||
public boolean handleDismissalInterception(NotificationEntry entry) {
|
||||
if (entry == null) {
|
||||
return false;
|
||||
@@ -1579,10 +1530,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
||||
mStackView.updateContentDescription();
|
||||
}
|
||||
|
||||
/**
|
||||
* The display id of the expanded view, if the stack is expanded and not occluded by the
|
||||
* status bar, otherwise returns {@link Display#INVALID_DISPLAY}.
|
||||
*/
|
||||
@Override
|
||||
public int getExpandedDisplayId(Context context) {
|
||||
if (mStackView == null) {
|
||||
return INVALID_DISPLAY;
|
||||
|
||||
@@ -127,7 +127,7 @@ public class BubbleExpandedView extends LinearLayout {
|
||||
|
||||
private boolean mIsOverflow;
|
||||
|
||||
private BubbleController mBubbleController = Dependency.get(BubbleController.class);
|
||||
private Bubbles mBubbles = Dependency.get(Bubbles.class);
|
||||
private WindowManager mWindowManager;
|
||||
private ActivityManager mActivityManager;
|
||||
|
||||
@@ -168,7 +168,7 @@ public class BubbleExpandedView extends LinearLayout {
|
||||
+ "bubble=" + getBubbleKey());
|
||||
}
|
||||
if (mActivityView == null) {
|
||||
mBubbleController.removeBubble(getBubbleKey(),
|
||||
mBubbles.removeBubble(getBubbleKey(),
|
||||
BubbleController.DISMISS_INVALID_INTENT);
|
||||
return;
|
||||
}
|
||||
@@ -194,7 +194,7 @@ public class BubbleExpandedView extends LinearLayout {
|
||||
// the bubble again so we'll just remove it.
|
||||
Log.w(TAG, "Exception while displaying bubble: " + getBubbleKey()
|
||||
+ ", " + e.getMessage() + "; removing bubble");
|
||||
mBubbleController.removeBubble(getBubbleKey(),
|
||||
mBubbles.removeBubble(getBubbleKey(),
|
||||
BubbleController.DISMISS_INVALID_INTENT);
|
||||
}
|
||||
});
|
||||
@@ -242,7 +242,7 @@ public class BubbleExpandedView extends LinearLayout {
|
||||
}
|
||||
if (mBubble != null) {
|
||||
// Must post because this is called from a binder thread.
|
||||
post(() -> mBubbleController.removeBubble(mBubble.getKey(),
|
||||
post(() -> mBubbles.removeBubble(mBubble.getKey(),
|
||||
BubbleController.DISMISS_TASK_FINISHED));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class BubbleOverflowActivity extends Activity {
|
||||
private TextView mEmptyStateTitle;
|
||||
private TextView mEmptyStateSubtitle;
|
||||
private ImageView mEmptyStateImage;
|
||||
private BubbleController mBubbleController;
|
||||
private Bubbles mBubbles;
|
||||
private BubbleOverflowAdapter mAdapter;
|
||||
private RecyclerView mRecyclerView;
|
||||
private List<Bubble> mOverflowBubbles = new ArrayList<>();
|
||||
@@ -71,7 +71,8 @@ public class BubbleOverflowActivity extends Activity {
|
||||
}
|
||||
@Override
|
||||
public boolean canScrollVertically() {
|
||||
if (mBubbleController.inLandscape()) {
|
||||
if (getResources().getConfiguration().orientation
|
||||
== Configuration.ORIENTATION_LANDSCAPE) {
|
||||
return super.canScrollVertically();
|
||||
}
|
||||
return false;
|
||||
@@ -93,8 +94,8 @@ public class BubbleOverflowActivity extends Activity {
|
||||
}
|
||||
|
||||
@Inject
|
||||
public BubbleOverflowActivity(BubbleController controller) {
|
||||
mBubbleController = controller;
|
||||
public BubbleOverflowActivity(Bubbles bubbles) {
|
||||
mBubbles = bubbles;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -131,15 +132,15 @@ public class BubbleOverflowActivity extends Activity {
|
||||
final int viewHeight = recyclerViewHeight / rows;
|
||||
|
||||
mAdapter = new BubbleOverflowAdapter(getApplicationContext(), mOverflowBubbles,
|
||||
mBubbleController::promoteBubbleFromOverflow, viewWidth, viewHeight);
|
||||
mBubbles::promoteBubbleFromOverflow, viewWidth, viewHeight);
|
||||
mRecyclerView.setAdapter(mAdapter);
|
||||
|
||||
mOverflowBubbles.clear();
|
||||
mOverflowBubbles.addAll(mBubbleController.getOverflowBubbles());
|
||||
mOverflowBubbles.addAll(mBubbles.getOverflowBubbles());
|
||||
mAdapter.notifyDataSetChanged();
|
||||
updateEmptyStateVisibility();
|
||||
|
||||
mBubbleController.setOverflowListener(mDataListener);
|
||||
mBubbles.setOverflowListener(mDataListener);
|
||||
updateTheme();
|
||||
}
|
||||
|
||||
@@ -209,8 +210,7 @@ public class BubbleOverflowActivity extends Activity {
|
||||
|
||||
if (DEBUG_OVERFLOW) {
|
||||
Log.d(TAG, BubbleDebugConfig.formatBubblesString(
|
||||
mBubbleController.getOverflowBubbles(),
|
||||
null));
|
||||
mBubbles.getOverflowBubbles(), null));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
145
packages/SystemUI/src/com/android/systemui/bubbles/Bubbles.java
Normal file
145
packages/SystemUI/src/com/android/systemui/bubbles/Bubbles.java
Normal file
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright (C) 2020 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package com.android.systemui.bubbles;
|
||||
|
||||
import android.annotation.NonNull;
|
||||
import android.content.Context;
|
||||
import android.view.Display;
|
||||
|
||||
import androidx.annotation.MainThread;
|
||||
|
||||
import com.android.systemui.statusbar.ScrimView;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.phone.ScrimController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Interface to engage bubbles feature.
|
||||
*/
|
||||
public interface Bubbles {
|
||||
|
||||
/**
|
||||
* @return {@code true} if there is a bubble associated with the provided key and if its
|
||||
* notification is hidden from the shade or there is a group summary associated with the
|
||||
* provided key that is hidden from the shade because it has been dismissed but still has child
|
||||
* bubbles active.
|
||||
*/
|
||||
boolean isBubbleNotificationSuppressedFromShade(NotificationEntry entry);
|
||||
|
||||
/**
|
||||
* @return {@code true} if the current notification entry same as selected bubble
|
||||
* notification entry and the stack is currently expanded.
|
||||
*/
|
||||
boolean isBubbleExpanded(NotificationEntry entry);
|
||||
|
||||
/** @return {@code true} if stack of bubbles is expanded or not. */
|
||||
boolean isStackExpanded();
|
||||
|
||||
/**
|
||||
* @return the {@link ScrimView} drawn behind the bubble stack. This is managed by
|
||||
* {@link ScrimController} since we want the scrim's appearance and behavior to be identical to
|
||||
* that of the notification shade scrim.
|
||||
*/
|
||||
ScrimView getScrimForBubble();
|
||||
|
||||
/**
|
||||
* @return the display id of the expanded view, if the stack is expanded and not occluded by the
|
||||
* status bar, otherwise returns {@link Display#INVALID_DISPLAY}.
|
||||
*/
|
||||
int getExpandedDisplayId(Context context);
|
||||
|
||||
/** @return Bubbles for updating overflow. */
|
||||
List<Bubble> getOverflowBubbles();
|
||||
|
||||
/** Tell the stack of bubbles to collapse. */
|
||||
void collapseStack();
|
||||
|
||||
/**
|
||||
* Request the stack expand if needed, then select the specified Bubble as current.
|
||||
* If no bubble exists for this entry, one is created.
|
||||
*
|
||||
* @param entry the notification for the bubble to be selected
|
||||
*/
|
||||
void expandStackAndSelectBubble(NotificationEntry entry);
|
||||
|
||||
|
||||
/**
|
||||
* Directs a back gesture at the bubble stack. When opened, the current expanded bubble
|
||||
* is forwarded a back key down/up pair.
|
||||
*/
|
||||
void performBackPressIfNeeded();
|
||||
|
||||
/** Promote the provided bubbles when overflow view. */
|
||||
void promoteBubbleFromOverflow(Bubble bubble);
|
||||
|
||||
/**
|
||||
* We intercept notification entries (including group summaries) dismissed by the user when
|
||||
* there is an active bubble associated with it. We do this so that developers can still
|
||||
* cancel it (and hence the bubbles associated with it). However, these intercepted
|
||||
* notifications should then be hidden from the shade since the user has cancelled them, so we
|
||||
* {@link Bubble#setSuppressNotification}. For the case of suppressed summaries, we also add
|
||||
* {@link BubbleData#addSummaryToSuppress}.
|
||||
*
|
||||
* @return true if we want to intercept the dismissal of the entry, else false.
|
||||
*/
|
||||
boolean handleDismissalInterception(NotificationEntry entry);
|
||||
|
||||
/**
|
||||
* Removes the bubble with the given key.
|
||||
* <p>
|
||||
* Must be called from the main thread.
|
||||
*/
|
||||
@MainThread
|
||||
void removeBubble(String key, int reason);
|
||||
|
||||
|
||||
/**
|
||||
* When a notification is marked Priority, expand the stack if needed,
|
||||
* then (maybe create and) select the given bubble.
|
||||
*
|
||||
* @param entry the notification for the bubble to show
|
||||
*/
|
||||
void onUserChangedImportance(NotificationEntry entry);
|
||||
|
||||
/**
|
||||
* Called when the status bar has become visible or invisible (either permanently or
|
||||
* temporarily).
|
||||
*/
|
||||
void onStatusBarVisibilityChanged(boolean visible);
|
||||
|
||||
/**
|
||||
* Called when a user has indicated that an active notification should be shown as a bubble.
|
||||
* <p>
|
||||
* This method will collapse the shade, create the bubble without a flyout or dot, and suppress
|
||||
* the notification from appearing in the shade.
|
||||
*
|
||||
* @param entry the notification to change bubble state for.
|
||||
* @param shouldBubble whether the notification should show as a bubble or not.
|
||||
*/
|
||||
void onUserChangedBubble(@NonNull NotificationEntry entry, boolean shouldBubble);
|
||||
|
||||
|
||||
/** See {@link BubbleController.NotifCallback}. */
|
||||
void addNotifCallback(BubbleController.NotifCallback callback);
|
||||
|
||||
/** Set a listener to be notified of bubble expand events. */
|
||||
void setExpandListener(BubbleController.BubbleExpandListener listener);
|
||||
|
||||
/** Set a listener to be notified of when overflow view update. */
|
||||
void setOverflowListener(BubbleData.Listener listener);
|
||||
}
|
||||
@@ -25,6 +25,7 @@ import com.android.internal.statusbar.IStatusBarService;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.BubbleData;
|
||||
import com.android.systemui.bubbles.BubbleDataRepository;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dump.DumpManager;
|
||||
import com.android.systemui.model.SysUiState;
|
||||
@@ -52,7 +53,7 @@ public interface BubbleModule {
|
||||
*/
|
||||
@SysUISingleton
|
||||
@Provides
|
||||
static BubbleController newBubbleController(
|
||||
static Bubbles newBubbleController(
|
||||
Context context,
|
||||
NotificationShadeWindowController notificationShadeWindowController,
|
||||
StatusBarStateController statusBarStateController,
|
||||
|
||||
@@ -58,7 +58,7 @@ import com.android.internal.logging.UiEventLoggerImpl;
|
||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.recents.OverviewProxyService;
|
||||
import com.android.systemui.shared.system.QuickStepContract;
|
||||
|
||||
@@ -426,9 +426,9 @@ public class KeyButtonView extends ImageView implements ButtonInterface {
|
||||
if (getDisplay() != null) {
|
||||
displayId = getDisplay().getDisplayId();
|
||||
}
|
||||
// Bubble controller will give us a valid display id if it should get the back event
|
||||
BubbleController bubbleController = Dependency.get(BubbleController.class);
|
||||
int bubbleDisplayId = bubbleController.getExpandedDisplayId(mContext);
|
||||
// Bubbles will give us a valid display id if it should get the back event
|
||||
Bubbles Bubbles = Dependency.get(Bubbles.class);
|
||||
int bubbleDisplayId = Bubbles.getExpandedDisplayId(mContext);
|
||||
if (mCode == KeyEvent.KEYCODE_BACK && bubbleDisplayId != INVALID_DISPLAY) {
|
||||
displayId = bubbleDisplayId;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ import com.android.systemui.Dependency;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.SystemUIFactory;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.model.SysUiState;
|
||||
import com.android.systemui.navigationbar.NavigationBarView;
|
||||
import com.android.systemui.navigationbar.NavigationModeController;
|
||||
@@ -725,9 +725,8 @@ public class EdgeBackGestureHandler extends CurrentUserTracker implements Displa
|
||||
KeyEvent.FLAG_FROM_SYSTEM | KeyEvent.FLAG_VIRTUAL_HARD_KEY,
|
||||
InputDevice.SOURCE_KEYBOARD);
|
||||
|
||||
// Bubble controller will give us a valid display id if it should get the back event
|
||||
BubbleController bubbleController = Dependency.get(BubbleController.class);
|
||||
int bubbleDisplayId = bubbleController.getExpandedDisplayId(mContext);
|
||||
// Bubbles will give us a valid display id if it should get the back event
|
||||
final int bubbleDisplayId = Dependency.get(Bubbles.class).getExpandedDisplayId(mContext);
|
||||
if (bubbleDisplayId != INVALID_DISPLAY) {
|
||||
ev.setDisplayId(bubbleDisplayId);
|
||||
} else {
|
||||
|
||||
@@ -26,7 +26,7 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.dagger.StatusBarModule;
|
||||
@@ -47,6 +47,7 @@ import com.android.systemui.util.Assert;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Stack;
|
||||
|
||||
/**
|
||||
@@ -84,7 +85,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
||||
* possible.
|
||||
*/
|
||||
private final boolean mAlwaysExpandNonGroupedNotification;
|
||||
private final BubbleController mBubbleController;
|
||||
private final Optional<Bubbles> mBubblesOptional;
|
||||
private final DynamicPrivacyController mDynamicPrivacyController;
|
||||
private final KeyguardBypassController mBypassController;
|
||||
private final ForegroundServiceSectionController mFgsSectionController;
|
||||
@@ -112,7 +113,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
||||
StatusBarStateController statusBarStateController,
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
KeyguardBypassController bypassController,
|
||||
BubbleController bubbleController,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
DynamicPrivacyController privacyController,
|
||||
ForegroundServiceSectionController fgsSectionController,
|
||||
DynamicChildBindController dynamicChildBindController,
|
||||
@@ -130,7 +131,7 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
||||
Resources res = context.getResources();
|
||||
mAlwaysExpandNonGroupedNotification =
|
||||
res.getBoolean(R.bool.config_alwaysExpandNonGroupedNotifications);
|
||||
mBubbleController = bubbleController;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
mDynamicPrivacyController = privacyController;
|
||||
mDynamicChildBindController = dynamicChildBindController;
|
||||
mLowPriorityInflationHelper = lowPriorityInflationHelper;
|
||||
@@ -157,8 +158,10 @@ public class NotificationViewHierarchyManager implements DynamicPrivacyControlle
|
||||
final int N = activeNotifications.size();
|
||||
for (int i = 0; i < N; i++) {
|
||||
NotificationEntry ent = activeNotifications.get(i);
|
||||
final boolean isBubbleNotificationSuppressedFromShade = mBubblesOptional.isPresent()
|
||||
&& mBubblesOptional.get().isBubbleNotificationSuppressedFromShade(ent);
|
||||
if (ent.isRowDismissed() || ent.isRowRemoved()
|
||||
|| mBubbleController.isBubbleNotificationSuppressedFromShade(ent)
|
||||
|| isBubbleNotificationSuppressedFromShade
|
||||
|| mFgsSectionController.hasEntry(ent)) {
|
||||
// we don't want to update removed notifications because they could
|
||||
// temporarily become children if they were isolated before.
|
||||
|
||||
@@ -21,7 +21,7 @@ import android.content.Context;
|
||||
import android.os.Handler;
|
||||
|
||||
import com.android.internal.statusbar.IStatusBarService;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.media.MediaDataManager;
|
||||
@@ -59,6 +59,8 @@ import com.android.systemui.tracing.ProtoTracer;
|
||||
import com.android.systemui.util.DeviceConfigProxy;
|
||||
import com.android.systemui.util.concurrency.DelayableExecutor;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import dagger.Binds;
|
||||
import dagger.Lazy;
|
||||
import dagger.Module;
|
||||
@@ -162,7 +164,7 @@ public interface StatusBarDependenciesModule {
|
||||
StatusBarStateController statusBarStateController,
|
||||
NotificationEntryManager notificationEntryManager,
|
||||
KeyguardBypassController bypassController,
|
||||
BubbleController bubbleController,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
DynamicPrivacyController privacyController,
|
||||
ForegroundServiceSectionController fgsSectionController,
|
||||
DynamicChildBindController dynamicChildBindController,
|
||||
@@ -177,7 +179,7 @@ public interface StatusBarDependenciesModule {
|
||||
statusBarStateController,
|
||||
notificationEntryManager,
|
||||
bypassController,
|
||||
bubbleController,
|
||||
bubblesOptional,
|
||||
privacyController,
|
||||
fgsSectionController,
|
||||
dynamicChildBindController,
|
||||
|
||||
@@ -22,7 +22,7 @@ import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.systemui.DejankUtils;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow;
|
||||
import com.android.systemui.statusbar.phone.StatusBar;
|
||||
@@ -38,19 +38,19 @@ import javax.inject.Inject;
|
||||
public final class NotificationClicker implements View.OnClickListener {
|
||||
private static final String TAG = "NotificationClicker";
|
||||
|
||||
private final BubbleController mBubbleController;
|
||||
private final NotificationClickerLogger mLogger;
|
||||
private final Optional<StatusBar> mStatusBar;
|
||||
private final Optional<StatusBar> mStatusBarOptional;
|
||||
private final Optional<Bubbles> mBubblesOptional;
|
||||
private final NotificationActivityStarter mNotificationActivityStarter;
|
||||
|
||||
private NotificationClicker(
|
||||
BubbleController bubbleController,
|
||||
NotificationClickerLogger logger,
|
||||
Optional<StatusBar> statusBar,
|
||||
Optional<StatusBar> statusBarOptional,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
NotificationActivityStarter notificationActivityStarter) {
|
||||
mBubbleController = bubbleController;
|
||||
mLogger = logger;
|
||||
mStatusBar = statusBar;
|
||||
mStatusBarOptional = statusBarOptional;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
mNotificationActivityStarter = notificationActivityStarter;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public final class NotificationClicker implements View.OnClickListener {
|
||||
return;
|
||||
}
|
||||
|
||||
mStatusBar.ifPresent(statusBar -> statusBar.wakeUpIfDozing(
|
||||
mStatusBarOptional.ifPresent(statusBar -> statusBar.wakeUpIfDozing(
|
||||
SystemClock.uptimeMillis(), v, "NOTIFICATION_CLICK"));
|
||||
|
||||
final ExpandableNotificationRow row = (ExpandableNotificationRow) v;
|
||||
@@ -92,8 +92,8 @@ public final class NotificationClicker implements View.OnClickListener {
|
||||
row.setJustClicked(true);
|
||||
DejankUtils.postAfterTraversal(() -> row.setJustClicked(false));
|
||||
|
||||
if (!row.getEntry().isBubble()) {
|
||||
mBubbleController.collapseStack();
|
||||
if (!row.getEntry().isBubble() && mBubblesOptional.isPresent()) {
|
||||
mBubblesOptional.get().collapseStack();
|
||||
}
|
||||
|
||||
mNotificationActivityStarter.onNotificationClicked(entry.getSbn(), row);
|
||||
@@ -118,26 +118,23 @@ public final class NotificationClicker implements View.OnClickListener {
|
||||
|
||||
/** Daggerized builder for NotificationClicker. */
|
||||
public static class Builder {
|
||||
private final BubbleController mBubbleController;
|
||||
private final NotificationClickerLogger mLogger;
|
||||
|
||||
@Inject
|
||||
public Builder(
|
||||
BubbleController bubbleController,
|
||||
NotificationClickerLogger logger) {
|
||||
mBubbleController = bubbleController;
|
||||
public Builder(NotificationClickerLogger logger) {
|
||||
mLogger = logger;
|
||||
}
|
||||
|
||||
/** Builds an instance. */
|
||||
public NotificationClicker build(
|
||||
Optional<StatusBar> statusBar,
|
||||
Optional<StatusBar> statusBarOptional,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
NotificationActivityStarter notificationActivityStarter
|
||||
) {
|
||||
return new NotificationClicker(
|
||||
mBubbleController,
|
||||
mLogger,
|
||||
statusBar,
|
||||
statusBarOptional,
|
||||
bubblesOptional,
|
||||
notificationActivityStarter);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.systemui.statusbar.notification.collection.coordinator;
|
||||
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifCollection;
|
||||
import com.android.systemui.statusbar.notification.collection.NotifPipeline;
|
||||
@@ -26,6 +27,7 @@ import com.android.systemui.statusbar.notification.collection.notifcollection.Di
|
||||
import com.android.systemui.statusbar.notification.collection.notifcollection.NotifDismissInterceptor;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -54,7 +56,7 @@ import javax.inject.Inject;
|
||||
public class BubbleCoordinator implements Coordinator {
|
||||
private static final String TAG = "BubbleCoordinator";
|
||||
|
||||
private final BubbleController mBubbleController;
|
||||
private final Optional<Bubbles> mBubblesOptional;
|
||||
private final NotifCollection mNotifCollection;
|
||||
private final Set<String> mInterceptedDismissalEntries = new HashSet<>();
|
||||
private NotifPipeline mNotifPipeline;
|
||||
@@ -62,9 +64,9 @@ public class BubbleCoordinator implements Coordinator {
|
||||
|
||||
@Inject
|
||||
public BubbleCoordinator(
|
||||
BubbleController bubbleController,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
NotifCollection notifCollection) {
|
||||
mBubbleController = bubbleController;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
mNotifCollection = notifCollection;
|
||||
}
|
||||
|
||||
@@ -73,13 +75,17 @@ public class BubbleCoordinator implements Coordinator {
|
||||
mNotifPipeline = pipeline;
|
||||
mNotifPipeline.addNotificationDismissInterceptor(mDismissInterceptor);
|
||||
mNotifPipeline.addFinalizeFilter(mNotifFilter);
|
||||
mBubbleController.addNotifCallback(mNotifCallback);
|
||||
if (mBubblesOptional.isPresent()) {
|
||||
mBubblesOptional.get().addNotifCallback(mNotifCallback);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private final NotifFilter mNotifFilter = new NotifFilter(TAG) {
|
||||
@Override
|
||||
public boolean shouldFilterOut(NotificationEntry entry, long now) {
|
||||
return mBubbleController.isBubbleNotificationSuppressedFromShade(entry);
|
||||
return mBubblesOptional.isPresent()
|
||||
&& mBubblesOptional.get().isBubbleNotificationSuppressedFromShade(entry);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -97,7 +103,8 @@ public class BubbleCoordinator implements Coordinator {
|
||||
@Override
|
||||
public boolean shouldInterceptDismissal(NotificationEntry entry) {
|
||||
// for experimental bubbles
|
||||
if (mBubbleController.handleDismissalInterception(entry)) {
|
||||
if (mBubblesOptional.isPresent()
|
||||
&& mBubblesOptional.get().handleDismissalInterception(entry)) {
|
||||
mInterceptedDismissalEntries.add(entry.getKey());
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -21,9 +21,8 @@ import android.service.notification.StatusBarNotification;
|
||||
import android.util.ArraySet;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController.StateListener;
|
||||
@@ -43,6 +42,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -64,25 +64,20 @@ public class NotificationGroupManagerLegacy implements OnHeadsUpChangedListener,
|
||||
new ArraySet<>();
|
||||
private final ArraySet<OnGroupChangeListener> mGroupChangeListeners = new ArraySet<>();
|
||||
private final Lazy<PeopleNotificationIdentifier> mPeopleNotificationIdentifier;
|
||||
private final Optional<Lazy<Bubbles>> mBubblesOptional;
|
||||
private int mBarState = -1;
|
||||
private HashMap<String, StatusBarNotification> mIsolatedEntries = new HashMap<>();
|
||||
private HeadsUpManager mHeadsUpManager;
|
||||
private boolean mIsUpdatingUnchangedGroup;
|
||||
@Nullable private BubbleController mBubbleController = null;
|
||||
|
||||
@Inject
|
||||
public NotificationGroupManagerLegacy(
|
||||
StatusBarStateController statusBarStateController,
|
||||
Lazy<PeopleNotificationIdentifier> peopleNotificationIdentifier) {
|
||||
Lazy<PeopleNotificationIdentifier> peopleNotificationIdentifier,
|
||||
Optional<Lazy<Bubbles>> bubblesOptional) {
|
||||
statusBarStateController.addCallback(this);
|
||||
mPeopleNotificationIdentifier = peopleNotificationIdentifier;
|
||||
}
|
||||
|
||||
private BubbleController getBubbleController() {
|
||||
if (mBubbleController == null) {
|
||||
mBubbleController = Dependency.get(BubbleController.class);
|
||||
}
|
||||
return mBubbleController;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -247,7 +242,8 @@ public class NotificationGroupManagerLegacy implements OnHeadsUpChangedListener,
|
||||
int childCount = 0;
|
||||
boolean hasBubbles = false;
|
||||
for (NotificationEntry entry : group.children.values()) {
|
||||
if (!getBubbleController().isBubbleNotificationSuppressedFromShade(entry)) {
|
||||
if (mBubblesOptional.isPresent() && !mBubblesOptional.get().get()
|
||||
.isBubbleNotificationSuppressedFromShade(entry)) {
|
||||
childCount++;
|
||||
} else {
|
||||
hasBubbles = true;
|
||||
|
||||
@@ -26,7 +26,7 @@ import android.view.accessibility.AccessibilityManager;
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
import com.android.internal.statusbar.IStatusBarService;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
@@ -74,6 +74,7 @@ import com.android.systemui.statusbar.phone.StatusBar;
|
||||
import com.android.systemui.statusbar.policy.HeadsUpManager;
|
||||
import com.android.systemui.util.leak.LeakDetector;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import javax.inject.Provider;
|
||||
@@ -132,7 +133,7 @@ public interface NotificationsModule {
|
||||
UserContextProvider contextTracker,
|
||||
Provider<PriorityOnboardingDialogController.Builder> builderProvider,
|
||||
AssistantFeedbackController assistantFeedbackController,
|
||||
BubbleController bubbleController,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
UiEventLogger uiEventLogger,
|
||||
OnUserInteractionCallback onUserInteractionCallback) {
|
||||
return new NotificationGutsManager(
|
||||
@@ -149,7 +150,7 @@ public interface NotificationsModule {
|
||||
contextTracker,
|
||||
builderProvider,
|
||||
assistantFeedbackController,
|
||||
bubbleController,
|
||||
bubblesOptional,
|
||||
uiEventLogger,
|
||||
onUserInteractionCallback);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.systemui.statusbar.notification.init
|
||||
|
||||
import android.service.notification.StatusBarNotification
|
||||
import com.android.systemui.bubbles.Bubbles
|
||||
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption
|
||||
import com.android.systemui.statusbar.NotificationPresenter
|
||||
import com.android.systemui.statusbar.notification.NotificationActivityStarter
|
||||
@@ -25,6 +26,7 @@ import com.android.systemui.statusbar.notification.stack.NotificationListContain
|
||||
import com.android.systemui.statusbar.phone.StatusBar
|
||||
import java.io.FileDescriptor
|
||||
import java.io.PrintWriter
|
||||
import java.util.Optional
|
||||
|
||||
/**
|
||||
* The master controller for all notifications-related work
|
||||
@@ -35,6 +37,7 @@ import java.io.PrintWriter
|
||||
interface NotificationsController {
|
||||
fun initialize(
|
||||
statusBar: StatusBar,
|
||||
bubblesOptional: Optional<Bubbles>,
|
||||
presenter: NotificationPresenter,
|
||||
listContainer: NotificationListContainer,
|
||||
notificationActivityStarter: NotificationActivityStarter,
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.systemui.statusbar.notification.init
|
||||
|
||||
import android.service.notification.StatusBarNotification
|
||||
import com.android.systemui.bubbles.Bubbles
|
||||
import com.android.systemui.dagger.SysUISingleton
|
||||
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption
|
||||
import com.android.systemui.statusbar.FeatureFlags
|
||||
@@ -75,6 +76,7 @@ class NotificationsControllerImpl @Inject constructor(
|
||||
|
||||
override fun initialize(
|
||||
statusBar: StatusBar,
|
||||
bubblesOptional: Optional<Bubbles>,
|
||||
presenter: NotificationPresenter,
|
||||
listContainer: NotificationListContainer,
|
||||
notificationActivityStarter: NotificationActivityStarter,
|
||||
@@ -90,7 +92,8 @@ class NotificationsControllerImpl @Inject constructor(
|
||||
listController.bind()
|
||||
|
||||
notificationRowBinder.setNotificationClicker(
|
||||
clickerBuilder.build(Optional.of(statusBar), notificationActivityStarter))
|
||||
clickerBuilder.build(
|
||||
Optional.of(statusBar), bubblesOptional, notificationActivityStarter))
|
||||
notificationRowBinder.setUpWithPresenter(
|
||||
presenter,
|
||||
listContainer,
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package com.android.systemui.statusbar.notification.init
|
||||
|
||||
import android.service.notification.StatusBarNotification
|
||||
import com.android.systemui.bubbles.Bubbles
|
||||
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper.SnoozeOption
|
||||
import com.android.systemui.statusbar.NotificationListener
|
||||
import com.android.systemui.statusbar.NotificationPresenter
|
||||
@@ -26,6 +27,7 @@ import com.android.systemui.statusbar.notification.stack.NotificationListContain
|
||||
import com.android.systemui.statusbar.phone.StatusBar
|
||||
import java.io.FileDescriptor
|
||||
import java.io.PrintWriter
|
||||
import java.util.Optional
|
||||
import javax.inject.Inject
|
||||
|
||||
/**
|
||||
@@ -37,6 +39,7 @@ class NotificationsControllerStub @Inject constructor(
|
||||
|
||||
override fun initialize(
|
||||
statusBar: StatusBar,
|
||||
bubblesOptional: Optional<Bubbles>,
|
||||
presenter: NotificationPresenter,
|
||||
listContainer: NotificationListContainer,
|
||||
notificationActivityStarter: NotificationActivityStarter,
|
||||
|
||||
@@ -72,7 +72,7 @@ import com.android.internal.widget.CachingIconView;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.Interpolators;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
import com.android.systemui.plugins.PluginListener;
|
||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||
@@ -1074,7 +1074,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
|
||||
return new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Dependency.get(BubbleController.class)
|
||||
Dependency.get(Bubbles.class)
|
||||
.onUserChangedBubble(mEntry, !mEntry.isBubble() /* createBubble */);
|
||||
mHeadsUpManager.removeNotification(mEntry.getKey(), true /* releaseImmediately */);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.settingslib.notification.ConversationIconFactory;
|
||||
import com.android.systemui.Prefs;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.statusbar.notification.NotificationChannelHelper;
|
||||
@@ -75,6 +75,7 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.inject.Provider;
|
||||
|
||||
@@ -93,7 +94,7 @@ public class NotificationConversationInfo extends LinearLayout implements
|
||||
private OnUserInteractionCallback mOnUserInteractionCallback;
|
||||
private Handler mMainHandler;
|
||||
private Handler mBgHandler;
|
||||
private BubbleController mBubbleController;
|
||||
private Optional<Bubbles> mBubblesOptional;
|
||||
private String mPackageName;
|
||||
private String mAppName;
|
||||
private int mAppUid;
|
||||
@@ -222,7 +223,7 @@ public class NotificationConversationInfo extends LinearLayout implements
|
||||
@Main Handler mainHandler,
|
||||
@Background Handler bgHandler,
|
||||
OnConversationSettingsClickListener onConversationSettingsClickListener,
|
||||
BubbleController bubbleController) {
|
||||
Optional<Bubbles> bubblesOptional) {
|
||||
mSelectedAction = -1;
|
||||
mINotificationManager = iNotificationManager;
|
||||
mOnUserInteractionCallback = onUserInteractionCallback;
|
||||
@@ -241,7 +242,7 @@ public class NotificationConversationInfo extends LinearLayout implements
|
||||
mIconFactory = conversationIconFactory;
|
||||
mUserContext = userContext;
|
||||
mBubbleMetadata = bubbleMetadata;
|
||||
mBubbleController = bubbleController;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
mBuilderProvider = builderProvider;
|
||||
mMainHandler = mainHandler;
|
||||
mBgHandler = bgHandler;
|
||||
@@ -640,9 +641,11 @@ public class NotificationConversationInfo extends LinearLayout implements
|
||||
mINotificationManager.setBubblesAllowed(mAppPkg, mAppUid,
|
||||
BUBBLE_PREFERENCE_SELECTED);
|
||||
}
|
||||
post(() -> {
|
||||
mBubbleController.onUserChangedImportance(mEntry);
|
||||
});
|
||||
if (mBubblesOptional.isPresent()) {
|
||||
post(() -> {
|
||||
mBubblesOptional.get().onUserChangedImportance(mEntry);
|
||||
});
|
||||
}
|
||||
}
|
||||
mChannelToUpdate.setImportance(Math.max(
|
||||
mChannelToUpdate.getOriginalImportance(), IMPORTANCE_DEFAULT));
|
||||
|
||||
@@ -47,7 +47,7 @@ import com.android.settingslib.notification.ConversationIconFactory;
|
||||
import com.android.systemui.Dependency;
|
||||
import com.android.systemui.Dumpable;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.qualifiers.Background;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||
@@ -70,6 +70,7 @@ import com.android.systemui.statusbar.policy.DeviceProvisionedController;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.inject.Provider;
|
||||
|
||||
@@ -116,7 +117,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
||||
private final Lazy<StatusBar> mStatusBarLazy;
|
||||
private final Handler mMainHandler;
|
||||
private final Handler mBgHandler;
|
||||
private final BubbleController mBubbleController;
|
||||
private final Optional<Bubbles> mBubblesOptional;
|
||||
private Runnable mOpenRunnable;
|
||||
private final INotificationManager mNotificationManager;
|
||||
private final LauncherApps mLauncherApps;
|
||||
@@ -141,7 +142,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
||||
UserContextProvider contextTracker,
|
||||
Provider<PriorityOnboardingDialogController.Builder> builderProvider,
|
||||
AssistantFeedbackController assistantFeedbackController,
|
||||
BubbleController bubbleController,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
UiEventLogger uiEventLogger,
|
||||
OnUserInteractionCallback onUserInteractionCallback) {
|
||||
mContext = context;
|
||||
@@ -157,7 +158,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
||||
mBuilderProvider = builderProvider;
|
||||
mChannelEditorDialogController = channelEditorDialogController;
|
||||
mAssistantFeedbackController = assistantFeedbackController;
|
||||
mBubbleController = bubbleController;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
mUiEventLogger = uiEventLogger;
|
||||
mOnUserInteractionCallback = onUserInteractionCallback;
|
||||
}
|
||||
@@ -490,7 +491,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
||||
mMainHandler,
|
||||
mBgHandler,
|
||||
onConversationSettingsListener,
|
||||
mBubbleController);
|
||||
mBubblesOptional);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,7 +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.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.demomode.DemoMode;
|
||||
import com.android.systemui.demomode.DemoModeController;
|
||||
@@ -40,6 +40,7 @@ import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -65,7 +66,7 @@ public class NotificationIconAreaController implements
|
||||
private final NotificationWakeUpCoordinator mWakeUpCoordinator;
|
||||
private final KeyguardBypassController mBypassController;
|
||||
private final DozeParameters mDozeParameters;
|
||||
private final BubbleController mBubbleController;
|
||||
private final Optional<Bubbles> mBubblesOptional;
|
||||
private final StatusBarWindowController mStatusBarWindowController;
|
||||
|
||||
private int mIconSize;
|
||||
@@ -114,7 +115,7 @@ public class NotificationIconAreaController implements
|
||||
NotificationMediaManager notificationMediaManager,
|
||||
NotificationListener notificationListener,
|
||||
DozeParameters dozeParameters,
|
||||
BubbleController bubbleController,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
DemoModeController demoModeController,
|
||||
DarkIconDispatcher darkIconDispatcher,
|
||||
StatusBarWindowController statusBarWindowController) {
|
||||
@@ -127,7 +128,7 @@ public class NotificationIconAreaController implements
|
||||
mWakeUpCoordinator = wakeUpCoordinator;
|
||||
wakeUpCoordinator.addListener(this);
|
||||
mBypassController = keyguardBypassController;
|
||||
mBubbleController = bubbleController;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
mDemoModeController = demoModeController;
|
||||
mDemoModeController.addCallback(this);
|
||||
mStatusBarWindowController = statusBarWindowController;
|
||||
@@ -298,7 +299,7 @@ public class NotificationIconAreaController implements
|
||||
|| !entry.isPulseSuppressed())) {
|
||||
return false;
|
||||
}
|
||||
if (mBubbleController.isBubbleExpanded(entry)) {
|
||||
if (mBubblesOptional.isPresent() && mBubblesOptional.get().isBubbleExpanded(entry)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -34,6 +34,8 @@ import android.view.ViewTreeObserver;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.internal.colorextraction.ColorExtractor;
|
||||
import com.android.internal.colorextraction.ColorExtractor.GradientColors;
|
||||
@@ -139,6 +141,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
|
||||
private ScrimView mScrimInFront;
|
||||
private ScrimView mScrimBehind;
|
||||
@Nullable
|
||||
private ScrimView mScrimForBubble;
|
||||
|
||||
private Runnable mScrimBehindChangeRunnable;
|
||||
@@ -238,7 +241,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
* Attach the controller to the supplied views.
|
||||
*/
|
||||
public void attachViews(
|
||||
ScrimView scrimBehind, ScrimView scrimInFront, ScrimView scrimForBubble) {
|
||||
ScrimView scrimBehind, ScrimView scrimInFront, @Nullable ScrimView scrimForBubble) {
|
||||
mScrimBehind = scrimBehind;
|
||||
mScrimInFront = scrimInFront;
|
||||
mScrimForBubble = scrimForBubble;
|
||||
@@ -258,7 +261,9 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
|
||||
mScrimBehind.setDefaultFocusHighlightEnabled(false);
|
||||
mScrimInFront.setDefaultFocusHighlightEnabled(false);
|
||||
mScrimForBubble.setDefaultFocusHighlightEnabled(false);
|
||||
if (mScrimForBubble != null) {
|
||||
mScrimForBubble.setDefaultFocusHighlightEnabled(false);
|
||||
}
|
||||
updateScrims();
|
||||
mKeyguardUpdateMonitor.registerCallback(mKeyguardVisibilityCallback);
|
||||
}
|
||||
@@ -455,7 +460,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
}
|
||||
}
|
||||
|
||||
private void setOrAdaptCurrentAnimation(View scrim) {
|
||||
private void setOrAdaptCurrentAnimation(@Nullable View scrim) {
|
||||
if (scrim == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
float alpha = getCurrentScrimAlpha(scrim);
|
||||
if (isAnimating(scrim)) {
|
||||
// Adapt current animation.
|
||||
@@ -606,11 +615,9 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
// Only animate scrim color if the scrim view is actually visible
|
||||
boolean animateScrimInFront = mScrimInFront.getViewAlpha() != 0 && !mBlankScreen;
|
||||
boolean animateScrimBehind = mScrimBehind.getViewAlpha() != 0 && !mBlankScreen;
|
||||
boolean animateScrimForBubble = mScrimForBubble.getViewAlpha() != 0 && !mBlankScreen;
|
||||
|
||||
mScrimInFront.setColors(mColors, animateScrimInFront);
|
||||
mScrimBehind.setColors(mColors, animateScrimBehind);
|
||||
mScrimForBubble.setColors(mColors, animateScrimForBubble);
|
||||
|
||||
// Calculate minimum scrim opacity for white or black text.
|
||||
int textColor = mColors.supportsDarkText() ? Color.BLACK : Color.WHITE;
|
||||
@@ -632,7 +639,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
}
|
||||
setScrimAlpha(mScrimInFront, mInFrontAlpha);
|
||||
setScrimAlpha(mScrimBehind, mBehindAlpha);
|
||||
setScrimAlpha(mScrimForBubble, mBubbleAlpha);
|
||||
|
||||
if (mScrimForBubble != null) {
|
||||
boolean animateScrimForBubble = mScrimForBubble.getViewAlpha() != 0 && !mBlankScreen;
|
||||
mScrimForBubble.setColors(mColors, animateScrimForBubble);
|
||||
setScrimAlpha(mScrimForBubble, mBubbleAlpha);
|
||||
}
|
||||
// The animation could have all already finished, let's call onFinished just in case
|
||||
onFinished();
|
||||
dispatchScrimsVisible();
|
||||
@@ -828,12 +840,14 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, OnCo
|
||||
mBubbleTint = Color.TRANSPARENT;
|
||||
updateScrimColor(mScrimInFront, mInFrontAlpha, mInFrontTint);
|
||||
updateScrimColor(mScrimBehind, mBehindAlpha, mBehindTint);
|
||||
updateScrimColor(mScrimForBubble, mBubbleAlpha, mBubbleTint);
|
||||
if (mScrimForBubble != null) {
|
||||
updateScrimColor(mScrimForBubble, mBubbleAlpha, mBubbleTint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isAnimating(View scrim) {
|
||||
return scrim.getTag(TAG_KEY_ANIM) != null;
|
||||
private boolean isAnimating(@Nullable View scrim) {
|
||||
return scrim != null && scrim.getTag(TAG_KEY_ANIM) != null;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
|
||||
@@ -19,6 +19,8 @@ package com.android.systemui.statusbar.phone;
|
||||
import android.graphics.Color;
|
||||
import android.os.Trace;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.systemui.dock.DockManager;
|
||||
import com.android.systemui.statusbar.ScrimView;
|
||||
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;
|
||||
@@ -212,7 +214,9 @@ public enum ScrimState {
|
||||
// Set all scrims black, before they fade transparent.
|
||||
updateScrimColor(mScrimInFront, 1f /* alpha */, Color.BLACK /* tint */);
|
||||
updateScrimColor(mScrimBehind, 1f /* alpha */, Color.BLACK /* tint */);
|
||||
updateScrimColor(mScrimForBubble, 1f /* alpha */, Color.BLACK /* tint */);
|
||||
if (mScrimForBubble != null) {
|
||||
updateScrimColor(mScrimForBubble, 1f /* alpha */, Color.BLACK /* tint */);
|
||||
}
|
||||
|
||||
// Scrims should still be black at the end of the transition.
|
||||
mFrontTint = Color.BLACK;
|
||||
@@ -258,7 +262,7 @@ public enum ScrimState {
|
||||
float mDefaultScrimAlpha;
|
||||
ScrimView mScrimInFront;
|
||||
ScrimView mScrimBehind;
|
||||
ScrimView mScrimForBubble;
|
||||
@Nullable ScrimView mScrimForBubble;
|
||||
|
||||
DozeParameters mDozeParameters;
|
||||
DockManager mDockManager;
|
||||
|
||||
@@ -22,7 +22,7 @@ import android.view.ViewTreeObserver;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
@@ -31,6 +31,7 @@ import com.android.systemui.statusbar.NotificationShadeWindowController;
|
||||
import com.android.systemui.statusbar.StatusBarState;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
@@ -50,7 +51,7 @@ public class ShadeControllerImpl implements ShadeController {
|
||||
private final int mDisplayId;
|
||||
protected final Lazy<StatusBar> mStatusBarLazy;
|
||||
private final Lazy<AssistManager> mAssistManagerLazy;
|
||||
private final Lazy<BubbleController> mBubbleControllerLazy;
|
||||
private final Optional<Lazy<Bubbles>> mBubblesOptional;
|
||||
|
||||
private final ArrayList<Runnable> mPostCollapseRunnables = new ArrayList<>();
|
||||
|
||||
@@ -63,7 +64,7 @@ public class ShadeControllerImpl implements ShadeController {
|
||||
WindowManager windowManager,
|
||||
Lazy<StatusBar> statusBarLazy,
|
||||
Lazy<AssistManager> assistManagerLazy,
|
||||
Lazy<BubbleController> bubbleControllerLazy
|
||||
Optional<Lazy<Bubbles>> bubblesOptional
|
||||
) {
|
||||
mCommandQueue = commandQueue;
|
||||
mStatusBarStateController = statusBarStateController;
|
||||
@@ -73,7 +74,7 @@ public class ShadeControllerImpl implements ShadeController {
|
||||
// TODO: Remove circular reference to StatusBar when possible.
|
||||
mStatusBarLazy = statusBarLazy;
|
||||
mAssistManagerLazy = assistManagerLazy;
|
||||
mBubbleControllerLazy = bubbleControllerLazy;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,8 +134,8 @@ public class ShadeControllerImpl implements ShadeController {
|
||||
|
||||
getStatusBar().getNotificationShadeWindowViewController().cancelExpandHelper();
|
||||
getStatusBarView().collapsePanel(true /* animate */, delayed, speedUpFactor);
|
||||
} else {
|
||||
mBubbleControllerLazy.get().collapseStack();
|
||||
} else if (mBubblesOptional.isPresent()) {
|
||||
mBubblesOptional.get().get().collapseStack();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ import com.android.systemui.SystemUI;
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.charging.WirelessChargingAnimation;
|
||||
import com.android.systemui.classifier.FalsingLog;
|
||||
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
||||
@@ -649,7 +650,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
protected StatusBarNotificationPresenter mPresenter;
|
||||
private NotificationActivityStarter mNotificationActivityStarter;
|
||||
private Lazy<NotificationShadeDepthController> mNotificationShadeDepthControllerLazy;
|
||||
private final BubbleController mBubbleController;
|
||||
private final Optional<Bubbles> mBubblesOptional;
|
||||
private final BubbleController.BubbleExpandListener mBubbleExpandListener;
|
||||
|
||||
private ActivityIntentHelper mActivityIntentHelper;
|
||||
@@ -698,7 +699,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
WakefulnessLifecycle wakefulnessLifecycle,
|
||||
SysuiStatusBarStateController statusBarStateController,
|
||||
VibratorHelper vibratorHelper,
|
||||
BubbleController bubbleController,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
VisualStabilityManager visualStabilityManager,
|
||||
DeviceProvisionedController deviceProvisionedController,
|
||||
NavigationBarController navigationBarController,
|
||||
@@ -778,7 +779,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
mWakefulnessLifecycle = wakefulnessLifecycle;
|
||||
mStatusBarStateController = statusBarStateController;
|
||||
mVibratorHelper = vibratorHelper;
|
||||
mBubbleController = bubbleController;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
mVisualStabilityManager = visualStabilityManager;
|
||||
mDeviceProvisionedController = deviceProvisionedController;
|
||||
mNavigationBarController = navigationBarController;
|
||||
@@ -834,7 +835,10 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
mWakefulnessLifecycle.addObserver(mWakefulnessObserver);
|
||||
mUiModeManager = mContext.getSystemService(UiModeManager.class);
|
||||
mBypassHeadsUpNotifier.setUp();
|
||||
mBubbleController.setExpandListener(mBubbleExpandListener);
|
||||
if (mBubblesOptional.isPresent()) {
|
||||
mBubblesOptional.get().setExpandListener(mBubbleExpandListener);
|
||||
}
|
||||
|
||||
mActivityIntentHelper = new ActivityIntentHelper(mContext);
|
||||
|
||||
mColorExtractor.addOnColorsChangedListener(this);
|
||||
@@ -1145,7 +1149,8 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
|
||||
ScrimView scrimBehind = mNotificationShadeWindowView.findViewById(R.id.scrim_behind);
|
||||
ScrimView scrimInFront = mNotificationShadeWindowView.findViewById(R.id.scrim_in_front);
|
||||
ScrimView scrimForBubble = mBubbleController.getScrimForBubble();
|
||||
ScrimView scrimForBubble = mBubblesOptional.isPresent()
|
||||
? mBubblesOptional.get().getScrimForBubble() : null;
|
||||
|
||||
mScrimController.setScrimVisibleListener(scrimsVisible -> {
|
||||
mNotificationShadeWindowController.setScrimsVisibility(scrimsVisible);
|
||||
@@ -1341,6 +1346,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
|
||||
mNotificationsController.initialize(
|
||||
this,
|
||||
mBubblesOptional,
|
||||
mPresenter,
|
||||
mStackScrollerController.getNotificationListContainer(),
|
||||
mNotificationActivityStarter,
|
||||
@@ -2491,10 +2497,12 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
|
||||
/** Temporarily hides Bubbles if the status bar is hidden. */
|
||||
private void updateBubblesVisibility() {
|
||||
mBubbleController.onStatusBarVisibilityChanged(
|
||||
mStatusBarMode != MODE_LIGHTS_OUT
|
||||
&& mStatusBarMode != MODE_LIGHTS_OUT_TRANSPARENT
|
||||
&& !mStatusBarWindowHidden);
|
||||
if (mBubblesOptional.isPresent()) {
|
||||
mBubblesOptional.get().onStatusBarVisibilityChanged(
|
||||
mStatusBarMode != MODE_LIGHTS_OUT
|
||||
&& mStatusBarMode != MODE_LIGHTS_OUT_TRANSPARENT
|
||||
&& !mStatusBarWindowHidden);
|
||||
}
|
||||
}
|
||||
|
||||
void checkBarMode(@TransitionMode int mode, @WindowVisibleState int windowState,
|
||||
@@ -2817,8 +2825,8 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
if (mRemoteInputManager.getController() != null) {
|
||||
mRemoteInputManager.getController().closeRemoteInputs();
|
||||
}
|
||||
if (mBubbleController.isStackExpanded()) {
|
||||
mBubbleController.collapseStack();
|
||||
if (mBubblesOptional.isPresent() && mBubblesOptional.get().isStackExpanded()) {
|
||||
mBubblesOptional.get().collapseStack();
|
||||
}
|
||||
if (mLockscreenUserManager.isCurrentProfile(getSendingUserId())) {
|
||||
int flags = CommandQueue.FLAG_EXCLUDE_NONE;
|
||||
@@ -2833,9 +2841,9 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
if (mNotificationShadeWindowController != null) {
|
||||
mNotificationShadeWindowController.setNotTouchable(false);
|
||||
}
|
||||
if (mBubbleController.isStackExpanded()) {
|
||||
if (mBubblesOptional.isPresent() && mBubblesOptional.get().isStackExpanded()) {
|
||||
// Post to main thread handler, since updating the UI.
|
||||
mMainThreadHandler.post(() -> mBubbleController.collapseStack());
|
||||
mMainThreadHandler.post(() -> mBubblesOptional.get().collapseStack());
|
||||
}
|
||||
finishBarAnimations();
|
||||
resetUserExpandedStates();
|
||||
@@ -3535,8 +3543,8 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
if (mState != StatusBarState.KEYGUARD && mState != StatusBarState.SHADE_LOCKED) {
|
||||
if (mNotificationPanelViewController.canPanelBeCollapsed()) {
|
||||
mShadeController.animateCollapsePanels();
|
||||
} else {
|
||||
mBubbleController.performBackPressIfNeeded();
|
||||
} else if (mBubblesOptional.isPresent()) {
|
||||
mBubblesOptional.get().performBackPressIfNeeded();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -4054,7 +4062,7 @@ public class StatusBar extends SystemUI implements DemoMode,
|
||||
mScrimController.transitionTo(ScrimState.AOD);
|
||||
} else if (mIsKeyguard && !unlocking) {
|
||||
mScrimController.transitionTo(ScrimState.KEYGUARD);
|
||||
} else if (mBubbleController.isStackExpanded()) {
|
||||
} else if (mBubblesOptional.isPresent() && mBubblesOptional.get().isStackExpanded()) {
|
||||
mScrimController.transitionTo(ScrimState.BUBBLE_EXPANDED, mUnlockScrimCallback);
|
||||
} else {
|
||||
mScrimController.transitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback);
|
||||
|
||||
@@ -48,7 +48,7 @@ import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.systemui.ActivityIntentHelper;
|
||||
import com.android.systemui.EventLogTags;
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.dagger.qualifiers.UiBackground;
|
||||
@@ -77,6 +77,7 @@ import com.android.systemui.statusbar.notification.row.OnUserInteractionCallback
|
||||
import com.android.systemui.statusbar.policy.HeadsUpUtil;
|
||||
import com.android.systemui.statusbar.policy.KeyguardStateController;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -103,7 +104,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
|
||||
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
|
||||
private final KeyguardManager mKeyguardManager;
|
||||
private final IDreamManager mDreamManager;
|
||||
private final BubbleController mBubbleController;
|
||||
private final Optional<Bubbles> mBubblesOptional;
|
||||
private final Lazy<AssistManager> mAssistManagerLazy;
|
||||
private final NotificationRemoteInputManager mRemoteInputManager;
|
||||
private final GroupMembershipManager mGroupMembershipManager;
|
||||
@@ -141,7 +142,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
|
||||
StatusBarKeyguardViewManager statusBarKeyguardViewManager,
|
||||
KeyguardManager keyguardManager,
|
||||
IDreamManager dreamManager,
|
||||
BubbleController bubbleController,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
Lazy<AssistManager> assistManagerLazy,
|
||||
NotificationRemoteInputManager remoteInputManager,
|
||||
GroupMembershipManager groupMembershipManager,
|
||||
@@ -175,7 +176,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
|
||||
mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
|
||||
mKeyguardManager = keyguardManager;
|
||||
mDreamManager = dreamManager;
|
||||
mBubbleController = bubbleController;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
mAssistManagerLazy = assistManagerLazy;
|
||||
mRemoteInputManager = remoteInputManager;
|
||||
mGroupMembershipManager = groupMembershipManager;
|
||||
@@ -386,11 +387,14 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
|
||||
}
|
||||
|
||||
private void expandBubbleStackOnMainThread(NotificationEntry entry) {
|
||||
if (!mBubblesOptional.isPresent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (Looper.getMainLooper().isCurrentThread()) {
|
||||
mBubbleController.expandStackAndSelectBubble(entry);
|
||||
mBubblesOptional.get().expandStackAndSelectBubble(entry);
|
||||
} else {
|
||||
mMainThreadHandler.post(
|
||||
() -> mBubbleController.expandStackAndSelectBubble(entry));
|
||||
mMainThreadHandler.post(() -> mBubblesOptional.get().expandStackAndSelectBubble(entry));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -602,7 +606,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
|
||||
private final StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;
|
||||
private final KeyguardManager mKeyguardManager;
|
||||
private final IDreamManager mDreamManager;
|
||||
private final BubbleController mBubbleController;
|
||||
private final Optional<Bubbles> mBubblesOptional;
|
||||
private final Lazy<AssistManager> mAssistManagerLazy;
|
||||
private final NotificationRemoteInputManager mRemoteInputManager;
|
||||
private final GroupMembershipManager mGroupMembershipManager;
|
||||
@@ -639,7 +643,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
|
||||
StatusBarKeyguardViewManager statusBarKeyguardViewManager,
|
||||
KeyguardManager keyguardManager,
|
||||
IDreamManager dreamManager,
|
||||
BubbleController bubbleController,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
Lazy<AssistManager> assistManagerLazy,
|
||||
NotificationRemoteInputManager remoteInputManager,
|
||||
GroupMembershipManager groupMembershipManager,
|
||||
@@ -669,7 +673,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
|
||||
mStatusBarKeyguardViewManager = statusBarKeyguardViewManager;
|
||||
mKeyguardManager = keyguardManager;
|
||||
mDreamManager = dreamManager;
|
||||
mBubbleController = bubbleController;
|
||||
mBubblesOptional = bubblesOptional;
|
||||
mAssistManagerLazy = assistManagerLazy;
|
||||
mRemoteInputManager = remoteInputManager;
|
||||
mGroupMembershipManager = groupMembershipManager;
|
||||
@@ -725,7 +729,7 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
|
||||
mStatusBarKeyguardViewManager,
|
||||
mKeyguardManager,
|
||||
mDreamManager,
|
||||
mBubbleController,
|
||||
mBubblesOptional,
|
||||
mAssistManagerLazy,
|
||||
mRemoteInputManager,
|
||||
mGroupMembershipManager,
|
||||
@@ -736,12 +740,10 @@ public class StatusBarNotificationActivityStarter implements NotificationActivit
|
||||
mLockPatternUtils,
|
||||
mRemoteInputCallback,
|
||||
mActivityIntentHelper,
|
||||
|
||||
mFeatureFlags,
|
||||
mMetricsLogger,
|
||||
mLogger,
|
||||
mOnUserInteractionCallback,
|
||||
|
||||
mStatusBar,
|
||||
mNotificationPresenter,
|
||||
mNotificationPanelViewController,
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.android.keyguard.ViewMediatorCallback;
|
||||
import com.android.systemui.InitController;
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dagger.qualifiers.UiBackground;
|
||||
@@ -156,7 +156,7 @@ public interface StatusBarPhoneModule {
|
||||
WakefulnessLifecycle wakefulnessLifecycle,
|
||||
SysuiStatusBarStateController statusBarStateController,
|
||||
VibratorHelper vibratorHelper,
|
||||
BubbleController bubbleController,
|
||||
Optional<Bubbles> bubblesOptional,
|
||||
VisualStabilityManager visualStabilityManager,
|
||||
DeviceProvisionedController deviceProvisionedController,
|
||||
NavigationBarController navigationBarController,
|
||||
@@ -235,7 +235,7 @@ public interface StatusBarPhoneModule {
|
||||
wakefulnessLifecycle,
|
||||
statusBarStateController,
|
||||
vibratorHelper,
|
||||
bubbleController,
|
||||
bubblesOptional,
|
||||
visualStabilityManager,
|
||||
deviceProvisionedController,
|
||||
navigationBarController,
|
||||
|
||||
@@ -23,6 +23,7 @@ import android.util.DisplayMetrics;
|
||||
import android.view.IWindowManager;
|
||||
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.dagger.SysUISingleton;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.pip.Pip;
|
||||
@@ -117,6 +118,9 @@ public abstract class WMShellBaseModule {
|
||||
@BindsOptionalOf
|
||||
abstract SplitScreen optionalSplitScreen();
|
||||
|
||||
@BindsOptionalOf
|
||||
abstract Bubbles optionalBubbles();
|
||||
|
||||
@BindsOptionalOf
|
||||
abstract OneHanded optionalOneHanded();
|
||||
}
|
||||
|
||||
@@ -53,8 +53,7 @@ import androidx.test.filters.SmallTest;
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.navigationbar.buttons.KeyButtonView;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.recents.OverviewProxyService;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -71,7 +70,7 @@ public class KeyButtonViewTest extends SysuiTestCase {
|
||||
|
||||
private KeyButtonView mKeyButtonView;
|
||||
private MetricsLogger mMetricsLogger;
|
||||
private BubbleController mBubbleController;
|
||||
private Bubbles mBubbles;
|
||||
private UiEventLogger mUiEventLogger;
|
||||
private InputManager mInputManager = mock(InputManager.class);
|
||||
@Captor
|
||||
@@ -81,7 +80,7 @@ public class KeyButtonViewTest extends SysuiTestCase {
|
||||
public void setup() throws Exception {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mMetricsLogger = mDependency.injectMockDependency(MetricsLogger.class);
|
||||
mBubbleController = mDependency.injectMockDependency(BubbleController.class);
|
||||
mBubbles = mDependency.injectMockDependency(Bubbles.class);
|
||||
mDependency.injectMockDependency(OverviewProxyService.class);
|
||||
mUiEventLogger = mDependency.injectMockDependency(UiEventLogger.class);
|
||||
|
||||
@@ -155,7 +154,7 @@ public class KeyButtonViewTest extends SysuiTestCase {
|
||||
|
||||
@Test
|
||||
public void testBubbleEvents_bubbleExpanded() {
|
||||
when(mBubbleController.getExpandedDisplayId(mContext)).thenReturn(3);
|
||||
when(mBubbles.getExpandedDisplayId(mContext)).thenReturn(3);
|
||||
|
||||
int action = KeyEvent.ACTION_DOWN;
|
||||
int flags = 0;
|
||||
|
||||
@@ -36,7 +36,7 @@ import android.widget.LinearLayout;
|
||||
import androidx.test.filters.SmallTest;
|
||||
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.plugins.statusbar.NotificationSwipeActionHelper;
|
||||
import com.android.systemui.statusbar.notification.AssistantFeedbackController;
|
||||
import com.android.systemui.statusbar.notification.DynamicChildBindController;
|
||||
@@ -65,6 +65,7 @@ import org.mockito.MockitoAnnotations;
|
||||
import org.mockito.Spy;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
@SmallTest
|
||||
@RunWith(AndroidTestingRunner.class)
|
||||
@@ -106,7 +107,7 @@ public class NotificationViewHierarchyManagerTest extends SysuiTestCase {
|
||||
mHandler, mLockscreenUserManager, mGroupManager, mVisualStabilityManager,
|
||||
mock(StatusBarStateControllerImpl.class), mEntryManager,
|
||||
mock(KeyguardBypassController.class),
|
||||
mock(BubbleController.class),
|
||||
Optional.of(mock(Bubbles.class)),
|
||||
mock(DynamicPrivacyController.class),
|
||||
mock(ForegroundServiceSectionController.class),
|
||||
mock(DynamicChildBindController.class),
|
||||
|
||||
@@ -42,6 +42,7 @@ import androidx.test.filters.SmallTest;
|
||||
|
||||
import com.android.systemui.ForegroundServiceController;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.media.MediaFeatureFlag;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
@@ -61,6 +62,8 @@ import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@SmallTest
|
||||
@RunWith(AndroidTestingRunner.class)
|
||||
@RunWithLooper
|
||||
@@ -112,7 +115,8 @@ public class NotificationFilterTest extends SysuiTestCase {
|
||||
mDependency.injectTestDependency(NotificationGroupManagerLegacy.class,
|
||||
new NotificationGroupManagerLegacy(
|
||||
mock(StatusBarStateController.class),
|
||||
() -> mock(PeopleNotificationIdentifier.class)));
|
||||
() -> mock(PeopleNotificationIdentifier.class),
|
||||
Optional.of(() -> mock(Bubbles.class))));
|
||||
mDependency.injectMockDependency(ShadeController.class);
|
||||
mDependency.injectMockDependency(NotificationLockscreenUserManager.class);
|
||||
mDependency.injectTestDependency(KeyguardEnvironment.class, mEnvironment);
|
||||
|
||||
@@ -46,7 +46,6 @@ import androidx.test.filters.SmallTest;
|
||||
|
||||
import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
import com.android.systemui.statusbar.notification.collection.render.GroupMembershipManager;
|
||||
@@ -78,7 +77,6 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase {
|
||||
public void setUp() {
|
||||
allowTestableLooperAsMainThread();
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mDependency.injectMockDependency(BubbleController.class);
|
||||
when(mGutsManager.openGuts(
|
||||
any(View.class),
|
||||
anyInt(),
|
||||
@@ -86,7 +84,6 @@ public class NotificationBlockingHelperManagerTest extends SysuiTestCase {
|
||||
any(NotificationMenuRowPlugin.MenuItem.class)))
|
||||
.thenReturn(true);
|
||||
when(mMenuRow.getLongpressMenuItem(any(Context.class))).thenReturn(mMenuItem);
|
||||
mDependency.injectMockDependency(BubbleController.class);
|
||||
|
||||
mHelper = new NotificationTestHelper(mContext, mDependency, TestableLooper.get(this));
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ import com.android.settingslib.notification.ConversationIconFactory;
|
||||
import com.android.systemui.Prefs;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.bubbles.BubblesTestActivity;
|
||||
import com.android.systemui.statusbar.SbnBuilder;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
@@ -97,6 +97,7 @@ import org.mockito.stubbing.Answer;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import javax.inject.Provider;
|
||||
@@ -136,7 +137,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
@Mock
|
||||
private OnUserInteractionCallback mOnUserInteractionCallback;
|
||||
@Mock
|
||||
private BubbleController mBubbleController;
|
||||
private Bubbles mBubbles;
|
||||
@Mock
|
||||
private LauncherApps mLauncherApps;
|
||||
@Mock
|
||||
@@ -161,7 +162,6 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
|
||||
mTestHandler = new Handler(mTestableLooper.getLooper());
|
||||
mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger);
|
||||
mDependency.injectTestDependency(BubbleController.class, mBubbleController);
|
||||
mDependency.injectTestDependency(ShadeController.class, mShadeController);
|
||||
// Inflate the layout
|
||||
final LayoutInflater layoutInflater = LayoutInflater.from(mContext);
|
||||
@@ -255,7 +255,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
final ImageView view = mNotificationInfo.findViewById(R.id.conversation_icon);
|
||||
assertEquals(mIconDrawable, view.getDrawable());
|
||||
}
|
||||
@@ -279,7 +279,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
final TextView textView = mNotificationInfo.findViewById(R.id.pkg_name);
|
||||
assertTrue(textView.getText().toString().contains("App Name"));
|
||||
assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.header).getVisibility());
|
||||
@@ -330,7 +330,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
final TextView textView = mNotificationInfo.findViewById(R.id.group_name);
|
||||
assertTrue(textView.getText().toString().contains(group.getName()));
|
||||
assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.header).getVisibility());
|
||||
@@ -355,7 +355,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
final TextView textView = mNotificationInfo.findViewById(R.id.group_name);
|
||||
assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.header).getVisibility());
|
||||
assertEquals(GONE, textView.getVisibility());
|
||||
@@ -379,7 +379,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
final TextView nameView = mNotificationInfo.findViewById(R.id.delegate_name);
|
||||
assertEquals(GONE, nameView.getVisibility());
|
||||
}
|
||||
@@ -414,7 +414,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
final TextView nameView = mNotificationInfo.findViewById(R.id.delegate_name);
|
||||
assertEquals(VISIBLE, nameView.getVisibility());
|
||||
assertTrue(nameView.getText().toString().contains("Proxied"));
|
||||
@@ -442,7 +442,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
final View settingsButton = mNotificationInfo.findViewById(R.id.info);
|
||||
settingsButton.performClick();
|
||||
@@ -468,7 +468,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
final View settingsButton = mNotificationInfo.findViewById(R.id.info);
|
||||
assertTrue(settingsButton.getVisibility() != View.VISIBLE);
|
||||
}
|
||||
@@ -495,7 +495,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
false,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
final View settingsButton = mNotificationInfo.findViewById(R.id.info);
|
||||
assertTrue(settingsButton.getVisibility() != View.VISIBLE);
|
||||
}
|
||||
@@ -520,7 +520,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
View view = mNotificationInfo.findViewById(R.id.silence);
|
||||
assertThat(view.isSelected()).isTrue();
|
||||
}
|
||||
@@ -548,7 +548,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
View view = mNotificationInfo.findViewById(R.id.default_behavior);
|
||||
assertThat(view.isSelected()).isTrue();
|
||||
assertThat(((TextView) view.findViewById(R.id.default_summary)).getText()).isEqualTo(
|
||||
@@ -579,7 +579,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
View view = mNotificationInfo.findViewById(R.id.default_behavior);
|
||||
assertThat(view.isSelected()).isTrue();
|
||||
assertThat(((TextView) view.findViewById(R.id.default_summary)).getText()).isEqualTo(
|
||||
@@ -609,7 +609,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
View fave = mNotificationInfo.findViewById(R.id.priority);
|
||||
fave.performClick();
|
||||
@@ -653,7 +653,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
||||
mTestableLooper.processAllMessages();
|
||||
@@ -696,7 +696,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
View silence = mNotificationInfo.findViewById(R.id.silence);
|
||||
|
||||
@@ -740,7 +740,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
View fave = mNotificationInfo.findViewById(R.id.priority);
|
||||
fave.performClick();
|
||||
@@ -777,7 +777,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
View fave = mNotificationInfo.findViewById(R.id.priority);
|
||||
fave.performClick();
|
||||
@@ -813,7 +813,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
View fave = mNotificationInfo.findViewById(R.id.priority);
|
||||
fave.performClick();
|
||||
@@ -851,7 +851,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||
@@ -887,7 +887,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||
@@ -923,7 +923,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||
@@ -958,7 +958,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
View silence = mNotificationInfo.findViewById(R.id.silence);
|
||||
silence.performClick();
|
||||
@@ -992,7 +992,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
verify(mMockINotificationManager, times(1)).createConversationNotificationChannelForPackage(
|
||||
anyString(), anyInt(), anyString(), any(), eq(CONVERSATION_ID));
|
||||
@@ -1017,7 +1017,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
mBuilderProvider,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
verify(mMockINotificationManager, never()).createConversationNotificationChannelForPackage(
|
||||
anyString(), anyInt(), anyString(), any(), eq(CONVERSATION_ID));
|
||||
@@ -1052,7 +1052,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
() -> b,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
// WHEN user clicks "priority"
|
||||
mNotificationInfo.setSelectedAction(NotificationConversationInfo.ACTION_FAVORITE);
|
||||
@@ -1092,7 +1092,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
||||
() -> b,
|
||||
true,
|
||||
mTestHandler,
|
||||
mTestHandler, null, mBubbleController);
|
||||
mTestHandler, null, Optional.of(mBubbles));
|
||||
|
||||
// WHEN user clicks "priority"
|
||||
mNotificationInfo.setSelectedAction(NotificationConversationInfo.ACTION_FAVORITE);
|
||||
|
||||
@@ -67,7 +67,7 @@ import com.android.internal.logging.MetricsLogger;
|
||||
import com.android.internal.logging.UiEventLogger;
|
||||
import com.android.internal.logging.testing.UiEventLoggerFake;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||
import com.android.systemui.settings.UserContextProvider;
|
||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||
@@ -93,6 +93,8 @@ import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnit;
|
||||
import org.mockito.junit.MockitoRule;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import javax.inject.Provider;
|
||||
|
||||
/**
|
||||
@@ -129,7 +131,7 @@ public class NotificationGutsManagerTest extends SysuiTestCase {
|
||||
@Mock private ChannelEditorDialogController mChannelEditorDialogController;
|
||||
@Mock private PeopleNotificationIdentifier mPeopleNotificationIdentifier;
|
||||
@Mock private UserContextProvider mContextTracker;
|
||||
@Mock private BubbleController mBubbleController;
|
||||
@Mock private Bubbles mBubbles;
|
||||
@Mock(answer = Answers.RETURNS_SELF)
|
||||
private PriorityOnboardingDialogController.Builder mBuilder;
|
||||
private Provider<PriorityOnboardingDialogController.Builder> mProvider = () -> mBuilder;
|
||||
@@ -145,7 +147,6 @@ public class NotificationGutsManagerTest extends SysuiTestCase {
|
||||
mDependency.injectTestDependency(
|
||||
OnUserInteractionCallback.class,
|
||||
mOnUserInteractionCallback);
|
||||
mDependency.injectTestDependency(BubbleController.class, mBubbleController);
|
||||
mDependency.injectMockDependency(NotificationLockscreenUserManager.class);
|
||||
mHandler = Handler.createAsync(mTestableLooper.getLooper());
|
||||
mHelper = new NotificationTestHelper(mContext, mDependency, TestableLooper.get(this));
|
||||
@@ -155,7 +156,7 @@ public class NotificationGutsManagerTest extends SysuiTestCase {
|
||||
() -> mStatusBar, mHandler, mHandler, mAccessibilityManager, mHighPriorityProvider,
|
||||
mINotificationManager, mLauncherApps, mShortcutManager,
|
||||
mChannelEditorDialogController, mContextTracker, mProvider,
|
||||
mAssistantFeedbackController, mBubbleController,
|
||||
mAssistantFeedbackController, Optional.of(mBubbles),
|
||||
new UiEventLoggerFake(), mOnUserInteractionCallback);
|
||||
mGutsManager.setUpWithPresenter(mPresenter, mNotificationListContainer,
|
||||
mCheckSaveListener, mOnSettingsClickListener);
|
||||
|
||||
@@ -45,7 +45,7 @@ import android.widget.RemoteViews;
|
||||
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.TestableDependency;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.bubbles.BubblesTestActivity;
|
||||
import com.android.systemui.media.MediaFeatureFlag;
|
||||
import com.android.systemui.plugins.FalsingManager;
|
||||
@@ -73,6 +73,7 @@ import com.android.systemui.statusbar.policy.SmartReplyConstants;
|
||||
|
||||
import org.mockito.ArgumentCaptor;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@@ -114,12 +115,12 @@ public class NotificationTestHelper {
|
||||
mContext = context;
|
||||
mTestLooper = testLooper;
|
||||
dependency.injectMockDependency(NotificationMediaManager.class);
|
||||
dependency.injectMockDependency(BubbleController.class);
|
||||
dependency.injectMockDependency(NotificationShadeWindowController.class);
|
||||
mStatusBarStateController = mock(StatusBarStateController.class);
|
||||
mGroupMembershipManager = new NotificationGroupManagerLegacy(
|
||||
mStatusBarStateController,
|
||||
() -> mock(PeopleNotificationIdentifier.class));
|
||||
() -> mock(PeopleNotificationIdentifier.class),
|
||||
Optional.of(() -> mock(Bubbles.class)));
|
||||
mGroupExpansionManager = mGroupMembershipManager;
|
||||
mHeadsUpManager = new HeadsUpManagerPhone(mContext, mStatusBarStateController,
|
||||
mock(KeyguardBypassController.class), mock(NotificationGroupManagerLegacy.class),
|
||||
|
||||
@@ -29,7 +29,6 @@ import android.view.View;
|
||||
|
||||
import androidx.test.filters.SmallTest;
|
||||
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.AlertingNotificationManager;
|
||||
import com.android.systemui.statusbar.AlertingNotificationManagerTest;
|
||||
@@ -95,7 +94,6 @@ public class HeadsUpManagerPhoneTest extends AlertingNotificationManagerTest {
|
||||
when(accessibilityMgr.getRecommendedTimeoutMillis(anyInt(), anyInt()))
|
||||
.thenReturn(TEST_AUTO_DISMISS_TIME);
|
||||
when(mVSManager.isReorderingAllowed()).thenReturn(true);
|
||||
mDependency.injectMockDependency(BubbleController.class);
|
||||
mDependency.injectMockDependency(NotificationShadeWindowController.class);
|
||||
mDependency.injectMockDependency(ConfigurationController.class);
|
||||
mHeadsUpManager = new TestableHeadsUpManagerPhone(mContext, mGroupManager, mVSManager,
|
||||
|
||||
@@ -37,7 +37,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.bubbles.Bubbles;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryListener;
|
||||
import com.android.systemui.statusbar.notification.NotificationEntryManager;
|
||||
@@ -61,6 +61,7 @@ import org.mockito.junit.MockitoJUnit;
|
||||
import org.mockito.junit.MockitoRule;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Optional;
|
||||
|
||||
@SmallTest
|
||||
@RunWith(AndroidTestingRunner.class)
|
||||
@@ -83,7 +84,6 @@ public class NotificationGroupAlertTransferHelperTest extends SysuiTestCase {
|
||||
@Before
|
||||
public void setup() {
|
||||
MockitoAnnotations.initMocks(this);
|
||||
mDependency.injectMockDependency(BubbleController.class);
|
||||
mHeadsUpManager = new HeadsUpManager(mContext) {};
|
||||
|
||||
when(mNotificationEntryManager.getPendingNotificationsIterator())
|
||||
@@ -91,7 +91,8 @@ public class NotificationGroupAlertTransferHelperTest extends SysuiTestCase {
|
||||
|
||||
mGroupManager = new NotificationGroupManagerLegacy(
|
||||
mock(StatusBarStateController.class),
|
||||
() -> mock(PeopleNotificationIdentifier.class));
|
||||
() -> mock(PeopleNotificationIdentifier.class),
|
||||
Optional.of(() -> mock(Bubbles.class)));
|
||||
mDependency.injectTestDependency(NotificationGroupManagerLegacy.class, mGroupManager);
|
||||
mGroupManager.setHeadsUpManager(mHeadsUpManager);
|
||||
|
||||
|
||||
@@ -30,7 +30,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.bubbles.Bubbles;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.notification.collection.NotificationEntry;
|
||||
import com.android.systemui.statusbar.notification.collection.legacy.NotificationGroupManagerLegacy;
|
||||
@@ -45,6 +45,8 @@ import org.mockito.Mock;
|
||||
import org.mockito.junit.MockitoJUnit;
|
||||
import org.mockito.junit.MockitoRule;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@SmallTest
|
||||
@RunWith(AndroidTestingRunner.class)
|
||||
@TestableLooper.RunWithLooper
|
||||
@@ -60,14 +62,15 @@ public class NotificationGroupManagerLegacyTest extends SysuiTestCase {
|
||||
|
||||
@Before
|
||||
public void setup() {
|
||||
mDependency.injectMockDependency(BubbleController.class);
|
||||
mDependency.injectMockDependency(Bubbles.class);
|
||||
initializeGroupManager();
|
||||
}
|
||||
|
||||
private void initializeGroupManager() {
|
||||
mGroupManager = new NotificationGroupManagerLegacy(
|
||||
mock(StatusBarStateController.class),
|
||||
() -> mock(PeopleNotificationIdentifier.class));
|
||||
() -> mock(PeopleNotificationIdentifier.class),
|
||||
Optional.of(() -> mock(Bubbles.class)));
|
||||
mGroupManager.setHeadsUpManager(mHeadsUpManager);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,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.bubbles.Bubbles;
|
||||
import com.android.systemui.demomode.DemoModeController;
|
||||
import com.android.systemui.plugins.DarkIconDispatcher;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
@@ -41,6 +41,8 @@ import org.junit.runner.RunWith;
|
||||
import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@SmallTest
|
||||
@RunWith(AndroidTestingRunner.class)
|
||||
@TestableLooper.RunWithLooper
|
||||
@@ -66,7 +68,7 @@ public class NotificationIconAreaControllerTest extends SysuiTestCase {
|
||||
StatusBarWindowController mStatusBarWindowController;
|
||||
private NotificationIconAreaController mController;
|
||||
@Mock
|
||||
private BubbleController mBubbleController;
|
||||
private Bubbles mBubbles;
|
||||
@Mock private DemoModeController mDemoModeController;
|
||||
@Mock
|
||||
private NotificationIconContainer mAodIcons;
|
||||
@@ -83,7 +85,7 @@ public class NotificationIconAreaControllerTest extends SysuiTestCase {
|
||||
mNotificationMediaManager,
|
||||
mListener,
|
||||
mDozeParameters,
|
||||
mBubbleController,
|
||||
Optional.of(mBubbles),
|
||||
mDemoModeController,
|
||||
mDarkIconDispatcher,
|
||||
mStatusBarWindowController);
|
||||
|
||||
@@ -53,7 +53,7 @@ import com.android.internal.widget.LockPatternUtils;
|
||||
import com.android.systemui.ActivityIntentHelper;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||
import com.android.systemui.statusbar.CommandQueue;
|
||||
@@ -86,6 +86,7 @@ import org.mockito.MockitoAnnotations;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Optional;
|
||||
|
||||
@SmallTest
|
||||
@RunWith(AndroidTestingRunner.class)
|
||||
@@ -115,7 +116,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase {
|
||||
@Mock
|
||||
private Handler mHandler;
|
||||
@Mock
|
||||
private BubbleController mBubbleController;
|
||||
private Bubbles mBubbles;
|
||||
@Mock
|
||||
private ShadeControllerImpl mShadeController;
|
||||
@Mock
|
||||
@@ -192,7 +193,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase {
|
||||
mStatusBarKeyguardViewManager,
|
||||
mock(KeyguardManager.class),
|
||||
mock(IDreamManager.class),
|
||||
mBubbleController,
|
||||
Optional.of(mBubbles),
|
||||
() -> mAssistManager,
|
||||
mRemoteInputManager,
|
||||
mock(NotificationGroupManagerLegacy.class),
|
||||
@@ -279,7 +280,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase {
|
||||
mNotificationActivityStarter.onNotificationClicked(sbn, mBubbleNotificationRow);
|
||||
|
||||
// Then
|
||||
verify(mBubbleController).expandStackAndSelectBubble(eq(mBubbleNotificationRow.getEntry()));
|
||||
verify(mBubbles).expandStackAndSelectBubble(eq(mBubbleNotificationRow.getEntry()));
|
||||
|
||||
// This is called regardless, and simply short circuits when there is nothing to do.
|
||||
verify(mShadeController, atLeastOnce()).collapsePanel();
|
||||
@@ -311,7 +312,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase {
|
||||
mNotificationActivityStarter.onNotificationClicked(sbn, mBubbleNotificationRow);
|
||||
|
||||
// Then
|
||||
verify(mBubbleController).expandStackAndSelectBubble(mBubbleNotificationRow.getEntry());
|
||||
verify(mBubbles).expandStackAndSelectBubble(mBubbleNotificationRow.getEntry());
|
||||
|
||||
verify(mShadeController, atLeastOnce()).collapsePanel();
|
||||
|
||||
@@ -341,7 +342,7 @@ public class StatusBarNotificationActivityStarterTest extends SysuiTestCase {
|
||||
mNotificationActivityStarter.onNotificationClicked(sbn, mBubbleNotificationRow);
|
||||
|
||||
// Then
|
||||
verify(mBubbleController).expandStackAndSelectBubble(mBubbleNotificationRow.getEntry());
|
||||
verify(mBubbles).expandStackAndSelectBubble(mBubbleNotificationRow.getEntry());
|
||||
|
||||
verify(mShadeController, atLeastOnce()).collapsePanel();
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ import com.android.systemui.R;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.bubbles.BubbleController;
|
||||
import com.android.systemui.bubbles.Bubbles;
|
||||
import com.android.systemui.classifier.FalsingManagerFake;
|
||||
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
||||
import com.android.systemui.demomode.DemoModeController;
|
||||
@@ -219,7 +219,7 @@ public class StatusBarTest extends SysuiTestCase {
|
||||
@Mock private UserSwitcherController mUserSwitcherController;
|
||||
@Mock private NetworkController mNetworkController;
|
||||
@Mock private VibratorHelper mVibratorHelper;
|
||||
@Mock private BubbleController mBubbleController;
|
||||
@Mock private Bubbles mBubbles;
|
||||
@Mock private NotificationShadeWindowController mNotificationShadeWindowController;
|
||||
@Mock private NotificationIconAreaController mNotificationIconAreaController;
|
||||
@Mock private NotificationShadeWindowViewController mNotificationShadeWindowViewController;
|
||||
@@ -332,7 +332,7 @@ public class StatusBarTest extends SysuiTestCase {
|
||||
mShadeController = new ShadeControllerImpl(mCommandQueue,
|
||||
mStatusBarStateController, mNotificationShadeWindowController,
|
||||
mStatusBarKeyguardViewManager, mContext.getSystemService(WindowManager.class),
|
||||
() -> mStatusBar, () -> mAssistManager, () -> mBubbleController);
|
||||
() -> mStatusBar, () -> mAssistManager, Optional.of(() -> mBubbles));
|
||||
|
||||
mStatusBar = new StatusBar(
|
||||
mContext,
|
||||
@@ -374,7 +374,7 @@ public class StatusBarTest extends SysuiTestCase {
|
||||
wakefulnessLifecycle,
|
||||
mStatusBarStateController,
|
||||
mVibratorHelper,
|
||||
mBubbleController,
|
||||
Optional.of(mBubbles),
|
||||
mVisualStabilityManager,
|
||||
mDeviceProvisionedController,
|
||||
mNavigationBarController,
|
||||
|
||||
Reference in New Issue
Block a user