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

Commit 42d6ba6b authored by Florian Mayer's avatar Florian Mayer Committed by Android (Google) Code Review
Browse files

Merge "Add API to query MTE state of device" into main

parents 1d001a45 b7e6a5f9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8117,6 +8117,7 @@ package android.app.admin {
    method public boolean isLogoutEnabled();
    method public boolean isManagedProfile(@NonNull android.content.ComponentName);
    method public boolean isMasterVolumeMuted(@NonNull android.content.ComponentName);
    method @FlaggedApi("android.app.admin.flags.is_mte_policy_enforced") public static boolean isMtePolicyEnforced();
    method public boolean isNetworkLoggingEnabled(@Nullable android.content.ComponentName);
    method public boolean isOrganizationOwnedDeviceWithManagedProfile();
    method public boolean isOverrideApnEnabled(@NonNull android.content.ComponentName);
+15 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import static android.Manifest.permission.SET_TIME_ZONE;
import static android.app.admin.flags.Flags.FLAG_ESIM_MANAGEMENT_ENABLED;
import static android.app.admin.flags.Flags.FLAG_DEVICE_POLICY_SIZE_TRACKING_ENABLED;
import static android.app.admin.flags.Flags.onboardingBugreportV2Enabled;
import static android.app.admin.flags.Flags.FLAG_IS_MTE_POLICY_ENFORCED;
import static android.content.Intent.LOCAL_FLAG_FROM_SYSTEM;
import static android.net.NetworkCapabilities.NET_ENTERPRISE_ID_1;
import static android.os.Build.VERSION_CODES.UPSIDE_DOWN_CAKE;
@@ -153,6 +154,7 @@ import com.android.internal.os.BackgroundThread;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.Preconditions;
import com.android.org.conscrypt.TrustedCertificateStore;
import com.android.internal.os.Zygote;
import java.io.ByteArrayInputStream;
import java.io.FileNotFoundException;
@@ -4117,6 +4119,19 @@ public class DevicePolicyManager {
        return MTE_NOT_CONTROLLED_BY_POLICY;
    }
    /**
     * Get the current MTE state of the device.
     *
     * <a href="https://source.android.com/docs/security/test/memory-safety/arm-mte">
     * Learn more about MTE</a>
     *
     * @return whether MTE is currently enabled on the device.
     */
    @FlaggedApi(FLAG_IS_MTE_POLICY_ENFORCED)
    public static boolean isMtePolicyEnforced() {
        return Zygote.nativeSupportsMemoryTagging();
    }
    /** Indicates that content protection is not controlled by policy, allowing user to choose. */
    @FlaggedApi(android.view.contentprotection.flags.Flags.FLAG_MANAGE_DEVICE_POLICY_ENABLED)
    public static final int CONTENT_PROTECTION_NOT_CONTROLLED_BY_POLICY = 0;
+7 −0
Original line number Diff line number Diff line
@@ -139,3 +139,10 @@ flag {
  description: "Add Headless DO support."
  bug: "289515470"
}

flag {
  name: "is_mte_policy_enforced"
  namespace: "enterprise"
  description: "Allow to query whether MTE is enabled or not to check for compliance for enterprise policy"
  bug: "322777918"
}