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

Commit 510310bc authored by Sam Dubey's avatar Sam Dubey Committed by Android (Google) Code Review
Browse files

Revert "Move isArchived into the PackageItemInfo class."

Revert submission 24706290-archiving.packageItemInfo

Reason for revert: Broke test-suites targets

Reverted changes: /q/submissionid:24706290-archiving.packageItemInfo

Change-Id: I7ec15bd6d204e19a52db5612ea99d120c80e7efa
parent ecd4c4a6
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3798,6 +3798,10 @@ package android.content.pm {
    field @RequiresPermission(android.Manifest.permission.ACCESS_SHORTCUTS) public static final int FLAG_GET_PERSONS_DATA = 2048; // 0x800
  }
  public class PackageInfo implements android.os.Parcelable {
    field public boolean isArchived;
  }
  public class PackageInstaller {
    method @NonNull public android.content.pm.PackageInstaller.InstallInfo readInstallInfo(@NonNull java.io.File, int) throws android.content.pm.PackageInstaller.PackageParsingException;
    method @NonNull public android.content.pm.PackageInstaller.InstallInfo readInstallInfo(@NonNull android.os.ParcelFileDescriptor, @Nullable String, int) throws android.content.pm.PackageInstaller.PackageParsingException;
@@ -3875,7 +3879,6 @@ package android.content.pm {
    method public static void forceSafeLabels();
    method @Deprecated @NonNull public CharSequence loadSafeLabel(@NonNull android.content.pm.PackageManager);
    method @NonNull public CharSequence loadSafeLabel(@NonNull android.content.pm.PackageManager, @FloatRange(from=0) float, int);
    field @FlaggedApi(Flags.FLAG_ARCHIVING) public boolean isArchived;
  }
  public abstract class PackageManager {
+16 −0
Original line number Diff line number Diff line
@@ -18,7 +18,9 @@ package android.content.pm;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.IntentSender;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
@@ -488,6 +490,18 @@ public class PackageInfo implements Parcelable {
     */
    public boolean isActiveApex;

    /**
     * Whether the package is currently in an archived state.
     *
     * <p>Packages can be archived through
     * {@link PackageInstaller#requestArchive(String, IntentSender)} and do not have any APKs stored
     * on the device, but do keep the data directory.
     * @hide
     */
    // TODO(b/278553670) Unhide and update @links before launch.
    @SystemApi
    public boolean isArchived;

    public PackageInfo() {
    }

@@ -575,6 +589,7 @@ public class PackageInfo implements Parcelable {
        }
        dest.writeBoolean(isApex);
        dest.writeBoolean(isActiveApex);
        dest.writeBoolean(isArchived);
        dest.restoreAllowSquashing(prevAllowSquashing);
    }

@@ -640,5 +655,6 @@ public class PackageInfo implements Parcelable {
        }
        isApex = source.readBoolean();
        isActiveApex = source.readBoolean();
        isArchived = source.readBoolean();
    }
}
+0 −17
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import static android.text.TextUtils.SAFE_STRING_FLAG_SINGLE_LINE;
import static android.text.TextUtils.SAFE_STRING_FLAG_TRIM;
import static android.text.TextUtils.makeSafeForPresentation;

import android.annotation.FlaggedApi;
import android.annotation.FloatRange;
import android.annotation.NonNull;
import android.annotation.SystemApi;
@@ -174,18 +173,6 @@ public class PackageItemInfo {
     */
    public int showUserIcon;

    /**
     * Whether the package is currently in an archived state.
     *
     * <p>Packages can be archived through {@link PackageArchiver} and do not have any APKs stored
     * on the device, but do keep the data directory.
     * @hide
     */
    // TODO(b/278553670) Unhide and update @links before launch.
    @SystemApi
    @FlaggedApi(Flags.FLAG_ARCHIVING)
    public boolean isArchived;

    public PackageItemInfo() {
        showUserIcon = UserHandle.USER_NULL;
    }
@@ -202,7 +189,6 @@ public class PackageItemInfo {
        logo = orig.logo;
        metaData = orig.metaData;
        showUserIcon = orig.showUserIcon;
        isArchived = orig.isArchived;
    }

    /**
@@ -456,7 +442,6 @@ public class PackageItemInfo {
        dest.writeBundle(metaData);
        dest.writeInt(banner);
        dest.writeInt(showUserIcon);
        dest.writeBoolean(isArchived);
    }

    /**
@@ -474,7 +459,6 @@ public class PackageItemInfo {
        }
        proto.write(PackageItemInfoProto.ICON, icon);
        proto.write(PackageItemInfoProto.BANNER, banner);
        proto.write(PackageItemInfoProto.IS_ARCHIVED, isArchived);
        proto.end(token);
    }

@@ -489,7 +473,6 @@ public class PackageItemInfo {
        metaData = source.readBundle();
        banner = source.readInt();
        showUserIcon = source.readInt();
        isArchived = source.readBoolean();
    }

    /**
+0 −1
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ message PackageItemInfoProto {
    optional string non_localized_label = 4;
    optional int32 icon = 5;
    optional int32 banner = 6;
    optional bool is_archived = 7;
}

// Proto of android.content.pm.ApplicationInfo which extends PackageItemInfo
+2 −1
Original line number Diff line number Diff line
@@ -1024,7 +1024,7 @@ public class ComputerEngine implements Computer {
        if ("android".equals(packageName) || "system".equals(packageName)) {
            return androidApplication();
        }
        if ((flags & (MATCH_KNOWN_PACKAGES | MATCH_ARCHIVED_PACKAGES)) != 0) {
        if ((flags & MATCH_KNOWN_PACKAGES) != 0) {
            // Already generates the external package name
            return generateApplicationInfoFromSettings(packageName,
                    flags, filterCallingUid, userId);
@@ -1518,6 +1518,7 @@ public class ComputerEngine implements Computer {
            pi.sharedUserId = (sharedUser != null) ? sharedUser.getName() : null;
            pi.firstInstallTime = state.getFirstInstallTimeMillis();
            pi.lastUpdateTime = ps.getLastUpdateTime();
            pi.isArchived = isArchived(state);

            ApplicationInfo ai = new ApplicationInfo();
            ai.packageName = ps.getPackageName();
Loading