Merge "Auto-expand bubble for priority notif" into rvc-dev
This commit is contained in:
@@ -1020,6 +1020,26 @@ 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
|
||||||
|
*/
|
||||||
|
public void onUserChangedImportance(NotificationEntry entry) {
|
||||||
|
try {
|
||||||
|
int flags = Notification.BubbleMetadata.FLAG_SUPPRESS_NOTIFICATION;
|
||||||
|
flags |= Notification.BubbleMetadata.FLAG_AUTO_EXPAND_BUBBLE;
|
||||||
|
mBarService.onNotificationBubbleChanged(entry.getKey(), true, flags);
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Log.e(TAG, e.getMessage());
|
||||||
|
}
|
||||||
|
mShadeController.collapsePanel(true);
|
||||||
|
if (entry.getRow() != null) {
|
||||||
|
entry.getRow().updateBubbleButton();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Directs a back gesture at the bubble stack. When opened, the current expanded bubble
|
* Directs a back gesture at the bubble stack. When opened, the current expanded bubble
|
||||||
* is forwarded a back key down/up pair.
|
* is forwarded a back key down/up pair.
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import android.view.accessibility.AccessibilityManager;
|
|||||||
|
|
||||||
import com.android.internal.logging.MetricsLogger;
|
import com.android.internal.logging.MetricsLogger;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
import com.android.systemui.bubbles.BubbleController;
|
||||||
import com.android.systemui.dagger.qualifiers.Background;
|
import com.android.systemui.dagger.qualifiers.Background;
|
||||||
import com.android.systemui.dagger.qualifiers.Main;
|
import com.android.systemui.dagger.qualifiers.Main;
|
||||||
import com.android.systemui.dagger.qualifiers.UiBackground;
|
import com.android.systemui.dagger.qualifiers.UiBackground;
|
||||||
@@ -114,7 +115,8 @@ public interface NotificationsModule {
|
|||||||
ShortcutManager shortcutManager,
|
ShortcutManager shortcutManager,
|
||||||
ChannelEditorDialogController channelEditorDialogController,
|
ChannelEditorDialogController channelEditorDialogController,
|
||||||
CurrentUserContextTracker contextTracker,
|
CurrentUserContextTracker contextTracker,
|
||||||
Provider<PriorityOnboardingDialogController.Builder> builderProvider) {
|
Provider<PriorityOnboardingDialogController.Builder> builderProvider,
|
||||||
|
BubbleController bubbleController) {
|
||||||
return new NotificationGutsManager(
|
return new NotificationGutsManager(
|
||||||
context,
|
context,
|
||||||
visualStabilityManager,
|
visualStabilityManager,
|
||||||
@@ -128,7 +130,8 @@ public interface NotificationsModule {
|
|||||||
shortcutManager,
|
shortcutManager,
|
||||||
channelEditorDialogController,
|
channelEditorDialogController,
|
||||||
contextTracker,
|
contextTracker,
|
||||||
builderProvider);
|
builderProvider,
|
||||||
|
bubbleController);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Provides an instance of {@link VisualStabilityManager} */
|
/** Provides an instance of {@link VisualStabilityManager} */
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ import com.android.internal.annotations.VisibleForTesting;
|
|||||||
import com.android.settingslib.notification.ConversationIconFactory;
|
import com.android.settingslib.notification.ConversationIconFactory;
|
||||||
import com.android.systemui.Prefs;
|
import com.android.systemui.Prefs;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
import com.android.systemui.bubbles.BubbleController;
|
||||||
import com.android.systemui.dagger.qualifiers.Background;
|
import com.android.systemui.dagger.qualifiers.Background;
|
||||||
import com.android.systemui.dagger.qualifiers.Main;
|
import com.android.systemui.dagger.qualifiers.Main;
|
||||||
import com.android.systemui.statusbar.notification.NotificationChannelHelper;
|
import com.android.systemui.statusbar.notification.NotificationChannelHelper;
|
||||||
@@ -91,7 +92,7 @@ public class NotificationConversationInfo extends LinearLayout implements
|
|||||||
private VisualStabilityManager mVisualStabilityManager;
|
private VisualStabilityManager mVisualStabilityManager;
|
||||||
private Handler mMainHandler;
|
private Handler mMainHandler;
|
||||||
private Handler mBgHandler;
|
private Handler mBgHandler;
|
||||||
|
private BubbleController mBubbleController;
|
||||||
private String mPackageName;
|
private String mPackageName;
|
||||||
private String mAppName;
|
private String mAppName;
|
||||||
private int mAppUid;
|
private int mAppUid;
|
||||||
@@ -219,7 +220,8 @@ public class NotificationConversationInfo extends LinearLayout implements
|
|||||||
boolean isDeviceProvisioned,
|
boolean isDeviceProvisioned,
|
||||||
@Main Handler mainHandler,
|
@Main Handler mainHandler,
|
||||||
@Background Handler bgHandler,
|
@Background Handler bgHandler,
|
||||||
OnConversationSettingsClickListener onConversationSettingsClickListener) {
|
OnConversationSettingsClickListener onConversationSettingsClickListener,
|
||||||
|
BubbleController bubbleController) {
|
||||||
mSelectedAction = -1;
|
mSelectedAction = -1;
|
||||||
mINotificationManager = iNotificationManager;
|
mINotificationManager = iNotificationManager;
|
||||||
mVisualStabilityManager = visualStabilityManager;
|
mVisualStabilityManager = visualStabilityManager;
|
||||||
@@ -238,6 +240,7 @@ public class NotificationConversationInfo extends LinearLayout implements
|
|||||||
mIconFactory = conversationIconFactory;
|
mIconFactory = conversationIconFactory;
|
||||||
mUserContext = userContext;
|
mUserContext = userContext;
|
||||||
mBubbleMetadata = bubbleMetadata;
|
mBubbleMetadata = bubbleMetadata;
|
||||||
|
mBubbleController = bubbleController;
|
||||||
mBuilderProvider = builderProvider;
|
mBuilderProvider = builderProvider;
|
||||||
mMainHandler = mainHandler;
|
mMainHandler = mainHandler;
|
||||||
mBgHandler = bgHandler;
|
mBgHandler = bgHandler;
|
||||||
@@ -627,6 +630,9 @@ public class NotificationConversationInfo extends LinearLayout implements
|
|||||||
mINotificationManager.setBubblesAllowed(mAppPkg, mAppUid,
|
mINotificationManager.setBubblesAllowed(mAppPkg, mAppUid,
|
||||||
BUBBLE_PREFERENCE_SELECTED);
|
BUBBLE_PREFERENCE_SELECTED);
|
||||||
}
|
}
|
||||||
|
post(() -> {
|
||||||
|
mBubbleController.onUserChangedImportance(mEntry);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
mChannelToUpdate.setImportance(Math.max(
|
mChannelToUpdate.setImportance(Math.max(
|
||||||
mChannelToUpdate.getOriginalImportance(), IMPORTANCE_DEFAULT));
|
mChannelToUpdate.getOriginalImportance(), IMPORTANCE_DEFAULT));
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ import com.android.settingslib.notification.ConversationIconFactory;
|
|||||||
import com.android.systemui.Dependency;
|
import com.android.systemui.Dependency;
|
||||||
import com.android.systemui.Dumpable;
|
import com.android.systemui.Dumpable;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
|
import com.android.systemui.bubbles.BubbleController;
|
||||||
import com.android.systemui.dagger.qualifiers.Background;
|
import com.android.systemui.dagger.qualifiers.Background;
|
||||||
import com.android.systemui.dagger.qualifiers.Main;
|
import com.android.systemui.dagger.qualifiers.Main;
|
||||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||||
@@ -113,6 +114,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
|||||||
private final Lazy<StatusBar> mStatusBarLazy;
|
private final Lazy<StatusBar> mStatusBarLazy;
|
||||||
private final Handler mMainHandler;
|
private final Handler mMainHandler;
|
||||||
private final Handler mBgHandler;
|
private final Handler mBgHandler;
|
||||||
|
private final BubbleController mBubbleController;
|
||||||
private Runnable mOpenRunnable;
|
private Runnable mOpenRunnable;
|
||||||
private final INotificationManager mNotificationManager;
|
private final INotificationManager mNotificationManager;
|
||||||
private final LauncherApps mLauncherApps;
|
private final LauncherApps mLauncherApps;
|
||||||
@@ -132,7 +134,8 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
|||||||
ShortcutManager shortcutManager,
|
ShortcutManager shortcutManager,
|
||||||
ChannelEditorDialogController channelEditorDialogController,
|
ChannelEditorDialogController channelEditorDialogController,
|
||||||
CurrentUserContextTracker contextTracker,
|
CurrentUserContextTracker contextTracker,
|
||||||
Provider<PriorityOnboardingDialogController.Builder> builderProvider) {
|
Provider<PriorityOnboardingDialogController.Builder> builderProvider,
|
||||||
|
BubbleController bubbleController) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mVisualStabilityManager = visualStabilityManager;
|
mVisualStabilityManager = visualStabilityManager;
|
||||||
mStatusBarLazy = statusBarLazy;
|
mStatusBarLazy = statusBarLazy;
|
||||||
@@ -146,6 +149,7 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
|||||||
mContextTracker = contextTracker;
|
mContextTracker = contextTracker;
|
||||||
mBuilderProvider = builderProvider;
|
mBuilderProvider = builderProvider;
|
||||||
mChannelEditorDialogController = channelEditorDialogController;
|
mChannelEditorDialogController = channelEditorDialogController;
|
||||||
|
mBubbleController = bubbleController;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUpWithPresenter(NotificationPresenter presenter,
|
public void setUpWithPresenter(NotificationPresenter presenter,
|
||||||
@@ -480,7 +484,8 @@ public class NotificationGutsManager implements Dumpable, NotificationLifetimeEx
|
|||||||
mDeviceProvisionedController.isDeviceProvisioned(),
|
mDeviceProvisionedController.isDeviceProvisioned(),
|
||||||
mMainHandler,
|
mMainHandler,
|
||||||
mBgHandler,
|
mBgHandler,
|
||||||
onConversationSettingsListener);
|
onConversationSettingsListener,
|
||||||
|
mBubbleController);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
final ImageView view = mNotificationInfo.findViewById(R.id.conversation_icon);
|
final ImageView view = mNotificationInfo.findViewById(R.id.conversation_icon);
|
||||||
assertEquals(mIconDrawable, view.getDrawable());
|
assertEquals(mIconDrawable, view.getDrawable());
|
||||||
}
|
}
|
||||||
@@ -280,7 +280,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
final TextView textView = mNotificationInfo.findViewById(R.id.pkg_name);
|
final TextView textView = mNotificationInfo.findViewById(R.id.pkg_name);
|
||||||
assertTrue(textView.getText().toString().contains("App Name"));
|
assertTrue(textView.getText().toString().contains("App Name"));
|
||||||
assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.header).getVisibility());
|
assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.header).getVisibility());
|
||||||
@@ -331,7 +331,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
final TextView textView = mNotificationInfo.findViewById(R.id.group_name);
|
final TextView textView = mNotificationInfo.findViewById(R.id.group_name);
|
||||||
assertTrue(textView.getText().toString().contains(group.getName()));
|
assertTrue(textView.getText().toString().contains(group.getName()));
|
||||||
assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.header).getVisibility());
|
assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.header).getVisibility());
|
||||||
@@ -356,7 +356,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
final TextView textView = mNotificationInfo.findViewById(R.id.group_name);
|
final TextView textView = mNotificationInfo.findViewById(R.id.group_name);
|
||||||
assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.header).getVisibility());
|
assertEquals(VISIBLE, mNotificationInfo.findViewById(R.id.header).getVisibility());
|
||||||
assertEquals(GONE, textView.getVisibility());
|
assertEquals(GONE, textView.getVisibility());
|
||||||
@@ -380,7 +380,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
final TextView nameView = mNotificationInfo.findViewById(R.id.delegate_name);
|
final TextView nameView = mNotificationInfo.findViewById(R.id.delegate_name);
|
||||||
assertEquals(GONE, nameView.getVisibility());
|
assertEquals(GONE, nameView.getVisibility());
|
||||||
}
|
}
|
||||||
@@ -415,7 +415,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
final TextView nameView = mNotificationInfo.findViewById(R.id.delegate_name);
|
final TextView nameView = mNotificationInfo.findViewById(R.id.delegate_name);
|
||||||
assertEquals(VISIBLE, nameView.getVisibility());
|
assertEquals(VISIBLE, nameView.getVisibility());
|
||||||
assertTrue(nameView.getText().toString().contains("Proxied"));
|
assertTrue(nameView.getText().toString().contains("Proxied"));
|
||||||
@@ -443,7 +443,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
final View settingsButton = mNotificationInfo.findViewById(R.id.info);
|
final View settingsButton = mNotificationInfo.findViewById(R.id.info);
|
||||||
settingsButton.performClick();
|
settingsButton.performClick();
|
||||||
@@ -469,7 +469,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
final View settingsButton = mNotificationInfo.findViewById(R.id.info);
|
final View settingsButton = mNotificationInfo.findViewById(R.id.info);
|
||||||
assertTrue(settingsButton.getVisibility() != View.VISIBLE);
|
assertTrue(settingsButton.getVisibility() != View.VISIBLE);
|
||||||
}
|
}
|
||||||
@@ -496,7 +496,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
false,
|
false,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
final View settingsButton = mNotificationInfo.findViewById(R.id.info);
|
final View settingsButton = mNotificationInfo.findViewById(R.id.info);
|
||||||
assertTrue(settingsButton.getVisibility() != View.VISIBLE);
|
assertTrue(settingsButton.getVisibility() != View.VISIBLE);
|
||||||
}
|
}
|
||||||
@@ -521,7 +521,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
View view = mNotificationInfo.findViewById(R.id.silence);
|
View view = mNotificationInfo.findViewById(R.id.silence);
|
||||||
assertThat(view.isSelected()).isTrue();
|
assertThat(view.isSelected()).isTrue();
|
||||||
}
|
}
|
||||||
@@ -549,7 +549,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
View view = mNotificationInfo.findViewById(R.id.default_behavior);
|
View view = mNotificationInfo.findViewById(R.id.default_behavior);
|
||||||
assertThat(view.isSelected()).isTrue();
|
assertThat(view.isSelected()).isTrue();
|
||||||
assertThat(((TextView) view.findViewById(R.id.default_summary)).getText()).isEqualTo(
|
assertThat(((TextView) view.findViewById(R.id.default_summary)).getText()).isEqualTo(
|
||||||
@@ -580,7 +580,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
View view = mNotificationInfo.findViewById(R.id.default_behavior);
|
View view = mNotificationInfo.findViewById(R.id.default_behavior);
|
||||||
assertThat(view.isSelected()).isTrue();
|
assertThat(view.isSelected()).isTrue();
|
||||||
assertThat(((TextView) view.findViewById(R.id.default_summary)).getText()).isEqualTo(
|
assertThat(((TextView) view.findViewById(R.id.default_summary)).getText()).isEqualTo(
|
||||||
@@ -610,7 +610,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
View fave = mNotificationInfo.findViewById(R.id.priority);
|
View fave = mNotificationInfo.findViewById(R.id.priority);
|
||||||
fave.performClick();
|
fave.performClick();
|
||||||
@@ -654,7 +654,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
||||||
mTestableLooper.processAllMessages();
|
mTestableLooper.processAllMessages();
|
||||||
@@ -697,7 +697,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
View silence = mNotificationInfo.findViewById(R.id.silence);
|
View silence = mNotificationInfo.findViewById(R.id.silence);
|
||||||
|
|
||||||
@@ -741,7 +741,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
View fave = mNotificationInfo.findViewById(R.id.priority);
|
View fave = mNotificationInfo.findViewById(R.id.priority);
|
||||||
fave.performClick();
|
fave.performClick();
|
||||||
@@ -778,7 +778,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
View fave = mNotificationInfo.findViewById(R.id.priority);
|
View fave = mNotificationInfo.findViewById(R.id.priority);
|
||||||
fave.performClick();
|
fave.performClick();
|
||||||
@@ -814,7 +814,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
View fave = mNotificationInfo.findViewById(R.id.priority);
|
View fave = mNotificationInfo.findViewById(R.id.priority);
|
||||||
fave.performClick();
|
fave.performClick();
|
||||||
@@ -852,7 +852,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
||||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
@@ -888,7 +888,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
||||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
@@ -924,7 +924,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
mNotificationInfo.findViewById(R.id.default_behavior).performClick();
|
||||||
mNotificationInfo.findViewById(R.id.done).performClick();
|
mNotificationInfo.findViewById(R.id.done).performClick();
|
||||||
@@ -959,7 +959,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
View silence = mNotificationInfo.findViewById(R.id.silence);
|
View silence = mNotificationInfo.findViewById(R.id.silence);
|
||||||
silence.performClick();
|
silence.performClick();
|
||||||
@@ -993,7 +993,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
verify(mMockINotificationManager, times(1)).createConversationNotificationChannelForPackage(
|
verify(mMockINotificationManager, times(1)).createConversationNotificationChannelForPackage(
|
||||||
anyString(), anyInt(), anyString(), any(), eq(CONVERSATION_ID));
|
anyString(), anyInt(), anyString(), any(), eq(CONVERSATION_ID));
|
||||||
@@ -1018,7 +1018,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
mBuilderProvider,
|
mBuilderProvider,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
verify(mMockINotificationManager, never()).createConversationNotificationChannelForPackage(
|
verify(mMockINotificationManager, never()).createConversationNotificationChannelForPackage(
|
||||||
anyString(), anyInt(), anyString(), any(), eq(CONVERSATION_ID));
|
anyString(), anyInt(), anyString(), any(), eq(CONVERSATION_ID));
|
||||||
@@ -1053,7 +1053,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
() -> b,
|
() -> b,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
// WHEN user clicks "priority"
|
// WHEN user clicks "priority"
|
||||||
mNotificationInfo.setSelectedAction(NotificationConversationInfo.ACTION_FAVORITE);
|
mNotificationInfo.setSelectedAction(NotificationConversationInfo.ACTION_FAVORITE);
|
||||||
@@ -1093,7 +1093,7 @@ public class NotificationConversationInfoTest extends SysuiTestCase {
|
|||||||
() -> b,
|
() -> b,
|
||||||
true,
|
true,
|
||||||
mTestHandler,
|
mTestHandler,
|
||||||
mTestHandler, null);
|
mTestHandler, null, mBubbleController);
|
||||||
|
|
||||||
// WHEN user clicks "priority"
|
// WHEN user clicks "priority"
|
||||||
mNotificationInfo.setSelectedAction(NotificationConversationInfo.ACTION_FAVORITE);
|
mNotificationInfo.setSelectedAction(NotificationConversationInfo.ACTION_FAVORITE);
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ import androidx.test.filters.SmallTest;
|
|||||||
|
|
||||||
import com.android.internal.logging.MetricsLogger;
|
import com.android.internal.logging.MetricsLogger;
|
||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
|
import com.android.systemui.bubbles.BubbleController;
|
||||||
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
|
||||||
import com.android.systemui.settings.CurrentUserContextTracker;
|
import com.android.systemui.settings.CurrentUserContextTracker;
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
@@ -126,6 +127,7 @@ public class NotificationGutsManagerTest extends SysuiTestCase {
|
|||||||
@Mock private ChannelEditorDialogController mChannelEditorDialogController;
|
@Mock private ChannelEditorDialogController mChannelEditorDialogController;
|
||||||
@Mock private PeopleNotificationIdentifier mPeopleNotificationIdentifier;
|
@Mock private PeopleNotificationIdentifier mPeopleNotificationIdentifier;
|
||||||
@Mock private CurrentUserContextTracker mContextTracker;
|
@Mock private CurrentUserContextTracker mContextTracker;
|
||||||
|
@Mock private BubbleController mBubbleController;
|
||||||
@Mock(answer = Answers.RETURNS_SELF)
|
@Mock(answer = Answers.RETURNS_SELF)
|
||||||
private PriorityOnboardingDialogController.Builder mBuilder;
|
private PriorityOnboardingDialogController.Builder mBuilder;
|
||||||
private Provider<PriorityOnboardingDialogController.Builder> mProvider = () -> mBuilder;
|
private Provider<PriorityOnboardingDialogController.Builder> mProvider = () -> mBuilder;
|
||||||
@@ -138,6 +140,7 @@ public class NotificationGutsManagerTest extends SysuiTestCase {
|
|||||||
mDeviceProvisionedController);
|
mDeviceProvisionedController);
|
||||||
mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger);
|
mDependency.injectTestDependency(MetricsLogger.class, mMetricsLogger);
|
||||||
mDependency.injectTestDependency(VisualStabilityManager.class, mVisualStabilityManager);
|
mDependency.injectTestDependency(VisualStabilityManager.class, mVisualStabilityManager);
|
||||||
|
mDependency.injectTestDependency(BubbleController.class, mBubbleController);
|
||||||
mDependency.injectMockDependency(NotificationLockscreenUserManager.class);
|
mDependency.injectMockDependency(NotificationLockscreenUserManager.class);
|
||||||
mHandler = Handler.createAsync(mTestableLooper.getLooper());
|
mHandler = Handler.createAsync(mTestableLooper.getLooper());
|
||||||
mHelper = new NotificationTestHelper(mContext, mDependency, TestableLooper.get(this));
|
mHelper = new NotificationTestHelper(mContext, mDependency, TestableLooper.get(this));
|
||||||
@@ -146,7 +149,7 @@ public class NotificationGutsManagerTest extends SysuiTestCase {
|
|||||||
mGutsManager = new NotificationGutsManager(mContext, mVisualStabilityManager,
|
mGutsManager = new NotificationGutsManager(mContext, mVisualStabilityManager,
|
||||||
() -> mStatusBar, mHandler, mHandler, mAccessibilityManager, mHighPriorityProvider,
|
() -> mStatusBar, mHandler, mHandler, mAccessibilityManager, mHighPriorityProvider,
|
||||||
mINotificationManager, mLauncherApps, mShortcutManager,
|
mINotificationManager, mLauncherApps, mShortcutManager,
|
||||||
mChannelEditorDialogController, mContextTracker, mProvider);
|
mChannelEditorDialogController, mContextTracker, mProvider, mBubbleController);
|
||||||
mGutsManager.setUpWithPresenter(mPresenter, mStackScroller,
|
mGutsManager.setUpWithPresenter(mPresenter, mStackScroller,
|
||||||
mCheckSaveListener, mOnSettingsClickListener);
|
mCheckSaveListener, mOnSettingsClickListener);
|
||||||
mGutsManager.setNotificationActivityStarter(mNotificationActivityStarter);
|
mGutsManager.setNotificationActivityStarter(mNotificationActivityStarter);
|
||||||
|
|||||||
Reference in New Issue
Block a user