Merge "Lock screen ui clean up" into udc-dev am: 0d92b2ecf1

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/ThemePicker/+/22572986

Change-Id: Id2410ccf2a19b1fb2d8c14a444fe0e98c8ebb049
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/res/layout/notification_section.xml b/res/layout/notification_section.xml
index c89f2e3..c20ffbf 100644
--- a/res/layout/notification_section.xml
+++ b/res/layout/notification_section.xml
@@ -35,16 +35,10 @@
         android:orientation="vertical">
 
         <TextView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:text="@string/notifications_section_title"
-            style="@style/SectionTitleTextStyle" />
-
-        <TextView
             android:id="@+id/subtitle"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            style="@style/SectionSubtitleTextStyle"/>
+            style="@style/SectionTitleTextStyle"/>
     </LinearLayout>
 
     <Switch
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 01113c4..1f71bd6 100755
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -412,14 +412,6 @@
     <string name="keyguard_quick_affordance_none_selected">None</string>
 
     <!--
-    Title for a section in a list of sections in the settings app that allows the user to modify
-    how notifications behave whilst the device is locked.
-
-    [CHAR LIMIT=32].
-    -->
-    <string name="notifications_section_title">Notifications</string>
-
-    <!--
     Summary for a setting that lets the user toggle between showing or hiding notifications on their
     device's lock screen. This one is shown when the user is allowing notifications to show on their
     device's lock screen.
@@ -443,7 +435,7 @@
 
     [CHAR LIMIT=32].
     -->
-    <string name="more_settings_section_title">More options</string>
+    <string name="more_settings_section_title">More lock screen options</string>
 
     <!--
     Summary for a setting that lets the user access additional settings related to lock screen
@@ -453,7 +445,7 @@
 
     [CHAR LIMIT=64].
     -->
-    <string name="more_settings_section_description">Text on lock screen, Now Playing, and more</string>
+    <string name="more_settings_section_description">Privacy, Now Playing, and more</string>
 
     <!--
     Label for button that lets the user navigate to a full-screen experience of selecting
diff --git a/src/com/android/customization/picker/notifications/ui/binder/NotificationSectionBinder.kt b/src/com/android/customization/picker/notifications/ui/binder/NotificationSectionBinder.kt
index 54f9bf6..edd469f 100644
--- a/src/com/android/customization/picker/notifications/ui/binder/NotificationSectionBinder.kt
+++ b/src/com/android/customization/picker/notifications/ui/binder/NotificationSectionBinder.kt
@@ -47,7 +47,7 @@
         lifecycleOwner.lifecycleScope.launch {
             lifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
                 launch {
-                    viewModel.subtitleStringResourceId.collect {
+                    viewModel.titleStringResourceId.collect {
                         subtitle.text = view.context.getString(it)
                     }
                 }
diff --git a/src/com/android/customization/picker/notifications/ui/viewmodel/NotificationSectionViewModel.kt b/src/com/android/customization/picker/notifications/ui/viewmodel/NotificationSectionViewModel.kt
index 97b0448..58a84a4 100644
--- a/src/com/android/customization/picker/notifications/ui/viewmodel/NotificationSectionViewModel.kt
+++ b/src/com/android/customization/picker/notifications/ui/viewmodel/NotificationSectionViewModel.kt
@@ -35,9 +35,9 @@
     private val interactor: NotificationsInteractor,
 ) : ViewModel() {
 
-    /** A string resource ID for the subtitle. */
+    /** A string resource ID for the title. */
     @StringRes
-    val subtitleStringResourceId: Flow<Int> =
+    val titleStringResourceId: Flow<Int> =
         interactor.settings.map { model ->
             when (model.isShowNotificationsOnLockScreenEnabled) {
                 true -> R.string.show_notifications_on_lock_screen
diff --git a/tests/src/com/android/customization/picker/notifications/ui/viewmodel/NotificationSectionViewModelTest.kt b/tests/src/com/android/customization/picker/notifications/ui/viewmodel/NotificationSectionViewModelTest.kt
index 6442609..43ddea7 100644
--- a/tests/src/com/android/customization/picker/notifications/ui/viewmodel/NotificationSectionViewModelTest.kt
+++ b/tests/src/com/android/customization/picker/notifications/ui/viewmodel/NotificationSectionViewModelTest.kt
@@ -84,18 +84,18 @@
     @Test
     fun `toggles back and forth`() =
         testScope.runTest {
-            val subtitleStringResId = collectLastValue(underTest.subtitleStringResourceId)
+            val titleStringResId = collectLastValue(underTest.titleStringResourceId)
             val isSwitchOn = collectLastValue(underTest.isSwitchOn)
 
-            val initialSubtitleStringRes = subtitleStringResId()
+            val initialSubtitleStringRes = titleStringResId()
             val initialIsSwitchOn = isSwitchOn()
 
             underTest.onClicked()
-            assertThat(subtitleStringResId()).isNotEqualTo(initialSubtitleStringRes)
+            assertThat(titleStringResId()).isNotEqualTo(initialSubtitleStringRes)
             assertThat(isSwitchOn()).isNotEqualTo(initialIsSwitchOn)
 
             underTest.onClicked()
-            assertThat(subtitleStringResId()).isEqualTo(initialSubtitleStringRes)
+            assertThat(titleStringResId()).isEqualTo(initialSubtitleStringRes)
             assertThat(isSwitchOn()).isEqualTo(initialIsSwitchOn)
         }
 }