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

Commit c5e0fb94 authored by Hyunyoung Song's avatar Hyunyoung Song Committed by Android (Google) Code Review
Browse files

Merge "Icon size should update when grid config changes" into ub-launcher3-master

parents abdb80a6 31971a3b
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -153,7 +153,8 @@ import androidx.annotation.Nullable;
 * Default launcher application.
 */
public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        LauncherModel.Callbacks, LauncherProviderChangeListener, UserEventDelegate{
        LauncherModel.Callbacks, LauncherProviderChangeListener, UserEventDelegate,
        InvariantDeviceProfile.OnIDPChangeListener {
    public static final String TAG = "Launcher";
    static final boolean LOGD = false;

@@ -285,8 +286,9 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        LauncherAppState app = LauncherAppState.getInstance(this);
        mOldConfig = new Configuration(getResources().getConfiguration());
        mModel = app.setLauncher(this);
        initDeviceProfile(app.getInvariantDeviceProfile());

        InvariantDeviceProfile idp = app.getInvariantDeviceProfile();
        initDeviceProfile(idp);
        idp.addOnChangeListener(this);
        mSharedPrefs = Utilities.getPrefs(this);
        mIconCache = app.getIconCache();
        mAccessibilityDelegate = new LauncherAccessibilityDelegate(this);
@@ -406,6 +408,12 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
        }
    }

    @Override
    public void onIdpChanged(int changeFlags, InvariantDeviceProfile idp) {
        initDeviceProfile(idp);
        getRootView().dispatchInsets();
    }

    private void initDeviceProfile(InvariantDeviceProfile idp) {
        // Load configuration-specific DeviceProfile
        mDeviceProfile = idp.getDeviceProfile(this);
@@ -1322,7 +1330,7 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,

        TextKeyListener.getInstance().release();
        clearPendingBinds();

        LauncherAppState.getIDP(this).removeOnChangeListener(this);
        if (mLauncherCallbacks != null) {
            mLauncherCallbacks.onDestroy();
        }