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

Commit d21dfb5e authored by Bram Bonné's avatar Bram Bonné Committed by Automerger Merge Worker
Browse files

Merge "Map SELINUX_LATEST_CHANGES to Build.CUR_DEVELOPMENT" am: 5755c2ad

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1760270

Change-Id: Ibb09f898195e4195e5e5235147d8ed0fccd644c9
parents 09f0c840 5755c2ad
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.server.pm;

import android.compat.annotation.ChangeId;
import android.compat.annotation.Disabled;
import android.compat.annotation.EnabledAfter;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageParser.SigningDetails;
@@ -79,13 +80,13 @@ public final class SELinuxMMAC {

    /**
     * Allows opt-in to the latest targetSdkVersion enforced changes without changing target SDK.
     * Turning this change off for an app targeting the latest SDK or higher is a no-op.
     * Turning this change on for an app targeting the latest SDK or higher is a no-op.
     *
     * <p>Has no effect for apps using shared user id.
     *
     * TODO(b/143539591): Update description with relevant SELINUX changes this opts in to.
     */
    @EnabledAfter(targetSdkVersion = android.os.Build.VERSION_CODES.R)
    @Disabled
    @ChangeId
    static final long SELINUX_LATEST_CHANGES = 143539591L;

@@ -364,7 +365,8 @@ public final class SELinuxMMAC {
        }
        final ApplicationInfo appInfo = pkg.toAppInfoWithoutState();
        if (compatibility.isChangeEnabledInternal(SELINUX_LATEST_CHANGES, appInfo)) {
            return Math.max(android.os.Build.VERSION_CODES.S, pkg.getTargetSdkVersion());
            return Math.max(
                    android.os.Build.VERSION_CODES.CUR_DEVELOPMENT, pkg.getTargetSdkVersion());
        } else if (compatibility.isChangeEnabledInternal(SELINUX_R_CHANGES, appInfo)) {
            return Math.max(android.os.Build.VERSION_CODES.R, pkg.getTargetSdkVersion());
        }
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ import org.mockito.junit.MockitoJUnitRunner;
public class SELinuxMMACTest {

    private static final String PACKAGE_NAME = "my.package";
    private static final int LATEST_OPT_IN_VERSION = Build.VERSION_CODES.S;
    private static final int LATEST_OPT_IN_VERSION = Build.VERSION_CODES.CUR_DEVELOPMENT;
    private static final int R_OPT_IN_VERSION = Build.VERSION_CODES.R;

    @Mock