Merge "[WPP logging] Wire logDarkThemeApplied" into main
diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml
index f6b7c36..0437437 100644
--- a/res/values-uk/strings.xml
+++ b/res/values-uk/strings.xml
@@ -17,7 +17,7 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="app_name" msgid="1647136562008520313">"Оформлення і стиль"</string>
+    <string name="app_name" msgid="1647136562008520313">"Оформлення й стиль"</string>
     <string name="theme_title" msgid="2144932106319405101">"Стиль"</string>
     <string name="clock_title" msgid="1974314575211361352">"Свій циферблат"</string>
     <string name="clock_description" msgid="3563839327378948">"Виберіть свій циферблат"</string>
diff --git a/src/com/android/customization/model/themedicon/ThemedIconSectionController.java b/src/com/android/customization/model/themedicon/ThemedIconSectionController.java
index 5d551a6..6c738c7 100644
--- a/src/com/android/customization/model/themedicon/ThemedIconSectionController.java
+++ b/src/com/android/customization/model/themedicon/ThemedIconSectionController.java
@@ -24,6 +24,7 @@
 
 import com.android.customization.model.themedicon.domain.interactor.ThemedIconInteractor;
 import com.android.customization.model.themedicon.domain.interactor.ThemedIconSnapshotRestorer;
+import com.android.customization.module.logging.ThemesUserEventLogger;
 import com.android.customization.picker.themedicon.ThemedIconSectionView;
 import com.android.wallpaper.R;
 import com.android.wallpaper.model.CustomizationSectionController;
@@ -38,6 +39,7 @@
     private final ThemedIconInteractor mInteractor;
     private final ThemedIconSnapshotRestorer mSnapshotRestorer;
     private final Observer<Boolean> mIsActivatedChangeObserver;
+    private final ThemesUserEventLogger mThemesUserEventLogger;
 
     private ThemedIconSectionView mThemedIconSectionView;
     private boolean mSavedThemedIconEnabled = false;
@@ -46,7 +48,8 @@
             ThemedIconSwitchProvider themedIconOptionsProvider,
             ThemedIconInteractor interactor,
             @Nullable Bundle savedInstanceState,
-            ThemedIconSnapshotRestorer snapshotRestorer) {
+            ThemedIconSnapshotRestorer snapshotRestorer,
+            ThemesUserEventLogger themesUserEventLogger) {
         mThemedIconOptionsProvider = themedIconOptionsProvider;
         mInteractor = interactor;
         mSnapshotRestorer = snapshotRestorer;
@@ -55,6 +58,7 @@
                 mThemedIconSectionView.getSwitch().setChecked(isActivated);
             }
         };
+        mThemesUserEventLogger = themesUserEventLogger;
 
         if (savedInstanceState != null) {
             mSavedThemedIconEnabled = savedInstanceState.getBoolean(
@@ -91,6 +95,7 @@
         }
         mThemedIconOptionsProvider.setThemedIconEnabled(viewActivated);
         mInteractor.setActivated(viewActivated);
+        mThemesUserEventLogger.logThemedIconApplied(viewActivated);
         mSnapshotRestorer.store(viewActivated);
     }
 
diff --git a/src/com/android/customization/module/DefaultCustomizationSections.java b/src/com/android/customization/module/DefaultCustomizationSections.java
index 460a848..c507dd9 100644
--- a/src/com/android/customization/module/DefaultCustomizationSections.java
+++ b/src/com/android/customization/module/DefaultCustomizationSections.java
@@ -14,6 +14,7 @@
 import com.android.customization.model.themedicon.ThemedIconSwitchProvider;
 import com.android.customization.model.themedicon.domain.interactor.ThemedIconInteractor;
 import com.android.customization.model.themedicon.domain.interactor.ThemedIconSnapshotRestorer;
+import com.android.customization.module.logging.ThemesUserEventLogger;
 import com.android.customization.picker.clock.ui.view.ClockViewFactory;
 import com.android.customization.picker.clock.ui.viewmodel.ClockCarouselViewModel;
 import com.android.customization.picker.color.domain.interactor.ColorPickerInteractor;
@@ -58,6 +59,7 @@
     private final ThemedIconSnapshotRestorer mThemedIconSnapshotRestorer;
     private final ThemedIconInteractor mThemedIconInteractor;
     private final ColorPickerInteractor mColorPickerInteractor;
+    private final ThemesUserEventLogger mThemesUserEventLogger;
 
     public DefaultCustomizationSections(
             ColorPickerViewModel.Factory colorPickerViewModelFactory,
@@ -70,7 +72,8 @@
             DarkModeSnapshotRestorer darkModeSnapshotRestorer,
             ThemedIconSnapshotRestorer themedIconSnapshotRestorer,
             ThemedIconInteractor themedIconInteractor,
-            ColorPickerInteractor colorPickerInteractor) {
+            ColorPickerInteractor colorPickerInteractor,
+            ThemesUserEventLogger themesUserEventLogger) {
         mColorPickerViewModelFactory = colorPickerViewModelFactory;
         mKeyguardQuickAffordancePickerViewModelFactory =
                 keyguardQuickAffordancePickerViewModelFactory;
@@ -82,6 +85,7 @@
         mThemedIconSnapshotRestorer = themedIconSnapshotRestorer;
         mThemedIconInteractor = themedIconInteractor;
         mColorPickerInteractor = colorPickerInteractor;
+        mThemesUserEventLogger = themesUserEventLogger;
     }
 
     @Override
@@ -188,7 +192,8 @@
                                 ThemedIconSwitchProvider.getInstance(activity),
                                 mThemedIconInteractor,
                                 savedInstanceState,
-                                mThemedIconSnapshotRestorer));
+                                mThemedIconSnapshotRestorer,
+                                mThemesUserEventLogger));
 
                 // App grid section.
                 sectionControllers.add(
diff --git a/src/com/android/customization/module/ThemePickerInjector.kt b/src/com/android/customization/module/ThemePickerInjector.kt
index 74e28b2..8433a7c 100644
--- a/src/com/android/customization/module/ThemePickerInjector.kt
+++ b/src/com/android/customization/module/ThemePickerInjector.kt
@@ -145,6 +145,7 @@
                     getThemedIconSnapshotRestorer(activity),
                     getThemedIconInteractor(),
                     getColorPickerInteractor(activity, getWallpaperColorsRepository()),
+                    getUserEventLogger(activity.applicationContext),
                 )
                 .also { customizationSections = it }
     }