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

Commit b6e9a13d authored by thiruram's avatar thiruram Committed by Automerger Merge Worker
Browse files

Log LAUNCHER_FOLDER_AUTO_LABELING_SKIPPED events. am: 8bcb48cc

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/11938960

Change-Id: I3edbb34c3162e452ef002c2495d4aeebc1201ac3
parents 7fa1c8a2 8bcb48cc
Loading
Loading
Loading
Loading
+16 −1
Original line number Original line Diff line number Diff line
@@ -21,6 +21,8 @@ import static android.text.TextUtils.isEmpty;
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.MAX_NUM_ITEMS_IN_PREVIEW;
import static com.android.launcher3.folder.ClippedFolderIconLayoutRule.MAX_NUM_ITEMS_IN_PREVIEW;
import static com.android.launcher3.folder.PreviewItemManager.INITIAL_ITEM_ANIMATION_DURATION;
import static com.android.launcher3.folder.PreviewItemManager.INITIAL_ITEM_ANIMATION_DURATION;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_AUTO_LABELED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_AUTO_LABELED;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_AUTO_LABELING_SKIPPED_EMPTY_PRIMARY;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_AUTO_LABELING_SKIPPED_EMPTY_SUGGESTIONS;


import android.animation.Animator;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorListenerAdapter;
@@ -82,6 +84,7 @@ import com.android.launcher3.widget.PendingAddShortcutInfo;
import java.util.ArrayList;
import java.util.ArrayList;
import java.util.List;
import java.util.List;
import java.util.function.Predicate;
import java.util.function.Predicate;
import java.util.stream.Stream;


/**
/**
 * An icon that can appear on in the workspace representing an {@link Folder}.
 * An icon that can appear on in the workspace representing an {@link Folder}.
@@ -445,7 +448,19 @@ public class FolderIcon extends FrameLayout implements FolderListener, IconLabel
                || mInfo.hasOption(FolderInfo.FLAG_MANUAL_FOLDER_NAME)) {
                || mInfo.hasOption(FolderInfo.FLAG_MANUAL_FOLDER_NAME)) {
            return;
            return;
        }
        }
        if (nameInfos == null || nameInfos[0] == null || isEmpty(nameInfos[0].getLabel())) {
        if (nameInfos == null || Stream.of(nameInfos)
                .allMatch(nameInfo -> nameInfo == null || isEmpty(nameInfo.getLabel()))) {
            StatsLogManager.newInstance(getContext()).logger()
                    .withInstanceId(instanceId)
                    .withItemInfo(mInfo)
                    .log(LAUNCHER_FOLDER_AUTO_LABELING_SKIPPED_EMPTY_SUGGESTIONS);
            return;
        }
        if (nameInfos[0] == null || isEmpty(nameInfos[0].getLabel())) {
            StatsLogManager.newInstance(getContext()).logger()
                    .withInstanceId(instanceId)
                    .withItemInfo(mInfo)
                    .log(LAUNCHER_FOLDER_AUTO_LABELING_SKIPPED_EMPTY_PRIMARY);
            return;
            return;
        }
        }
        CharSequence newTitle = nameInfos[0].getLabel();
        CharSequence newTitle = nameInfos[0].getLabel();
+6 −0
Original line number Original line Diff line number Diff line
@@ -71,6 +71,12 @@ public class StatsLogManager implements ResourceBasedOverride {
        @UiEvent(doc = "Folder's label is automatically assigned.")
        @UiEvent(doc = "Folder's label is automatically assigned.")
        LAUNCHER_FOLDER_AUTO_LABELED(591),
        LAUNCHER_FOLDER_AUTO_LABELED(591),


        @UiEvent(doc = "Could not auto-label a folder because primary suggestion is null or empty.")
        LAUNCHER_FOLDER_AUTO_LABELING_SKIPPED_EMPTY_PRIMARY(592),

        @UiEvent(doc = "Could not auto-label a folder because no suggestions exist.")
        LAUNCHER_FOLDER_AUTO_LABELING_SKIPPED_EMPTY_SUGGESTIONS(593),

        @UiEvent(doc = "User manually updated the folder label.")
        @UiEvent(doc = "User manually updated the folder label.")
        LAUNCHER_FOLDER_LABEL_UPDATED(460),
        LAUNCHER_FOLDER_LABEL_UPDATED(460),