Snap for 5671315 from 7c4d2248172cbfa5dd8856fada40f981c7a8f93c to qt-aml-release

Change-Id: I767d21e2048427109a6bbba326fd02fe1c1a10a4
diff --git a/res/layout/fragment_custom_theme_component.xml b/res/layout/fragment_custom_theme_component.xml
index 13b0b33..314480f 100644
--- a/res/layout/fragment_custom_theme_component.xml
+++ b/res/layout/fragment_custom_theme_component.xml
@@ -78,6 +78,7 @@
             android:layout_marginBottom="10dp"
             android:textAlignment="center"
             android:textAppearance="@style/HeaderTextAppearance"
+            android:textSize="@dimen/component_options_title_size"
             app:layout_constraintEnd_toEndOf="parent"
             app:layout_constraintStart_toStartOf="parent"
             app:layout_constraintTop_toBottomOf="@+id/guideline"/>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 51e4a83..00b2bed 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -99,6 +99,7 @@
     <dimen name="component_shape_thumb_size">72dp</dimen>
     <dimen name="option_border_width">2dp</dimen>
     <dimen name="option_selected_border_width">3dp</dimen>
+    <dimen name="component_options_title_size">18sp</dimen>
 
     <!-- For a corner radius of this size or larger, we'll preview a rounded qsb widget. -->
     <dimen name="roundCornerThreshold">16dp</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index fd24414..dd8e18d 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -55,9 +55,7 @@
     </style>
 
     <!-- Common components and widgets -->
-    <style name="HeaderTextAppearance" parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title">
-        <item name="android:textFontWeight">400</item>
-    </style>
+    <style name="HeaderTextAppearance" parent="@android:style/TextAppearance.DeviceDefault.Widget.ActionBar.Title"/>
 
     <style name="ActionPrimaryButton" parent="android:Widget.DeviceDefault.Button.Colored"/>
 
diff --git a/src/com/android/customization/module/StatsLogUserEventLogger.java b/src/com/android/customization/module/StatsLogUserEventLogger.java
index 8762b20..07d8c1d 100644
--- a/src/com/android/customization/module/StatsLogUserEventLogger.java
+++ b/src/com/android/customization/module/StatsLogUserEventLogger.java
@@ -20,6 +20,7 @@
 
 import androidx.annotation.Nullable;
 
+import com.android.systemui.shared.system.StatsLogCompat;
 import com.android.customization.model.clock.Clockface;
 import com.android.customization.model.grid.GridOption;
 import com.android.customization.model.theme.ThemeBundle;
@@ -41,70 +42,40 @@
 
     @Override
     public void logResumed() {
-        Log.d(TAG, String.format("logResumed: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.ONRESUME,
-                0, 0, 0, 0, 0, 0, 0));
-//        StatsLogCompat.write(StyleEnums.ONRESUME,
-//                0, 0, 0, 0, 0, 0, 0);
+        StatsLogCompat.write(StyleEnums.ONRESUME, 0, 0, 0, 0, 0, 0, 0, 0, 0);
     }
 
     @Override
     public void logStopped() {
-        Log.d(TAG, String.format("logStopped: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.ONSTOP,
-                0, 0, 0, 0, 0, 0, 0));
-//        StatsLogCompat.write(StyleEnums.ONSTOP,
-//                0, 0, 0, 0, 0, 0, 0);
+        StatsLogCompat.write(StyleEnums.ONSTOP, 0, 0, 0, 0, 0, 0, 0, 0, 0);
     }
 
     @Override
     public void logActionClicked(String collectionId, int actionLabelResId) {
-        Log.d(TAG, String.format("logActionClicked: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.WALLPAPER_EXPLORE,
-                0, 0, 0, 0, 0,
-                collectionId.hashCode(),
-                0));
-//        StatsLogCompat.write(StyleEnums.WALLPAPER_EXPLORE,
-//                0, 0, 0, 0, 0,
-//                collectionId.hashCode(),
-//                0));
+        StatsLogCompat.write(StyleEnums.WALLPAPER_EXPLORE, 0, 0, 0, 0, 0, collectionId.hashCode(),
+                0, 0, 0);
     }
 
     @Override
     public void logIndividualWallpaperSelected(String collectionId) {
-        Log.d(TAG, String.format("logIndividualWallpaperSelected: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.WALLPAPER_SELECT,
-                0, 0, 0, 0, 0, 0,
-                collectionId.hashCode()));
-//        StatsLogCompat.write(StyleEnums.WALLPAPER_SELECT,
-//                0, 0, 0, 0, 0, 0,
-//                collectionId.hashCode());
+        StatsLogCompat.write(StyleEnums.WALLPAPER_SELECT, 0, 0, 0, 0, 0, 0,
+                collectionId.hashCode(), 0, 0);
     }
 
     @Override
     public void logCategorySelected(String collectionId) {
-        Log.d(TAG, String.format("logCategorySelected: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.WALLPAPER_SELECT,
+        StatsLogCompat.write(StyleEnums.WALLPAPER_SELECT,
                 0, 0, 0, 0, 0,
                 collectionId.hashCode(),
-                0));
-//        StatsLogCompat.write(StyleEnums.WALLPAPER_SELECT,
-//                0, 0, 0, 0, 0,
-//                collectionId.hashCode(),
-//                0);
+                0, 0, 0);
     }
 
     @Override
     public void logWallpaperSet(String collectionId, @Nullable String wallpaperId) {
-        Log.d(TAG, String.format("logWallpaperSet: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.WALLPAPER_APPLIED,
+        StatsLogCompat.write(StyleEnums.WALLPAPER_SELECT,
                 0, 0, 0, 0, 0,
                 collectionId.hashCode(),
-                Objects.hashCode(wallpaperId)));
-//        StatsLogCompat.write(StyleEnums.WALLPAPER_SELECT,
-//                0, 0, 0, 0, 0,
-//                collectionId.hashCode(),
-//                0);
+                0, 0, 0);
     }
 
     @Nullable
