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

Commit 328c3223 authored by Jakob Schneider's avatar Jakob Schneider
Browse files

Add the archiving sysprop check to launcher3.

This system property will be used to test the feature
in DVT. This is required because the new device is built on U QPR3, not V. See
https://docs.google.com/document/d/1h8sLlnnhwGP4uZssglBqTShMoQcEq5dvR7jsJmmp0Cw/edit?resourcekey=0-KTFHkPKTdtMN-5kQYBWJig&tab=t.0#heading=h.x9snb54sjlu9  for more details.

Test: tested manually
Flag: ACONFIG com.android.launcher3.enable_support_for_archiving TEAMFOOD

Change-Id: Ie64a40ba799c81057258dd7de3872a0494cff2d8
parent bc663baa
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -109,7 +109,8 @@ public class LauncherAppState implements SafeCloseable {
        launcherApps.registerCallback(callbacks);
        mOnTerminateCallback.add(() ->
                mContext.getSystemService(LauncherApps.class).unregisterCallback(callbacks));
        if (Flags.enableSupportForArchiving()) {

        if (Utilities.enableSupportForArchiving()) {
            ArchiveCompatibilityParams params = new ArchiveCompatibilityParams();
            params.setEnableUnarchivalConfirmation(false);
            launcherApps.setArchiveCompatibility(params);
+6 −0
Original line number Diff line number Diff line
@@ -830,4 +830,10 @@ public final class Utilities {
                // No-Op
        }
    }

    /** Encapsulates two flag checks into a single one. */
    public static boolean enableSupportForArchiving() {
        return Flags.enableSupportForArchiving()
                || getSystemProperty("pm.archiving.enabled", "false").equals("true");
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

package com.android.launcher3.model;

import static com.android.launcher3.Flags.enableSupportForArchiving;
import static com.android.launcher3.model.data.AppInfo.COMPONENT_KEY_COMPARATOR;
import static com.android.launcher3.model.data.AppInfo.EMPTY_ARRAY;
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ARCHIVED;
@@ -34,6 +33,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.launcher3.AppFilter;
import com.android.launcher3.Utilities;
import com.android.launcher3.compat.AlphabeticIndexCompat;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.model.BgDataModel.Callbacks;
@@ -330,7 +330,7 @@ public class AllAppsList {
                            PackageManagerHelper.getLoadingProgress(info),
                            PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING);
                    applicationInfo.intent = launchIntent;
                    if (enableSupportForArchiving()) {
                    if (Utilities.enableSupportForArchiving()) {
                        // In case an app is archived, the respective item flag corresponding to
                        // archiving should also be applied during package updates
                        if (info.getActivityInfo().isArchived) {
+2 −3
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.launcher3.model;

import static com.android.launcher3.BuildConfig.WIDGET_ON_FIRST_SCREEN;
import static com.android.launcher3.Flags.enableLauncherBrMetricsFixed;
import static com.android.launcher3.Flags.enableSupportForArchiving;
import static com.android.launcher3.LauncherPrefs.IS_FIRST_LOAD_AFTER_RESTORE;
import static com.android.launcher3.LauncherPrefs.SHOULD_SHOW_SMARTSPACE;
import static com.android.launcher3.LauncherSettings.Favorites.ITEM_TYPE_APP_PAIR;
@@ -421,7 +420,7 @@ public class LoaderTask implements Runnable {

            final HashMap<PackageUserKey, SessionInfo> installingPkgs =
                    mSessionHelper.getActiveSessions();
            if (enableSupportForArchiving()) {
            if (Utilities.enableSupportForArchiving()) {
                mInstallingPkgsCached = installingPkgs;
            }
            installingPkgs.forEach(mApp.getIconCache()::updateSessionCache);
@@ -656,7 +655,7 @@ public class LoaderTask implements Runnable {
            for (int i = 0; i < apps.size(); i++) {
                LauncherActivityInfo app = apps.get(i);
                AppInfo appInfo = new AppInfo(app, mUserCache.getUserInfo(user), quietMode);
                if (enableSupportForArchiving() && app.getApplicationInfo().isArchived) {
                if (Utilities.enableSupportForArchiving() && app.getApplicationInfo().isArchived) {
                    // For archived apps, include progress info in case there is a pending
                    // install session post restart of device.
                    String appPackageName = app.getApplicationInfo().packageName;
+2 −2
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
 */
package com.android.launcher3.model;

import static com.android.launcher3.Flags.enableSupportForArchiving;
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_PRIVATE_PROFILE_QUIET_MODE_ENABLED;
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_QUIET_MODE_ENABLED;
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_WORK_PROFILE_QUIET_MODE_ENABLED;
@@ -39,6 +38,7 @@ import com.android.launcher3.Flags;
import com.android.launcher3.LauncherAppState;
import com.android.launcher3.LauncherSettings;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.icons.IconCache;
import com.android.launcher3.logging.FileLog;
@@ -274,7 +274,7 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
                                    PackageInstallInfo.STATUS_INSTALLED_DOWNLOADING);
                            // In case an app is archived, we need to make sure that archived state
                            // in WorkspaceItemInfo is refreshed.
                            if (enableSupportForArchiving() && !activities.isEmpty()) {
                            if (Utilities.enableSupportForArchiving() && !activities.isEmpty()) {
                                boolean newArchivalState = activities.get(
                                        0).getActivityInfo().isArchived;
                                if (newArchivalState != si.isArchived()) {
Loading