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

Commit 2f609d09 authored by Jakob Schneider's avatar Jakob Schneider
Browse files

Initialize the archiving compat options during launcher3 startup.

This just sets an OP_CODE (cheap operation). It disables a help-dialog
for launchers who have not implemented archiving.

Test: PackageInstallerArchiveTest and also manually
Bug: 302114748
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving DEVELOPMENT
Change-Id: Ifa9335d7ad250218eec3863dcdd986118bba007c
parent 2e117698
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ public class LauncherAppState implements SafeCloseable {
        return mContext;
    }

    @SuppressWarnings("NewApi")
    public LauncherAppState(Context context) {
        this(context, LauncherFiles.APP_ICONS_DB);
        Log.v(Launcher.TAG, "LauncherAppState initiated");
@@ -103,9 +104,14 @@ public class LauncherAppState implements SafeCloseable {
        });

        ModelLauncherCallbacks callbacks = mModel.newModelCallbacks();
        mContext.getSystemService(LauncherApps.class).registerCallback(callbacks);
        LauncherApps launcherApps = mContext.getSystemService(LauncherApps.class);
        launcherApps.registerCallback(callbacks);
        mOnTerminateCallback.add(() ->
                mContext.getSystemService(LauncherApps.class).unregisterCallback(callbacks));
        if (Flags.enableSupportForArchiving()) {
            launcherApps.setArchiveCompatibilityOptions(/* enableIconOverlay= */ true,
                    /* enableUnarchivalConfirmation= */ false);
        }

        SimpleBroadcastReceiver modelChangeReceiver =
                new SimpleBroadcastReceiver(mModel::onBroadcastIntent);