Merge "Fix crash of resource not found for grid options" into main
diff --git a/res/values-b+sr+Latn/strings.xml b/res/values-b+sr+Latn/strings.xml
index bb0a0c2..4956d50 100644
--- a/res/values-b+sr+Latn/strings.xml
+++ b/res/values-b+sr+Latn/strings.xml
@@ -35,7 +35,7 @@
     <string name="clock_color_yellow" msgid="7391699163247349977">"Žuta"</string>
     <string name="clock_color_green" msgid="1991157556500156596">"Zelena"</string>
     <string name="clock_color_blue" msgid="4037792003465759149">"Plava"</string>
-    <string name="clock_color_indigo" msgid="8910855386698452917">"Tamnoplava"</string>
+    <string name="clock_color_indigo" msgid="8910855386698452917">"Indigo"</string>
     <string name="clock_color_violet" msgid="3454503847169375826">"Ljubičasta"</string>
     <string name="clock_color_gray" msgid="9221530636948859231">"Siva"</string>
     <string name="clock_color_teal" msgid="7499223425741344251">"Tirkizna"</string>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index 5e8ba65..208da78 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -38,7 +38,7 @@
     <string name="clock_color_indigo" msgid="8910855386698452917">"Anyil"</string>
     <string name="clock_color_violet" msgid="3454503847169375826">"Violeta"</string>
     <string name="clock_color_gray" msgid="9221530636948859231">"Gris"</string>
-    <string name="clock_color_teal" msgid="7499223425741344251">"Verd blavós"</string>
+    <string name="clock_color_teal" msgid="7499223425741344251">"Xarxet"</string>
     <string name="clock_size" msgid="5028923902364418263">"Mida"</string>
     <string name="clock_size_dynamic" msgid="1023930312455061642">"Dinàmic"</string>
     <string name="clock_size_dynamic_description" msgid="2776620745774561662">"La mida del rellotge canvia d\'acord amb el contingut de la pantalla de bloqueig"</string>
diff --git a/res/values-et/strings.xml b/res/values-et/strings.xml
index 1e21245..7b7a949 100644
--- a/res/values-et/strings.xml
+++ b/res/values-et/strings.xml
@@ -119,11 +119,11 @@
     <string name="beta_title" msgid="8703819523760746458">"Beeta"</string>
     <string name="gird_picker_entry_content_description" msgid="9087651470212293439">"Rakenduste ruudustiku muutmine"</string>
     <string name="wallpaper_color_tab" msgid="1447926591721403840">"Taustapildi värvid"</string>
-    <string name="wallpaper_color_subheader" msgid="4044464573669965670">"Ikoonide, teksti ja muud värvid ühtivad taustapildiga"</string>
+    <string name="wallpaper_color_subheader" msgid="4044464573669965670">"Ikoonide, teksti ja muud värvid ühtivad taustapildiga."</string>
     <string name="wallpaper_color_title" msgid="5687965239180986458">"Taustapildi värv"</string>
     <string name="preset_color_tab" msgid="3133391839341329314">"Põhivärvid"</string>
     <string name="preset_color_tab_2" msgid="1444107326712562538">"Muud värvid"</string>
-    <string name="preset_color_subheader" msgid="8230588536141279371">"Valige oma ikoonide, kella ja muu jaoks mis tahes värv"</string>
+    <string name="preset_color_subheader" msgid="8230588536141279371">"Valige oma ikoonide, kella ja muu jaoks mis tahes värv."</string>
     <string name="color_changed" msgid="7029571720331641235">"Värvi muudeti"</string>
     <string name="adaptive_color_title" msgid="1336508599235896205">"Dünaamiline"</string>
     <string name="color_picker_title" msgid="6666830057938082864">"Süsteemi värvid"</string>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index 7df5d2f..95b9d25 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -119,7 +119,7 @@
     <string name="beta_title" msgid="8703819523760746458">"Beta"</string>
     <string name="gird_picker_entry_content_description" msgid="9087651470212293439">"Endre apprutenett"</string>
     <string name="wallpaper_color_tab" msgid="1447926591721403840">"Bakgrunnsfarger"</string>
