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

Commit 995165c8 authored by Przemyslaw Szczepaniak's avatar Przemyslaw Szczepaniak Committed by Android (Google) Code Review
Browse files

Merge "Revert "Reject apks targeting deprecated sdk""

parents 8fc10fd2 aef1221d
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import android.content.Context;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Environment;
import android.os.Parcel;
import android.os.Parcelable;
@@ -1593,11 +1592,6 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        return (privateFlags & ApplicationInfo.PRIVATE_FLAG_VENDOR) != 0;
    }

    /** @hide */
    public boolean isTargetingDeprecatedSdkVersion() {
        return targetSdkVersion < Build.VERSION.MIN_SUPPORTED_TARGET_SDK_INT;
    }

    /**
     * Returns whether or not this application was installed as a virtual preload.
     */
+0 −11
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ import static android.content.pm.PackageManager.INSTALL_FAILED_INTERNAL_ERROR;
import static android.content.pm.PackageManager.INSTALL_FAILED_INVALID_APK;
import static android.content.pm.PackageManager.INSTALL_FAILED_INVALID_INSTALL_LOCATION;
import static android.content.pm.PackageManager.INSTALL_FAILED_MISSING_SHARED_LIBRARY;
import static android.content.pm.PackageManager.INSTALL_FAILED_NEWER_SDK;
import static android.content.pm.PackageManager.INSTALL_FAILED_PACKAGE_CHANGED;
import static android.content.pm.PackageManager.INSTALL_FAILED_REPLACE_COULDNT_DELETE;
import static android.content.pm.PackageManager.INSTALL_FAILED_SANDBOX_VERSION_DOWNGRADE;
@@ -16495,16 +16494,6 @@ Slog.e("TODD",
            Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
        }
        // App targetSdkVersion is below min supported version
        if (!forceSdk && pkg.applicationInfo.isTargetingDeprecatedSdkVersion()) {
            Slog.w(TAG, "App " + pkg.packageName + " targets deprecated sdk");
            res.setError(INSTALL_FAILED_NEWER_SDK,
                    "App is targeting deprecated sdk (targetSdkVersion should be at least "
                    + Build.VERSION.MIN_SUPPORTED_TARGET_SDK_INT + ").");
            return;
        }
        // Instant apps have several additional install-time checks.
        if (instantApp) {
            if (pkg.applicationInfo.targetSdkVersion < Build.VERSION_CODES.O) {