Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryAdapterTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,22 @@ class NotificationEntryAdapterTest : SysuiTestCase() { assertThat(underTest.isFullScreenCapable).isTrue() } @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun onDragSuccess() { val notification: Notification = Notification.Builder(mContext, "") .setSmallIcon(R.drawable.ic_person) .addAction(mock(Notification.Action::class.java)) .build() val entry = NotificationEntryBuilder().setNotification(notification).build() underTest = factory.create(entry) as NotificationEntryAdapter underTest.onDragSuccess() verify(kosmos.mockNotificationActivityStarter).onDragSuccess(entry) } @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun onNotificationBubbleIconClicked() { Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java +15 −7 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.View; import com.android.systemui.DejankUtils; import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.statusbar.notification.collection.EntryAdapter; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.shared.NotificationBundleUi; Loading @@ -44,12 +45,19 @@ public final class NotificationClicker implements View.OnClickListener { private final Optional<Bubbles> mBubblesOptional; private final NotificationActivityStarter mNotificationActivityStarter; private ExpandableNotificationRow.OnDragSuccessListener mOnDragSuccessListener = new ExpandableNotificationRow.OnDragSuccessListener() { private ExpandableNotificationRow.OnDragSuccessListener mOnDragSuccessListener = new ExpandableNotificationRow.OnDragSuccessListener() { @Override public void onDragSuccess(NotificationEntry entry) { NotificationBundleUi.assertInLegacyMode(); mNotificationActivityStarter.onDragSuccess(entry); } @Override public void onDragSuccess(EntryAdapter entryAdapter) { NotificationBundleUi.isUnexpectedlyInLegacyMode(); entryAdapter.onDragSuccess(); } }; private NotificationClicker( Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleEntryAdapter.kt +5 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,11 @@ class BundleEntryAdapter(val entry: BundleEntry) : EntryAdapter { return false } override fun onDragSuccess() { // do nothing. these should not be draggable Log.wtf(TAG, "onDragSuccess() called") } override fun onNotificationBubbleIconClicked() { // do nothing. these cannot be a bubble Log.wtf(TAG, "onNotificationBubbleIconClicked() called") Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/EntryAdapter.java +2 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,8 @@ public interface EntryAdapter { return false; } void onDragSuccess(); /** * Process a click on a notification bubble icon */ Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntryAdapter.kt +4 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,10 @@ class NotificationEntryAdapter( return entry.sbn.notification.fullScreenIntent != null } override fun onDragSuccess() { notificationActivityStarter.onDragSuccess(entry) } override fun onNotificationBubbleIconClicked() { notificationActivityStarter.onNotificationBubbleIconClicked(entry) } Loading Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/collection/NotificationEntryAdapterTest.kt +16 −0 Original line number Diff line number Diff line Loading @@ -363,6 +363,22 @@ class NotificationEntryAdapterTest : SysuiTestCase() { assertThat(underTest.isFullScreenCapable).isTrue() } @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun onDragSuccess() { val notification: Notification = Notification.Builder(mContext, "") .setSmallIcon(R.drawable.ic_person) .addAction(mock(Notification.Action::class.java)) .build() val entry = NotificationEntryBuilder().setNotification(notification).build() underTest = factory.create(entry) as NotificationEntryAdapter underTest.onDragSuccess() verify(kosmos.mockNotificationActivityStarter).onDragSuccess(entry) } @Test @EnableFlags(NotificationBundleUi.FLAG_NAME) fun onNotificationBubbleIconClicked() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationClicker.java +15 −7 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.view.View; import com.android.systemui.DejankUtils; import com.android.systemui.power.domain.interactor.PowerInteractor; import com.android.systemui.statusbar.notification.collection.EntryAdapter; import com.android.systemui.statusbar.notification.collection.NotificationEntry; import com.android.systemui.statusbar.notification.row.ExpandableNotificationRow; import com.android.systemui.statusbar.notification.shared.NotificationBundleUi; Loading @@ -44,12 +45,19 @@ public final class NotificationClicker implements View.OnClickListener { private final Optional<Bubbles> mBubblesOptional; private final NotificationActivityStarter mNotificationActivityStarter; private ExpandableNotificationRow.OnDragSuccessListener mOnDragSuccessListener = new ExpandableNotificationRow.OnDragSuccessListener() { private ExpandableNotificationRow.OnDragSuccessListener mOnDragSuccessListener = new ExpandableNotificationRow.OnDragSuccessListener() { @Override public void onDragSuccess(NotificationEntry entry) { NotificationBundleUi.assertInLegacyMode(); mNotificationActivityStarter.onDragSuccess(entry); } @Override public void onDragSuccess(EntryAdapter entryAdapter) { NotificationBundleUi.isUnexpectedlyInLegacyMode(); entryAdapter.onDragSuccess(); } }; private NotificationClicker( Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/BundleEntryAdapter.kt +5 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,11 @@ class BundleEntryAdapter(val entry: BundleEntry) : EntryAdapter { return false } override fun onDragSuccess() { // do nothing. these should not be draggable Log.wtf(TAG, "onDragSuccess() called") } override fun onNotificationBubbleIconClicked() { // do nothing. these cannot be a bubble Log.wtf(TAG, "onNotificationBubbleIconClicked() called") Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/EntryAdapter.java +2 −0 Original line number Diff line number Diff line Loading @@ -144,6 +144,8 @@ public interface EntryAdapter { return false; } void onDragSuccess(); /** * Process a click on a notification bubble icon */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/collection/NotificationEntryAdapter.kt +4 −0 Original line number Diff line number Diff line Loading @@ -149,6 +149,10 @@ class NotificationEntryAdapter( return entry.sbn.notification.fullScreenIntent != null } override fun onDragSuccess() { notificationActivityStarter.onDragSuccess(entry) } override fun onNotificationBubbleIconClicked() { notificationActivityStarter.onNotificationBubbleIconClicked(entry) } Loading