-    <string name="wallpaper_color_subheader" msgid="4044464573669965670">"Ikoner, tekst og annet matcher fargene i bakgrunnen din"</string>
+    <string name="wallpaper_color_subheader" msgid="4044464573669965670">"Ikoner, tekst og annet matcher fargene i bakgrunnen"</string>
     <string name="wallpaper_color_title" msgid="5687965239180986458">"Bakgrunnsfarge"</string>
     <string name="preset_color_tab" msgid="3133391839341329314">"Grunnleggende farger"</string>
     <string name="preset_color_tab_2" msgid="1444107326712562538">"Andre farger"</string>
diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml
index 2e89af7..91dbcda 100644
--- a/res/values-sr/strings.xml
+++ b/res/values-sr/strings.xml
@@ -35,7 +35,7 @@
     <string name="clock_color_yellow" msgid="7391699163247349977">"Жута"</string>
     <string name="clock_color_green" msgid="1991157556500156596">"Зелена"</string>
     <string name="clock_color_blue" msgid="4037792003465759149">"Плава"</string>
-    <string name="clock_color_indigo" msgid="8910855386698452917">"Тамноплава"</string>
+    <string name="clock_color_indigo" msgid="8910855386698452917">"Индиго"</string>
     <string name="clock_color_violet" msgid="3454503847169375826">"Љубичаста"</string>
     <string name="clock_color_gray" msgid="9221530636948859231">"Сива"</string>
     <string name="clock_color_teal" msgid="7499223425741344251">"Тиркизна"</string>
