summaryrefslogtreecommitdiff
path: root/src/com
diff options
context:
space:
mode:
authorGeorge Lin <giolin@google.com>2023-10-17 20:27:05 +0000
committerGeorge Lin <giolin@google.com>2023-10-24 21:52:21 +0000
commit540bf2a924c34d1febfe6cc1391f122df520b641 (patch)
treebad010935591253a06d8ada9ed6893e24019c6df /src/com
parenta5b2679b1140bd136a5b7277bfc281032087060b (diff)
downloadThemePicker-540bf2a924c34d1febfe6cc1391f122df520b641.tar.gz
[WPP logging] Wire logThemedIconApplied (1/2)
Test: Manually tested. See bug. Fixes: 305753673 Flag: NONE Change-Id: If87ece0f3f64f9a99b1cdd299f6bd1eae1aa7c9e
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/customization/model/themedicon/ThemedIconSectionController.java7
-rw-r--r--src/com/android/customization/module/DefaultCustomizationSections.java9
-rw-r--r--src/com/android/customization/module/ThemePickerInjector.kt1
3 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/customization/model/themedicon/ThemedIconSectionController.java b/src/com/android/customization/model/themedicon/ThemedIconSectionController.java
index 5d551a6a..6c738c70 100644
--- a/src/com/android/customization/model/themedicon/ThemedIconSectionController.java
+++ b/src/com/android/customization/model/themedicon/ThemedIconSectionController.java
@@ -24,6 +24,7 @@ import androidx.lifecycle.Observer;
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 @@ public class ThemedIconSectionController implements
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 @@ public class ThemedIconSectionController implements
ThemedIconSwitchProvider themedIconOptionsProvider,
ThemedIconInteractor interactor,
@Nullable Bundle savedInstanceState,
- ThemedIconSnapshotRestorer snapshotRestorer) {
+ ThemedIconSnapshotRestorer snapshotRestorer,
+ ThemesUserEventLogger themesUserEventLogger) {
mThemedIconOptionsProvider = themedIconOptionsProvider;
mInteractor = interactor;
mSnapshotRestorer = snapshotRestorer;
@@ -55,6 +58,7 @@ public class ThemedIconSectionController implements
mThemedIconSectionView.getSwitch().setChecked(isActivated);
}
};
+ mThemesUserEventLogger = themesUserEventLogger;
if (savedInstanceState != null) {
mSavedThemedIconEnabled = savedInstanceState.getBoolean(
@@ -91,6 +95,7 @@ public class ThemedIconSectionController implements
}
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 fdc2a8e1..8347d03c 100644
--- a/src/com/android/customization/module/DefaultCustomizationSections.java
+++ b/src/com/android/customization/module/DefaultCustomizationSections.java
@@ -13,6 +13,7 @@ import com.android.customization.model.themedicon.ThemedIconSectionController;
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;
@@ -56,6 +57,7 @@ public final class DefaultCustomizationSections implements CustomizationSections
private final ThemedIconSnapshotRestorer mThemedIconSnapshotRestorer;
private final ThemedIconInteractor mThemedIconInteractor;
private final ColorPickerInteractor mColorPickerInteractor;
+ private final ThemesUserEventLogger mThemesUserEventLogger;
public DefaultCustomizationSections(
ColorPickerViewModel.Factory colorPickerViewModelFactory,
@@ -67,7 +69,8 @@ public final class DefaultCustomizationSections implements CustomizationSections
ClockViewFactory clockViewFactory,
ThemedIconSnapshotRestorer themedIconSnapshotRestorer,
ThemedIconInteractor themedIconInteractor,
- ColorPickerInteractor colorPickerInteractor) {
+ ColorPickerInteractor colorPickerInteractor,
+ ThemesUserEventLogger themesUserEventLogger) {
mColorPickerViewModelFactory = colorPickerViewModelFactory;
mKeyguardQuickAffordancePickerViewModelFactory =
keyguardQuickAffordancePickerViewModelFactory;
@@ -78,6 +81,7 @@ public final class DefaultCustomizationSections implements CustomizationSections
mThemedIconSnapshotRestorer = themedIconSnapshotRestorer;
mThemedIconInteractor = themedIconInteractor;
mColorPickerInteractor = colorPickerInteractor;
+ mThemesUserEventLogger = themesUserEventLogger;
}
@Override
@@ -184,7 +188,8 @@ public final class DefaultCustomizationSections implements CustomizationSections
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 3ec7753f..9e3bdc84 100644
--- a/src/com/android/customization/module/ThemePickerInjector.kt
+++ b/src/com/android/customization/module/ThemePickerInjector.kt
@@ -147,6 +147,7 @@ internal constructor(
getThemedIconSnapshotRestorer(appContext),
getThemedIconInteractor(),
getColorPickerInteractor(appContext, getWallpaperColorsRepository()),
+ getUserEventLogger(appContext),
)
.also { customizationSections = it }
}