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

Commit 3a66db8c authored by Winson's avatar Winson
Browse files

Unmark PackageParser APIs as @Deprecated

To revert API changes for R, unmark the parsePackage and related
classes as @Deprecated. They will be kept until a public alternative
is introduced.

Their use is still deprecated.

Bug: 135203078

Change-Id: Ia68a3e98d79fe4161c3bd43f446f81d0e329f6ac
parent b6a5575a
Loading
Loading
Loading
Loading
+1 −108
Original line number Diff line number Diff line
@@ -1051,10 +1051,8 @@ public class PackageParser {
     * has changed since the last parse, it's up to callers to do so.
     *
     * @see #parsePackageLite(File, int)
     * @deprecated use {@link #parseParsedPackage(File, int, boolean)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public Package parsePackage(File packageFile, int flags, boolean useCaches)
            throws PackageParserException {
        if (packageFile.isDirectory()) {
@@ -1066,10 +1064,8 @@ public class PackageParser {

    /**
     * Equivalent to {@link #parsePackage(File, int, boolean)} with {@code useCaches == false}.
     * @deprecated use {@link #parseParsedPackage(File, int, boolean)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public Package parsePackage(File packageFile, int flags) throws PackageParserException {
        return parsePackage(packageFile, flags, false /* useCaches */);
    }
@@ -1342,12 +1338,7 @@ public class PackageParser {
     * Note that this <em>does not</em> perform signature verification; that
     * must be done separately in
     * {@link ApkParseUtils#collectCertificates(AndroidPackage, boolean)}.
     *
     * @deprecated external callers should move to
     *             {@link #parseParsedPackage(File, int, boolean)}. Eventually this method will
     *             be marked private.
     */
    @Deprecated
    @UnsupportedAppUsage
    public Package parseMonolithicPackage(File apkFile, int flags) throws PackageParserException {
        final PackageLite lite = parseMonolithicPackageLite(apkFile, flags);
@@ -1544,11 +1535,8 @@ public class PackageParser {
     * Collect certificates from all the APKs described in the given package,
     * populating {@link Package#mSigningDetails}. Also asserts that all APK
     * contents are signed correctly and consistently.
     *
     * @deprecated use {@link ApkParseUtils#collectCertificates(AndroidPackage, boolean)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public static void collectCertificates(Package pkg, boolean skipVerify)
            throws PackageParserException {
        collectCertificatesInternal(pkg, skipVerify);
@@ -6468,9 +6456,8 @@ public class PackageParser {
     * Representation of a full package parsed from APK files on disk. A package
     * consists of a single base APK, and zero or more split APKs.
     *
     * @deprecated use an {@link AndroidPackage}
     * Deprecated internally. Use AndroidPackage instead.
     */
    @Deprecated
    public final static class Package implements Parcelable {

        @UnsupportedAppUsage
@@ -7384,10 +7371,6 @@ public class PackageParser {
        };
    }

    /**
     * @deprecated use a {@link ComponentParseUtils.ParsedComponent}
     */
    @Deprecated
    public static abstract class Component<II extends IntentInfo> {
        @UnsupportedAppUsage
        public final ArrayList<II> intents;
@@ -7568,10 +7551,6 @@ public class PackageParser {
        }
    }

    /**
     * @deprecated use {@link ComponentParseUtils.ParsedPermission}
     */
    @Deprecated
    public final static class Permission extends Component<IntentInfo> implements Parcelable {
        @UnsupportedAppUsage
        public final PermissionInfo info;
@@ -7646,10 +7625,6 @@ public class PackageParser {
        };
    }

    /**
     * @deprecated use {@link ComponentParseUtils.ParsedPermissionGroup}
     */
    @Deprecated
    public final static class PermissionGroup extends Component<IntentInfo> implements Parcelable {
        @UnsupportedAppUsage
        public final PermissionGroupInfo info;
@@ -7749,12 +7724,7 @@ public class PackageParser {
        return false;
    }

    /**
     * @deprecated use {@link PackageInfoUtils#generateApplicationInfo(
     *      AndroidPackage, int, PackageUserState, int)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public static ApplicationInfo generateApplicationInfo(Package p, int flags,
            PackageUserState state) {
        return generateApplicationInfo(p, flags, state, UserHandle.getCallingUserId());
@@ -7811,12 +7781,7 @@ public class PackageParser {
        ai.icon = (sUseRoundIcon && ai.roundIconRes != 0) ? ai.roundIconRes : ai.iconRes;
    }

    /**
     * @deprecated use {@link PackageInfoUtils#generateApplicationInfo(
     *      AndroidPackage, int, PackageUserState, int)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public static ApplicationInfo generateApplicationInfo(Package p, int flags,
            PackageUserState state, int userId) {
        if (p == null) return null;
@@ -7856,11 +7821,6 @@ public class PackageParser {
        return ai;
    }

    /**
     * @deprecated use {@link PackageInfoUtils#generateApplicationInfo(
     *      AndroidPackage, int, PackageUserState, int)}
     */
    @Deprecated
    public static ApplicationInfo generateApplicationInfo(ApplicationInfo ai, int flags,
            PackageUserState state, int userId) {
        if (ai == null) return null;
@@ -7880,12 +7840,7 @@ public class PackageParser {
        return ai;
    }

    /**
     * @deprecated use {@link PackageInfoUtils#generatePermissionInfo(
     *      ComponentParseUtils.ParsedPermission, int)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public static final PermissionInfo generatePermissionInfo(
            Permission p, int flags) {
        if (p == null) return null;
@@ -7897,12 +7852,7 @@ public class PackageParser {
        return pi;
    }

    /**
     * @deprecated use {@link PackageInfoUtils#generatePermissionGroupInfo(
     *      ComponentParseUtils.ParsedPermissionGroup, int)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public static final PermissionGroupInfo generatePermissionGroupInfo(
            PermissionGroup pg, int flags) {
        if (pg == null) return null;
@@ -7914,10 +7864,6 @@ public class PackageParser {
        return pgi;
    }

    /**
     * @deprecated use {@link ComponentParseUtils.ParsedActivity}
     */
    @Deprecated
    public final static class Activity extends Component<ActivityIntentInfo> implements Parcelable {
        @UnsupportedAppUsage
        public final ActivityInfo info;
@@ -8033,12 +7979,7 @@ public class PackageParser {
        };
    }

    /**
     * @deprecated use {@link PackageInfoUtils#generateActivityInfo(
     *      AndroidPackage, ComponentParseUtils.ParsedActivity, int, PackageUserState, int)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public static final ActivityInfo generateActivityInfo(Activity a, int flags,
            PackageUserState state, int userId) {
        if (a == null) return null;
@@ -8056,11 +7997,6 @@ public class PackageParser {
        return ai;
    }

    /**
     * @deprecated use {@link PackageInfoUtils#generateActivityInfo(
     *      AndroidPackage, ComponentParseUtils.ParsedActivity, int, PackageUserState, int)}
     */
    @Deprecated
    public static final ActivityInfo generateActivityInfo(ActivityInfo ai, int flags,
            PackageUserState state, int userId) {
        if (ai == null) return null;
@@ -8074,10 +8010,6 @@ public class PackageParser {
        return ai;
    }

    /**
     * @deprecated use {@link ComponentParseUtils.ParsedService}
     */
    @Deprecated
    public final static class Service extends Component<ServiceIntentInfo> implements Parcelable {
        @UnsupportedAppUsage
        public final ServiceInfo info;
@@ -8139,12 +8071,7 @@ public class PackageParser {
        };
    }

    /**
     * @deprecated use {@link PackageInfoUtils#generateServiceInfo(
     * AndroidPackage, ComponentParseUtils.ParsedService, int, PackageUserState, int)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public static final ServiceInfo generateServiceInfo(Service s, int flags,
            PackageUserState state, int userId) {
        if (s == null) return null;
@@ -8162,10 +8089,6 @@ public class PackageParser {
        return si;
    }

    /**
     * @deprecated use {@link ComponentParseUtils.ParsedProvider}
     */
    @Deprecated
    public final static class Provider extends Component<ProviderIntentInfo> implements Parcelable {
        @UnsupportedAppUsage
        public final ProviderInfo info;
@@ -8246,12 +8169,7 @@ public class PackageParser {
        };
    }

    /**
     * @deprecated use {@link PackageInfoUtils#generateProviderInfo(
     *      AndroidPackage, ComponentParseUtils.ParsedProvider, int, PackageUserState, int)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public static final ProviderInfo generateProviderInfo(Provider p, int flags,
            PackageUserState state, int userId) {
        if (p == null) return null;
@@ -8274,10 +8192,6 @@ public class PackageParser {
        return pi;
    }

    /**
     * @deprecated use {@link ComponentParseUtils.ParsedInstrumentation}
     */
    @Deprecated
    public final static class Instrumentation extends Component<IntentInfo> implements
            Parcelable {
        @UnsupportedAppUsage
@@ -8338,12 +8252,7 @@ public class PackageParser {
        };
    }

    /**
     * @deprecated use {@link PackageInfoUtils#generateInstrumentationInfo(
     *      ComponentParseUtils.ParsedInstrumentation, int)}
     */
    @UnsupportedAppUsage
    @Deprecated
    public static final InstrumentationInfo generateInstrumentationInfo(
            Instrumentation i, int flags) {
        if (i == null) return null;
@@ -8355,10 +8264,6 @@ public class PackageParser {
        return ii;
    }

    /**
     * @deprecated use {@link ComponentParseUtils.ParsedIntentInfo}
     */
    @Deprecated
    public static abstract class IntentInfo extends IntentFilter {
        @UnsupportedAppUsage
        public boolean hasDefault;
@@ -8402,10 +8307,6 @@ public class PackageParser {
        }
    }

    /**
     * @deprecated use {@link ComponentParseUtils.ParsedActivityIntentInfo}
     */
    @Deprecated
    public final static class ActivityIntentInfo extends IntentInfo {
        @UnsupportedAppUsage
        public Activity activity;
@@ -8429,10 +8330,6 @@ public class PackageParser {
        }
    }

    /**
     * @deprecated use {@link ComponentParseUtils.ParsedServiceIntentInfo}
     */
    @Deprecated
    public final static class ServiceIntentInfo extends IntentInfo {
        @UnsupportedAppUsage
        public Service service;
@@ -8456,10 +8353,6 @@ public class PackageParser {
        }
    }

    /**
     * @deprecated use {@link ComponentParseUtils.ParsedProviderIntentInfo}
     */
    @Deprecated
    public static final class ProviderIntentInfo extends IntentInfo {
        @UnsupportedAppUsage
        public Provider provider;