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

Commit 7267e3ef authored by Winson Chiu's avatar Winson Chiu Committed by Android (Google) Code Review
Browse files

Merge "Deprecate PackageParser#Package"

parents 53f1ee4b 243e7ea1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -305,7 +305,7 @@ java_defaults {

    exclude_srcs: [
        // See comment on framework-atb-backward-compatibility module below
        "core/java/android/content/pm/AndroidTestBaseUpdater.java",
        "core/java/android/content/pm/parsing/library/AndroidTestBaseUpdater.java",
    ],

    sdk_version: "core_platform",
@@ -435,7 +435,7 @@ java_library {
    name: "framework-atb-backward-compatibility",
    installable: true,
    srcs: [
        "core/java/android/content/pm/AndroidTestBaseUpdater.java",
        "core/java/android/content/pm/parsing/library/AndroidTestBaseUpdater.java",
    ],
}

+6 −6
Original line number Diff line number Diff line
@@ -877,7 +877,7 @@ android.content.pm.-$$Lambda$jpya2qgMDDEok2GAoKRDqPM5lIE
android.content.pm.ActivityInfo$1
android.content.pm.ActivityInfo$WindowLayout
android.content.pm.ActivityInfo
android.content.pm.AndroidHidlUpdater
android.content.pm.parsing.library.AndroidHidlUpdater
android.content.pm.ApplicationInfo$1
android.content.pm.ApplicationInfo
android.content.pm.BaseParceledListSlice
@@ -921,10 +921,10 @@ android.content.pm.LauncherApps$1
android.content.pm.LauncherApps
android.content.pm.ModuleInfo$1
android.content.pm.ModuleInfo
android.content.pm.OrgApacheHttpLegacyUpdater
android.content.pm.PackageBackwardCompatibility$AndroidTestRunnerSplitUpdater
android.content.pm.PackageBackwardCompatibility$RemoveUnnecessaryAndroidTestBaseLibrary
android.content.pm.PackageBackwardCompatibility
android.content.pm.parsing.library.OrgApacheHttpLegacyUpdater
android.content.pm.parsing.library.PackageBackwardCompatibility$AndroidTestRunnerSplitUpdater
android.content.pm.parsing.library.PackageBackwardCompatibility$RemoveUnnecessaryAndroidTestBaseLibrary
android.content.pm.parsing.library.PackageBackwardCompatibility
android.content.pm.PackageInfo$1
android.content.pm.PackageInfo
android.content.pm.PackageInstaller$Session
@@ -959,7 +959,7 @@ android.content.pm.PackageParser$SigningDetails$1
android.content.pm.PackageParser$SigningDetails
android.content.pm.PackageParser$SplitNameComparator
android.content.pm.PackageParser
android.content.pm.PackageSharedLibraryUpdater
android.content.pm.parsing.library.PackageSharedLibraryUpdater
android.content.pm.PackageStats$1
android.content.pm.PackageStats
android.content.pm.PackageUserState
+2 −1
Original line number Diff line number Diff line
@@ -1379,7 +1379,8 @@ public class ActivityInfo extends ComponentInfo implements Parcelable {
            this.minHeight = minHeight;
        }

        WindowLayout(Parcel source) {
        /** @hide */
        public WindowLayout(Parcel source) {
            width = source.readInt();
            widthFraction = source.readFloat();
            height = source.readInt();
+2 −1
Original line number Diff line number Diff line
@@ -373,8 +373,9 @@ public class PackageInfo implements Parcelable {

    /**
     * Whether the overlay is static, meaning it cannot be enabled/disabled at runtime.
     * @hide
     */
    boolean mOverlayIsStatic;
    public boolean mOverlayIsStatic;

    /**
     * The user-visible SDK version (ex. 26) of the framework against which the application claims
+21 −12
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ import android.content.pm.PackageManager.ApplicationInfoFlags;
import android.content.pm.PackageManager.ComponentInfoFlags;
import android.content.pm.PackageManager.PackageInfoFlags;
import android.content.pm.PackageManager.ResolveInfoFlags;
import android.content.pm.parsing.AndroidPackage;
import android.content.pm.parsing.ComponentParseUtils;
import android.os.Bundle;
import android.os.PersistableBundle;
import android.util.ArraySet;
@@ -315,7 +317,7 @@ public abstract class PackageManagerInternal {
     * @param installed the new installed state
     * @return true if the installed state changed as a result
     */
    public abstract boolean setInstalled(PackageParser.Package pkg,
    public abstract boolean setInstalled(AndroidPackage pkg,
            @UserIdInt int userId, boolean installed);

    /**
@@ -394,7 +396,7 @@ public abstract class PackageManagerInternal {
     * Returns whether or not the given package represents a legacy system application released
     * prior to runtime permissions.
     */
    public abstract boolean isLegacySystemApp(PackageParser.Package pkg);
    public abstract boolean isLegacySystemApp(AndroidPackage pkg);

    /**
     * Get all overlay packages for a user.
@@ -486,13 +488,17 @@ public abstract class PackageManagerInternal {
    /**
     * Returns a package object for the given package name.
     */
    public abstract @Nullable PackageParser.Package getPackage(@NonNull String packageName);
    public abstract @Nullable AndroidPackage getPackage(@NonNull String packageName);

    // TODO(b/135203078): PackageSetting can't be referenced directly. Should move to a server side
    //  internal PM which is aware of PS.
    public abstract @Nullable Object getPackageSetting(String packageName);

    /**
     * Returns a package for the given UID. If the UID is part of a shared user ID, one
     * of the packages will be chosen to be returned.
     */
    public abstract @Nullable PackageParser.Package getPackage(int uid);
    public abstract @Nullable AndroidPackage getPackage(int uid);

    /**
     * Returns a list without a change observer.
@@ -523,17 +529,19 @@ public abstract class PackageManagerInternal {
     */
    public abstract void removePackageListObserver(@NonNull PackageListObserver observer);

    // TODO(b/135203078): PackageSetting can't be referenced directly
    /**
     * Returns a package object for the disabled system package name.
     */
    public abstract @Nullable PackageParser.Package getDisabledSystemPackage(
            @NonNull String packageName);
    public abstract @Nullable Object getDisabledSystemPackage(@NonNull String packageName);

    /**
     * Returns the package name for the disabled system package.
     *
     * This is equivalent to
     * {@link #getDisabledSystemPackage(String)}.{@link PackageParser.Package#packageName}
     * {@link #getDisabledSystemPackage(String)}
     *     .{@link com.android.server.pm.PackageSetting#pkg}
     *     .{@link AndroidPackage#getPackageName()}
     */
    public abstract @Nullable String getDisabledSystemPackageName(@NonNull String packageName);

@@ -567,7 +575,7 @@ public abstract class PackageManagerInternal {
     * @see #canAccessInstantApps
     */
    public abstract boolean filterAppAccess(
            @NonNull PackageParser.Package pkg, int callingUid, int userId);
            @NonNull AndroidPackage pkg, int callingUid, int userId);

    /**
     * Returns whether or not access to the application should be filtered.
@@ -641,7 +649,8 @@ public abstract class PackageManagerInternal {
            throws IOException;

    /** Returns {@code true} if the specified component is enabled and matches the given flags. */
    public abstract boolean isEnabledAndMatches(@NonNull ComponentInfo info, int flags, int userId);
    public abstract boolean isEnabledAndMatches(
            @NonNull ComponentParseUtils.ParsedComponent component, int flags, int userId);

    /** Returns {@code true} if the given user requires extra badging for icons. */
    public abstract boolean userNeedsBadging(int userId);
@@ -652,14 +661,14 @@ public abstract class PackageManagerInternal {
     *
     * @param actionLocked action to be performed
     */
    public abstract void forEachPackage(Consumer<PackageParser.Package> actionLocked);
    public abstract void forEachPackage(Consumer<AndroidPackage> actionLocked);

    /**
     * Perform the given action for each installed package for a user.
     * Note that packages lock will be held while performin the actions.
     */
    public abstract void forEachInstalledPackage(
            @NonNull Consumer<PackageParser.Package> actionLocked, @UserIdInt int userId);
            @NonNull Consumer<AndroidPackage> actionLocked, @UserIdInt int userId);

    /** Returns the list of enabled components */
    public abstract ArraySet<String> getEnabledComponents(String packageName, int userId);
@@ -793,7 +802,7 @@ public abstract class PackageManagerInternal {
     * Otherwise, {@code false}.
     */
    public abstract boolean isCallerInstallerOfRecord(
            @NonNull PackageParser.Package pkg, int callingUid);
            @NonNull AndroidPackage pkg, int callingUid);

    /** Returns whether or not default runtime permissions are granted for the given user */
    public abstract boolean areDefaultRuntimePermissionsGranted(@UserIdInt int userId);
Loading