@@ -115,83 +86,51 @@
 
     @Override
     public void logThemeSelected(ThemeBundle theme, boolean isCustomTheme) {
-        Log.d(TAG, String.format("logThemeSelected: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.PICKER_SELECT,
+        StatsLogCompat.write(StyleEnums.PICKER_SELECT,
                 Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_COLOR)),
                 Objects.hashCode(getThemePackage(theme,OVERLAY_CATEGORY_FONT)),
                 Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_SHAPE)),
-                0, 0, 0, 0));
-//        StatsLogCompat.write(StyleEnums.PICKER_SELECT,
-//                Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_COLOR)),
-//                Objects.hashCode(getThemePackage(theme,OVERLAY_CATEGORY_FONT)),
-//                Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_SHAPE)),
-//                0, 0, 0, 0);
+                0, 0, 0, 0, 0, 0);
     }
 
     @Override
     public void logThemeApplied(ThemeBundle theme, boolean isCustomTheme) {
-        Log.d(TAG, String.format("logThemeApplied: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.PICKER_APPLIED,
+        StatsLogCompat.write(StyleEnums.PICKER_APPLIED,
                 Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_COLOR)),
                 Objects.hashCode(getThemePackage(theme,OVERLAY_CATEGORY_FONT)),
                 Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_SHAPE)),
-                0, 0, 0, 0));
-//        StatsLogCompat.write(StyleEnums.PICKER_APPLIED,
-//        Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_COLOR)),
-//        Objects.hashCode(getThemePackage(theme,OVERLAY_CATEGORY_FONT)),
-//        Objects.hashCode(getThemePackage(theme, OVERLAY_CATEGORY_SHAPE)),
-//                0, 0, 0, 0);
+                0, 0, 0, 0, 0, 0);
     }
 
     @Override
     public void logClockSelected(Clockface clock) {
-        Log.d(TAG, String.format("logClockSelected: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.PICKER_SELECT,
+        StatsLogCompat.write(StyleEnums.PICKER_SELECT,
                 0, 0, 0,
                 Objects.hashCode(clock.getId()),
-                0, 0, 0));
-//        StatsLogCompat.write(StyleEnums.PICKER_SELECT,
-//        0, 0, 0,
-//        Objects.hashCode(clock.getId()),
-//        0, 0, 0));
+                0, 0, 0, 0, 0);
     }
 
     @Override
     public void logClockApplied(Clockface clock) {
-        Log.d(TAG, String.format("logClockApplied: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.PICKER_APPLIED,
+        StatsLogCompat.write(StyleEnums.PICKER_APPLIED,
                 0, 0, 0,
                 Objects.hashCode(clock.getId()),
-                0, 0, 0));
-//        StatsLogCompat.write(StyleEnums.PICKER_APPLIED,
-//        0, 0, 0,
-//        Objects.hashCode(clock.getId()),
-//        0, 0, 0));
+                0, 0, 0, 0, 0);
     }
 
     @Override
     public void logGridSelected(GridOption grid) {
-        Log.d(TAG, String.format("logGridSelected: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.PICKER_SELECT,
+        StatsLogCompat.write(StyleEnums.PICKER_SELECT,
                 0, 0, 0, 0,
                 grid.cols,
-                0, 0));
-//        StatsLogCompat.write(StyleEnums.PICKER_SELECT,
-//        0, 0, 0, 0,
-//        Objects.hashCode(clock.getId()),
-//        0, 0));
+                0, 0, 0, 0);
     }
 
     @Override
     public void logGridApplied(GridOption grid) {
-        Log.d(TAG, String.format("logGridApplied: %d, %d, %d, %d, %d, %d, %d, %d",
-                StyleEnums.PICKER_APPLIED,
+        StatsLogCompat.write(StyleEnums.PICKER_APPLIED,
                 0, 0, 0, 0,
                 grid.cols,
-                0, 0));
-//        StatsLogCompat.write(StyleEnums.PICKER_APPLIED,
-//        0, 0, 0, 0,
-//        Objects.hashCode(clock.getId()),
-//        0, 0));
+                0, 0, 0, 0);
     }
 }
diff --git a/src/com/android/customization/widget/OptionSelectorController.java b/src/com/android/customization/widget/OptionSelectorController.java
index 5e3a423..9c92079 100644
--- a/src/com/android/customization/widget/OptionSelectorController.java
+++ b/src/com/android/customization/widget/OptionSelectorController.java
@@ -311,6 +311,7 @@
             if (labelView != null && !TextUtils.isEmpty(labelView.getText())) {
                 labelView.setContentDescription(cd);
             } else if (tileView != null) {
+                tileView.setAccessibilityPaneTitle(cd);
                 tileView.setContentDescription(cd);
             }
         }
@@ -319,6 +320,7 @@
             if (labelView != null && !TextUtils.isEmpty(labelView.getText())) {
                 labelView.setContentDescription(title);
             } else if (tileView != null) {
+                tileView.setAccessibilityPaneTitle(title);
                 tileView.setContentDescription(title);
             }
         }