diff --git a/tests/common/src/com/android/customization/model/grid/FakeShapeGridManager.kt b/tests/common/src/com/android/customization/model/grid/FakeShapeGridManager.kt
index c3aaf30..b39988a 100644
--- a/tests/common/src/com/android/customization/model/grid/FakeShapeGridManager.kt
+++ b/tests/common/src/com/android/customization/model/grid/FakeShapeGridManager.kt
@@ -95,13 +95,6 @@
                     isCurrent = false,
                 ),
                 ShapeOptionModel(
-                    key = "sunny",
-                    title = "sunny",
-                    path =
-                        "M42.846 4.873C46.084-.531 53.916-.531 57.154 4.873L60.796 10.951C62.685 14.103 66.414 15.647 69.978 14.754L76.851 13.032C82.962 11.5 88.5 17.038 86.968 23.149L85.246 30.022C84.353 33.586 85.897 37.315 89.049 39.204L95.127 42.846C100.531 46.084 100.531 53.916 95.127 57.154L89.049 60.796C85.897 62.685 84.353 66.414 85.246 69.978L86.968 76.851C88.5 82.962 82.962 88.5 76.851 86.968L69.978 85.246C66.414 84.353 62.685 85.898 60.796 89.049L57.154 95.127C53.916 100.531 46.084 100.531 42.846 95.127L39.204 89.049C37.315 85.898 33.586 84.353 30.022 85.246L23.149 86.968C17.038 88.5 11.5 82.962 13.032 76.851L14.754 69.978C15.647 66.414 14.103 62.685 10.951 60.796L4.873 57.154C-.531 53.916-.531 46.084 4.873 42.846L10.951 39.204C14.103 37.315 15.647 33.586 14.754 30.022L13.032 23.149C11.5 17.038 17.038 11.5 23.149 13.032L30.022 14.754C33.586 15.647 37.315 14.103 39.204 10.951L42.846 4.873Z",
-                    isCurrent = false,
-                ),
-                ShapeOptionModel(
                     key = "circle",
                     title = "circle",
                     path =
diff --git a/tests/robotests/src/com/android/customization/picker/grid/data/repository/ShapeGridRepositoryTest.kt b/tests/robotests/src/com/android/customization/picker/grid/data/repository/ShapeGridRepositoryTest.kt
index 985d983..5fa1545 100644
--- a/tests/robotests/src/com/android/customization/picker/grid/data/repository/ShapeGridRepositoryTest.kt
+++ b/tests/robotests/src/com/android/customization/picker/grid/data/repository/ShapeGridRepositoryTest.kt
@@ -104,11 +104,14 @@
     fun selectedShapeOption_shouldUpdateAfterApplyShapeGridOption() =
         testScope.runTest {
             val selectedShapeOption = collectLastValue(underTest.selectedShapeOption)
+            val expectedShapeKey = "circle"
+            val expectedShapeOption =
+                FakeShapeGridManager.DEFAULT_SHAPE_OPTION_LIST.first { it.key == expectedShapeKey }
+                    .copy(isCurrent = true)
 
-            underTest.applySelectedOption("circle", "practical")
+            underTest.applySelectedOption(expectedShapeKey, "practical")
 
-            assertThat(selectedShapeOption())
-                .isEqualTo(FakeShapeGridManager.DEFAULT_SHAPE_OPTION_LIST[4].copy(isCurrent = true))
+            assertThat(selectedShapeOption()).isEqualTo(expectedShapeOption)
         }
 
     @Test
diff --git a/tests/robotests/src/com/android/customization/picker/grid/domain/interactor/ShapeGridInteractorTest.kt b/tests/robotests/src/com/android/customization/picker/grid/domain/interactor/ShapeGridInteractorTest.kt
index c0f519c..3886690 100644
--- a/tests/robotests/src/com/android/customization/picker/grid/domain/interactor/ShapeGridInteractorTest.kt
+++ b/tests/robotests/src/com/android/customization/picker/grid/domain/interactor/ShapeGridInteractorTest.kt
@@ -96,11 +96,14 @@
     fun selectedShapeOption_shouldUpdateAfterApplyGridOption() =
         testScope.runTest {
             val selectedShapeOption = collectLastValue(underTest.selectedShapeOption)
+            val expectedShapeKey = "circle"
+            val expectedShapeOption =
+                FakeShapeGridManager.DEFAULT_SHAPE_OPTION_LIST.first { it.key == expectedShapeKey }
+                    .copy(isCurrent = true)
 
-            underTest.applySelectedOption("circle", "practical")
+            underTest.applySelectedOption(expectedShapeKey, "practical")
 
-            assertThat(selectedShapeOption())
-                .isEqualTo(FakeShapeGridManager.DEFAULT_SHAPE_OPTION_LIST[4].copy(isCurrent = true))
+            assertThat(selectedShapeOption()).isEqualTo(expectedShapeOption)
         }
 
     @Test
diff --git a/tests/robotests/src/com/android/wallpaper/customization/ui/viewmodel/ShapeGridPickerViewModelTest.kt b/tests/robotests/src/com/android/wallpaper/customization/ui/viewmodel/ShapeGridPickerViewModelTest.kt
index 0bf5125..15d1487 100644
--- a/tests/robotests/src/com/android/wallpaper/customization/ui/viewmodel/ShapeGridPickerViewModelTest.kt
+++ b/tests/robotests/src/com/android/wallpaper/customization/ui/viewmodel/ShapeGridPickerViewModelTest.kt
@@ -116,8 +116,8 @@
         testScope.runTest {
             val shapeOptions = collectLastValue(underTest.shapeOptions)
             val previewingShapeKey = collectLastValue(underTest.previewingShapeKey)
-            val onCircleOptionClicked =
-                shapeOptions()?.get(4)?.onClicked?.let { collectLastValue(it) }
+            val circleOption = shapeOptions()?.firstOrNull { it.key.value == "circle" }
+            val onCircleOptionClicked = circleOption?.onClicked?.let { collectLastValue(it) }
             checkNotNull(onCircleOptionClicked)
 
             onCircleOptionClicked()?.invoke()