Loading packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/BundledNotificationInfoTest.kt +16 −31 Original line number Diff line number Diff line Loading @@ -127,7 +127,9 @@ class BundledNotificationInfoTest : SysuiTestCase() { systemPackageInfo.packageName = TEST_SYSTEM_PACKAGE_NAME whenever(mockPackageManager.getPackageInfo(eq(TEST_SYSTEM_PACKAGE_NAME), anyInt())) .thenReturn(systemPackageInfo) whenever(mockPackageManager.getPackageInfo(eq("android"), anyInt())).thenReturn(packageInfo) whenever(mockPackageManager.getPackageInfo(eq("android"), anyInt())) .thenReturn(packageInfo) whenever(mockPackageManager.getApplicationLabel(applicationInfo)).thenReturn("App") val assistant = ComponentName("package", "service") whenever(mockINotificationManager.allowedNotificationAssistant).thenReturn(assistant) Loading Loading @@ -215,47 +217,30 @@ class BundledNotificationInfoTest : SysuiTestCase() { } @Test fun testNews_summaryText() { val channel = NotificationChannel(NEWS_ID, "news", 2) entry = NotificationEntryBuilder(entry) .updateRanking { it.setChannel(channel) } .build() bindNotification() assertThat((underTest.findViewById(R.id.feature_summary) as TextView).text).isEqualTo( context.getString(R.string.notification_guts_news_summary)) } fun testToggleContainerCallsUpdate() { whenever(mockINotificationManager.isAdjustmentSupportedForPackage( anyInt(), anyString(), anyString())).thenReturn(true) @Test fun testSocial_summaryText() { val channel = NotificationChannel(SOCIAL_MEDIA_ID, "news", 2) entry = NotificationEntryBuilder(entry) .updateRanking { it.setChannel(channel) } .build() bindNotification() assertThat((underTest.findViewById(R.id.feature_summary) as TextView).text).isEqualTo( context.getString(R.string.notification_guts_social_summary)) } @Test fun testPromotions_summaryText() { val channel = NotificationChannel(PROMOTIONS_ID, "news", 2) entry = NotificationEntryBuilder(entry) .updateRanking { it.setChannel(channel) } .build() bindNotification() assertThat((underTest.findViewById(R.id.feature_summary) as TextView).text).isEqualTo( context.getString(R.string.notification_guts_promotions_summary)) underTest.findViewById<View>(R.id.classification_toggle).performClick() underTest.findViewById<View>(R.id.done).performClick() underTest.handleCloseControls(true, false) testableLooper.processAllMessages() verify(mockINotificationManager) .setAdjustmentSupportedForPackage(anyInt(), anyString(), anyString(), eq(false)) } @Test fun testRecs_summaryText() { val channel = NotificationChannel(RECS_ID, "news", 2) fun testSummaryText() { val channel = NotificationChannel(NEWS_ID, "news", 2) entry = NotificationEntryBuilder(entry) .updateRanking { it.setChannel(channel) } .build() bindNotification() assertThat((underTest.findViewById(R.id.feature_summary) as TextView).text).isEqualTo( context.getString(R.string.notification_guts_recs_summary)) "For App") } private fun bindNotification( Loading packages/SystemUI/res/layout/bundled_notification_info.xml +7 −7 Original line number Diff line number Diff line Loading @@ -189,30 +189,30 @@ android:gravity="center_vertical" android:paddingStart="4dp" android:paddingEnd="4dp" android:theme="@style/Theme.SystemUI.Dialog" > <TextView <Button android:id="@+id/inline_dismiss" android:text="@string/notification_inline_dismiss" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" android:gravity="start|center_vertical" android:gravity="center" android:minWidth="@dimen/notification_importance_toggle_size" android:minHeight="@dimen/notification_importance_toggle_size" android:maxWidth="200dp" android:paddingEnd="@dimen/notification_importance_button_padding" style="@style/TextAppearance.NotificationInfo.Button"/> <TextView style="@style/Widget.Dialog.Button.BorderButton"/> <Button android:id="@+id/done" android:text="@string/inline_ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:gravity="end|center_vertical" android:gravity="center" android:minWidth="@dimen/notification_importance_toggle_size" android:minHeight="@dimen/notification_importance_toggle_size" android:maxWidth="125dp" style="@style/TextAppearance.NotificationInfo.Button"/> style="@style/Widget.Dialog.Button"/> </RelativeLayout> </LinearLayout> </com.android.systemui.statusbar.notification.row.BundledNotificationInfo> packages/SystemUI/res/layout/notif_half_shelf.xml +1 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ android:minWidth="@dimen/notification_importance_toggle_size" android:minHeight="@dimen/notification_importance_toggle_size" android:maxWidth="200dp" style="@style/Widget.Dialog.Button"/> style="@style/Widget.Dialog.Button.BorderButton"/> <Space android:layout_width="0dp" android:layout_height="match_parent" Loading packages/SystemUI/res/layout/notification_2025_conversation_info.xml +5 −8 Original line number Diff line number Diff line Loading @@ -380,31 +380,28 @@ android:layout_height="wrap_content" android:layout_marginTop="@*android:dimen/notification_2025_margin" android:minHeight="@dimen/notification_2025_guts_button_size" android:theme="@style/Theme.SystemUI.Dialog" > <TextView <Button android:id="@+id/inline_dismiss" android:text="@string/notification_inline_dismiss" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" android:paddingTop="8dp" android:paddingBottom="@*android:dimen/notification_2025_margin" android:gravity="center" android:minWidth="@dimen/notification_2025_min_tap_target_size" android:minHeight="@dimen/notification_2025_min_tap_target_size" style="@style/TextAppearance.NotificationInfo.Button"/> <TextView style="@style/Widget.Dialog.Button.BorderButton"/> <Button android:id="@+id/done" android:text="@string/inline_ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:paddingTop="8dp" android:paddingBottom="@*android:dimen/notification_2025_margin" android:gravity="center" android:minWidth="@dimen/notification_2025_min_tap_target_size" android:minHeight="@dimen/notification_2025_min_tap_target_size" style="@style/TextAppearance.NotificationInfo.Button"/> style="@style/Widget.Dialog.Button"/> </RelativeLayout> </LinearLayout> Loading packages/SystemUI/res/layout/notification_2025_info.xml +17 −27 Original line number Diff line number Diff line Loading @@ -324,63 +324,53 @@ </com.android.systemui.statusbar.notification.row.ButtonLinearLayout> </LinearLayout> <androidx.constraintlayout.widget.ConstraintLayout <RelativeLayout android:id="@+id/bottom_buttons" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@*android:dimen/notification_2025_margin" android:minHeight="@dimen/notification_2025_guts_button_size" android:gravity="center_vertical"> android:layout_gravity="center_vertical" android:theme="@style/Theme.SystemUI.Dialog" > <TextView <Button android:id="@+id/inline_dismiss" android:text="@string/notification_inline_dismiss" android:paddingEnd="@*android:dimen/notification_2025_margin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="8dp" android:paddingBottom="@*android:dimen/notification_2025_margin" app:layout_constraintStart_toStartOf="parent" android:layout_alignParentStart="true" android:gravity="center" android:minWidth="@dimen/notification_2025_min_tap_target_size" android:minHeight="@dimen/notification_2025_min_tap_target_size" android:maxWidth="200dp" style="@style/TextAppearance.NotificationInfo.Button" android:layout_marginEnd="8dp" style="@style/Widget.Dialog.Button.BorderButton" /> <TextView <Button android:id="@+id/turn_off_notifications" android:text="@string/inline_turn_off_notifications" android:paddingStart="@dimen/notification_importance_button_padding" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="8dp" android:paddingBottom="@*android:dimen/notification_2025_margin" android:layout_toEndOf="@id/inline_dismiss" android:gravity="center" android:minWidth="@dimen/notification_2025_min_tap_target_size" android:minHeight="@dimen/notification_2025_min_tap_target_size" android:maxWidth="200dp" app:layout_constraintStart_toEndOf="@id/inline_dismiss" style="@style/TextAppearance.NotificationInfo.Button" style="@style/Widget.Dialog.Button.BorderButton" /> <TextView <Button android:id="@+id/done" android:text="@string/inline_ok_button" android:text="@string/inline_done_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="8dp" android:paddingBottom="@*android:dimen/notification_2025_margin" android:gravity="end|center_vertical" app:layout_constraintEnd_toEndOf="parent" android:layout_alignParentEnd="true" android:gravity="center" android:minWidth="@dimen/notification_2025_min_tap_target_size" android:minHeight="@dimen/notification_2025_min_tap_target_size" android:maxWidth="125dp" style="@style/TextAppearance.NotificationInfo.Button" style="@style/Widget.Dialog.Button" /> <androidx.constraintlayout.helper.widget.Flow android:layout_width="match_parent" android:layout_height="wrap_content" app:constraint_referenced_ids="inline_dismiss,turn_off_notifications,done" app:flow_wrapMode="chain"/> </androidx.constraintlayout.widget.ConstraintLayout> </RelativeLayout> </LinearLayout> </com.android.systemui.statusbar.notification.row.NotificationInfo> Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/BundledNotificationInfoTest.kt +16 −31 Original line number Diff line number Diff line Loading @@ -127,7 +127,9 @@ class BundledNotificationInfoTest : SysuiTestCase() { systemPackageInfo.packageName = TEST_SYSTEM_PACKAGE_NAME whenever(mockPackageManager.getPackageInfo(eq(TEST_SYSTEM_PACKAGE_NAME), anyInt())) .thenReturn(systemPackageInfo) whenever(mockPackageManager.getPackageInfo(eq("android"), anyInt())).thenReturn(packageInfo) whenever(mockPackageManager.getPackageInfo(eq("android"), anyInt())) .thenReturn(packageInfo) whenever(mockPackageManager.getApplicationLabel(applicationInfo)).thenReturn("App") val assistant = ComponentName("package", "service") whenever(mockINotificationManager.allowedNotificationAssistant).thenReturn(assistant) Loading Loading @@ -215,47 +217,30 @@ class BundledNotificationInfoTest : SysuiTestCase() { } @Test fun testNews_summaryText() { val channel = NotificationChannel(NEWS_ID, "news", 2) entry = NotificationEntryBuilder(entry) .updateRanking { it.setChannel(channel) } .build() bindNotification() assertThat((underTest.findViewById(R.id.feature_summary) as TextView).text).isEqualTo( context.getString(R.string.notification_guts_news_summary)) } fun testToggleContainerCallsUpdate() { whenever(mockINotificationManager.isAdjustmentSupportedForPackage( anyInt(), anyString(), anyString())).thenReturn(true) @Test fun testSocial_summaryText() { val channel = NotificationChannel(SOCIAL_MEDIA_ID, "news", 2) entry = NotificationEntryBuilder(entry) .updateRanking { it.setChannel(channel) } .build() bindNotification() assertThat((underTest.findViewById(R.id.feature_summary) as TextView).text).isEqualTo( context.getString(R.string.notification_guts_social_summary)) } @Test fun testPromotions_summaryText() { val channel = NotificationChannel(PROMOTIONS_ID, "news", 2) entry = NotificationEntryBuilder(entry) .updateRanking { it.setChannel(channel) } .build() bindNotification() assertThat((underTest.findViewById(R.id.feature_summary) as TextView).text).isEqualTo( context.getString(R.string.notification_guts_promotions_summary)) underTest.findViewById<View>(R.id.classification_toggle).performClick() underTest.findViewById<View>(R.id.done).performClick() underTest.handleCloseControls(true, false) testableLooper.processAllMessages() verify(mockINotificationManager) .setAdjustmentSupportedForPackage(anyInt(), anyString(), anyString(), eq(false)) } @Test fun testRecs_summaryText() { val channel = NotificationChannel(RECS_ID, "news", 2) fun testSummaryText() { val channel = NotificationChannel(NEWS_ID, "news", 2) entry = NotificationEntryBuilder(entry) .updateRanking { it.setChannel(channel) } .build() bindNotification() assertThat((underTest.findViewById(R.id.feature_summary) as TextView).text).isEqualTo( context.getString(R.string.notification_guts_recs_summary)) "For App") } private fun bindNotification( Loading
packages/SystemUI/res/layout/bundled_notification_info.xml +7 −7 Original line number Diff line number Diff line Loading @@ -189,30 +189,30 @@ android:gravity="center_vertical" android:paddingStart="4dp" android:paddingEnd="4dp" android:theme="@style/Theme.SystemUI.Dialog" > <TextView <Button android:id="@+id/inline_dismiss" android:text="@string/notification_inline_dismiss" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" android:gravity="start|center_vertical" android:gravity="center" android:minWidth="@dimen/notification_importance_toggle_size" android:minHeight="@dimen/notification_importance_toggle_size" android:maxWidth="200dp" android:paddingEnd="@dimen/notification_importance_button_padding" style="@style/TextAppearance.NotificationInfo.Button"/> <TextView style="@style/Widget.Dialog.Button.BorderButton"/> <Button android:id="@+id/done" android:text="@string/inline_ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:gravity="end|center_vertical" android:gravity="center" android:minWidth="@dimen/notification_importance_toggle_size" android:minHeight="@dimen/notification_importance_toggle_size" android:maxWidth="125dp" style="@style/TextAppearance.NotificationInfo.Button"/> style="@style/Widget.Dialog.Button"/> </RelativeLayout> </LinearLayout> </com.android.systemui.statusbar.notification.row.BundledNotificationInfo>
packages/SystemUI/res/layout/notif_half_shelf.xml +1 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ android:minWidth="@dimen/notification_importance_toggle_size" android:minHeight="@dimen/notification_importance_toggle_size" android:maxWidth="200dp" style="@style/Widget.Dialog.Button"/> style="@style/Widget.Dialog.Button.BorderButton"/> <Space android:layout_width="0dp" android:layout_height="match_parent" Loading
packages/SystemUI/res/layout/notification_2025_conversation_info.xml +5 −8 Original line number Diff line number Diff line Loading @@ -380,31 +380,28 @@ android:layout_height="wrap_content" android:layout_marginTop="@*android:dimen/notification_2025_margin" android:minHeight="@dimen/notification_2025_guts_button_size" android:theme="@style/Theme.SystemUI.Dialog" > <TextView <Button android:id="@+id/inline_dismiss" android:text="@string/notification_inline_dismiss" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" android:paddingTop="8dp" android:paddingBottom="@*android:dimen/notification_2025_margin" android:gravity="center" android:minWidth="@dimen/notification_2025_min_tap_target_size" android:minHeight="@dimen/notification_2025_min_tap_target_size" style="@style/TextAppearance.NotificationInfo.Button"/> <TextView style="@style/Widget.Dialog.Button.BorderButton"/> <Button android:id="@+id/done" android:text="@string/inline_ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentEnd="true" android:paddingTop="8dp" android:paddingBottom="@*android:dimen/notification_2025_margin" android:gravity="center" android:minWidth="@dimen/notification_2025_min_tap_target_size" android:minHeight="@dimen/notification_2025_min_tap_target_size" style="@style/TextAppearance.NotificationInfo.Button"/> style="@style/Widget.Dialog.Button"/> </RelativeLayout> </LinearLayout> Loading
packages/SystemUI/res/layout/notification_2025_info.xml +17 −27 Original line number Diff line number Diff line Loading @@ -324,63 +324,53 @@ </com.android.systemui.statusbar.notification.row.ButtonLinearLayout> </LinearLayout> <androidx.constraintlayout.widget.ConstraintLayout <RelativeLayout android:id="@+id/bottom_buttons" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@*android:dimen/notification_2025_margin" android:minHeight="@dimen/notification_2025_guts_button_size" android:gravity="center_vertical"> android:layout_gravity="center_vertical" android:theme="@style/Theme.SystemUI.Dialog" > <TextView <Button android:id="@+id/inline_dismiss" android:text="@string/notification_inline_dismiss" android:paddingEnd="@*android:dimen/notification_2025_margin" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="8dp" android:paddingBottom="@*android:dimen/notification_2025_margin" app:layout_constraintStart_toStartOf="parent" android:layout_alignParentStart="true" android:gravity="center" android:minWidth="@dimen/notification_2025_min_tap_target_size" android:minHeight="@dimen/notification_2025_min_tap_target_size" android:maxWidth="200dp" style="@style/TextAppearance.NotificationInfo.Button" android:layout_marginEnd="8dp" style="@style/Widget.Dialog.Button.BorderButton" /> <TextView <Button android:id="@+id/turn_off_notifications" android:text="@string/inline_turn_off_notifications" android:paddingStart="@dimen/notification_importance_button_padding" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="8dp" android:paddingBottom="@*android:dimen/notification_2025_margin" android:layout_toEndOf="@id/inline_dismiss" android:gravity="center" android:minWidth="@dimen/notification_2025_min_tap_target_size" android:minHeight="@dimen/notification_2025_min_tap_target_size" android:maxWidth="200dp" app:layout_constraintStart_toEndOf="@id/inline_dismiss" style="@style/TextAppearance.NotificationInfo.Button" style="@style/Widget.Dialog.Button.BorderButton" /> <TextView <Button android:id="@+id/done" android:text="@string/inline_ok_button" android:text="@string/inline_done_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingTop="8dp" android:paddingBottom="@*android:dimen/notification_2025_margin" android:gravity="end|center_vertical" app:layout_constraintEnd_toEndOf="parent" android:layout_alignParentEnd="true" android:gravity="center" android:minWidth="@dimen/notification_2025_min_tap_target_size" android:minHeight="@dimen/notification_2025_min_tap_target_size" android:maxWidth="125dp" style="@style/TextAppearance.NotificationInfo.Button" style="@style/Widget.Dialog.Button" /> <androidx.constraintlayout.helper.widget.Flow android:layout_width="match_parent" android:layout_height="wrap_content" app:constraint_referenced_ids="inline_dismiss,turn_off_notifications,done" app:flow_wrapMode="chain"/> </androidx.constraintlayout.widget.ConstraintLayout> </RelativeLayout> </LinearLayout> </com.android.systemui.statusbar.notification.row.NotificationInfo>