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

Commit 87caa7b9 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Fix broken target SDK checks." into pi-dev

am: aab3304a

Change-Id: Ib43fd6704d6982104f11504b3d43db9edcfa9d41
parents 983738a2 aab3304a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5873,7 +5873,7 @@ public final class ActivityThread extends ClientTransactionHandler {
        } finally {
            // If the app targets < O-MR1, or doesn't change the thread policy
            // during startup, clobber the policy to maintain behavior of b/36951662
            if (data.appInfo.targetSdkVersion <= Build.VERSION_CODES.O
            if (data.appInfo.targetSdkVersion < Build.VERSION_CODES.O_MR1
                    || StrictMode.getThreadPolicy().equals(writesAllowedPolicy)) {
                StrictMode.setThreadPolicy(savedPolicy);
            }
+2 −2
Original line number Diff line number Diff line
@@ -413,7 +413,7 @@ public class WallpaperManager {
                } catch (OutOfMemoryError e) {
                    Log.w(TAG, "Out of memory loading the current wallpaper: " + e);
                } catch (SecurityException e) {
                    if (context.getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.O) {
                    if (context.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.O_MR1) {
                        Log.w(TAG, "No permission to access wallpaper, suppressing"
                                + " exception to avoid crashing legacy app.");
                    } else {
@@ -977,7 +977,7 @@ public class WallpaperManager {
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            } catch (SecurityException e) {
                if (mContext.getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.O) {
                if (mContext.getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.O_MR1) {
                    Log.w(TAG, "No permission to access wallpaper, suppressing"
                            + " exception to avoid crashing legacy app.");
                    return null;
+3 −3
Original line number Diff line number Diff line
@@ -1694,7 +1694,7 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        if (mHiddenApiPolicy != HIDDEN_API_ENFORCEMENT_DEFAULT) {
            return mHiddenApiPolicy;
        }
        if (targetSdkVersion <= Build.VERSION_CODES.O_MR1) {
        if (targetSdkVersion < Build.VERSION_CODES.P) {
            return HIDDEN_API_ENFORCEMENT_BLACK;
        } else {
            return HIDDEN_API_ENFORCEMENT_DARK_GREY_AND_BLACK;
@@ -1728,9 +1728,9 @@ public class ApplicationInfo extends PackageItemInfo implements Parcelable {
        if (isPackageWhitelistedForHiddenApis()) {
            return;
        }
        if (targetSdkVersion <= Build.VERSION_CODES.O_MR1) {
        if (targetSdkVersion < Build.VERSION_CODES.P) {
            setHiddenApiEnforcementPolicy(policyPreP);
        } else if (targetSdkVersion > Build.VERSION_CODES.O_MR1) {
        } else if (targetSdkVersion >= Build.VERSION_CODES.P) {
            setHiddenApiEnforcementPolicy(policyP);
        }

+1 −1
Original line number Diff line number Diff line
@@ -2716,7 +2716,7 @@ public class PackageParser {

        // Fot apps targeting O-MR1 we require explicit enumeration of all certs.
        String[] additionalCertSha256Digests = EmptyArray.STRING;
        if (pkg.applicationInfo.targetSdkVersion > Build.VERSION_CODES.O) {
        if (pkg.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.O_MR1) {
            additionalCertSha256Digests = parseAdditionalCertificates(res, parser, outError);
            if (additionalCertSha256Digests == null) {
                return false;
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ public abstract class PackageSharedLibraryUpdater {

    static boolean apkTargetsApiLevelLessThanOrEqualToOMR1(PackageParser.Package pkg) {
        int targetSdkVersion = pkg.applicationInfo.targetSdkVersion;
        return targetSdkVersion <= Build.VERSION_CODES.O_MR1;
        return targetSdkVersion < Build.VERSION_CODES.P;
    }

    /**
Loading