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

Commit 1f06c5b4 authored by Thales Lima's avatar Thales Lima
Browse files

launcher: use correct preference key on SettingsChangeLogger

The previous key was related to hotseat and not to the workspace size.

Fixes 184981523
Test: debugging and logcat logging

Change-Id: I445264ac0c4fb9ab99e31f96b7257271b730e2da
parent cd777a3f
Loading
Loading
Loading
Loading
+23 −19
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.quickstep.logging;

import static com.android.launcher3.InvariantDeviceProfile.KEY_MIGRATION_SRC_HOTSEAT_COUNT;
import static com.android.launcher3.InvariantDeviceProfile.KEY_MIGRATION_SRC_WORKSPACE_SIZE;
import static com.android.launcher3.Utilities.getDevicePrefs;
import static com.android.launcher3.Utilities.getPrefs;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_GRID_SIZE_2;
@@ -43,6 +43,7 @@ import android.util.Xml;

import com.android.launcher3.AutoInstallsLayout;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.InstanceIdSequence;
import com.android.launcher3.logging.StatsLogManager;
@@ -133,7 +134,8 @@ public class SettingsChangeLogger implements

    @Override
    public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
        if (LAST_PREDICTION_ENABLED_STATE.equals(key) || KEY_MIGRATION_SRC_HOTSEAT_COUNT.equals(key)
        if (LAST_PREDICTION_ENABLED_STATE.equals(key)
                || KEY_MIGRATION_SRC_WORKSPACE_SIZE.equals(key)
                || mLoggablePrefs.containsKey(key)) {
            dispatchUserEvent();
        }
@@ -153,8 +155,9 @@ public class SettingsChangeLogger implements

        SharedPreferences prefs = getPrefs(mContext);
        StatsLogManager.LauncherEvent gridSizeChangedEvent = null;
        // TODO(b/184981523): This doesn't work for 2-panel grid, which has 6 hotseat icons
        switch (prefs.getInt(KEY_MIGRATION_SRC_HOTSEAT_COUNT, -1)) {
        String workspaceSize = prefs.getString(KEY_MIGRATION_SRC_WORKSPACE_SIZE, null);
        if (workspaceSize != null) {
            switch (Utilities.parsePoint(workspaceSize).x) {
                case 5:
                    gridSizeChangedEvent = LAUNCHER_GRID_SIZE_5;
                    break;
@@ -171,6 +174,7 @@ public class SettingsChangeLogger implements
                    // Ignore illegal input.
                    break;
            }
        }
        if (gridSizeChangedEvent != null) {
            logger.log(gridSizeChangedEvent);
        }