Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 62b60a16 authored by Kunhung Li's avatar Kunhung Li
Browse files

Refactor getCollectionIdHashCode()

Rename it to getIdHashCode() to let it be used for both collection id
and wallpaper id.

Bug: 220088526
Test: manual
Change-Id: I5e42c117b0585b744579297464881e308bde763d
parent bdf34222
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -80,20 +80,20 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
    @Override
    public void logActionClicked(String collectionId, int actionLabelResId) {
        SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.WALLPAPER_EXPLORE, 0, 0, 0, 0, 0,
                getCollectionIdHashCode(collectionId), 0, 0, 0, 0, 0, 0, 0);
                getIdHashCode(collectionId), 0, 0, 0, 0, 0, 0, 0);
    }

    @Override
    public void logIndividualWallpaperSelected(String collectionId) {
        SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.WALLPAPER_SELECT, 0, 0, 0, 0, 0,
                getCollectionIdHashCode(collectionId), 0, 0, 0, 0, 0, 0, 0);
                getIdHashCode(collectionId), 0, 0, 0, 0, 0, 0, 0);
    }

    @Override
    public void logCategorySelected(String collectionId) {
        SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.WALLPAPER_OPEN_CATEGORY,
                0, 0, 0, 0, 0,
                getCollectionIdHashCode(collectionId),
                getIdHashCode(collectionId),
                0, 0, 0, 0, 0, 0, 0);
    }

@@ -101,8 +101,8 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
    public void logLiveWallpaperInfoSelected(String collectionId, @Nullable String wallpaperId) {
        SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.LIVE_WALLPAPER_INFO_SELECT,
                0, 0, 0, 0, 0,
                getCollectionIdHashCode(collectionId),
                wallpaperId != null ? wallpaperId.hashCode() : 0,
                getIdHashCode(collectionId),
                getIdHashCode(wallpaperId),
                0, 0, 0, 0, 0, 0);
    }

@@ -111,8 +111,8 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
            @Nullable String wallpaperId) {
        SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.LIVE_WALLPAPER_CUSTOMIZE_SELECT,
                0, 0, 0, 0, 0,
                getCollectionIdHashCode(collectionId),
                wallpaperId != null ? wallpaperId.hashCode() : 0,
                getIdHashCode(collectionId),
                getIdHashCode(wallpaperId),
                0, 0, 0, 0, 0, 0);
    }

@@ -121,8 +121,8 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
            @Nullable String effects) {
        SysUiStatsLog.write(STYLE_UI_CHANGED, StyleEnums.WALLPAPER_APPLIED,
                0, 0, 0, 0, 0,
                getCollectionIdHashCode(collectionId),
                wallpaperId != null ? wallpaperId.hashCode() : 0,
                getIdHashCode(collectionId),
                getIdHashCode(wallpaperId),
                0, 0, 0, 0, 0, effects != null ? effects.hashCode() : 0);
    }

@@ -225,7 +225,7 @@ public class StatsLogUserEventLogger extends NoOpUserEventLogger implements Them
        }
    }

    private int getCollectionIdHashCode(String collectionId) {
        return collectionId != null ? collectionId.hashCode() : 0;
    private int getIdHashCode(String id) {
        return id != null ? id.hashCode() : 0;
    }
}