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

Commit 7b8b65f6 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add API stubs for MtePolicy controls"

parents cfc8bae5 0f40b1f6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -7457,6 +7457,7 @@ package android.app.admin {
    method public long getMaximumTimeToLock(@Nullable android.content.ComponentName);
    method @NonNull public java.util.List<java.lang.String> getMeteredDataDisabledPackages(@NonNull android.content.ComponentName);
    method public int getMinimumRequiredWifiSecurityLevel();
    method public int getMtePolicy();
    method @RequiresPermission(value=android.Manifest.permission.READ_NEARBY_STREAMING_POLICY, conditional=true) public int getNearbyAppStreamingPolicy();
    method @RequiresPermission(value=android.Manifest.permission.READ_NEARBY_STREAMING_POLICY, conditional=true) public int getNearbyNotificationStreamingPolicy();
    method @Deprecated @ColorInt public int getOrganizationColor(@NonNull android.content.ComponentName);
@@ -7605,6 +7606,7 @@ package android.app.admin {
    method public void setMaximumTimeToLock(@NonNull android.content.ComponentName, long);
    method @NonNull public java.util.List<java.lang.String> setMeteredDataDisabledPackages(@NonNull android.content.ComponentName, @NonNull java.util.List<java.lang.String>);
    method public void setMinimumRequiredWifiSecurityLevel(int);
    method public void setMtePolicy(int);
    method public void setNearbyAppStreamingPolicy(int);
    method public void setNearbyNotificationStreamingPolicy(int);
    method public void setNetworkLoggingEnabled(@Nullable android.content.ComponentName, boolean);
@@ -7788,6 +7790,9 @@ package android.app.admin {
    field public static final int LOCK_TASK_FEATURE_SYSTEM_INFO = 1; // 0x1
    field public static final int MAKE_USER_EPHEMERAL = 2; // 0x2
    field public static final String MIME_TYPE_PROVISIONING_NFC = "application/com.android.managedprovisioning";
    field public static final int MTE_DISABLED = 2; // 0x2
    field public static final int MTE_ENABLED = 1; // 0x1
    field public static final int MTE_NOT_CONTROLLED_BY_POLICY = 0; // 0x0
    field public static final int NEARBY_STREAMING_DISABLED = 1; // 0x1
    field public static final int NEARBY_STREAMING_ENABLED = 2; // 0x2
    field public static final int NEARBY_STREAMING_NOT_CONTROLLED_BY_POLICY = 0; // 0x0
+50 −0
Original line number Diff line number Diff line
@@ -3864,6 +3864,56 @@ public class DevicePolicyManager {
    public static final String EXTRA_RESOURCE_IDS =
            "android.app.extra.RESOURCE_IDS";
    /** Allow the user to choose whether to enable MTE on the device. */
    public static final int MTE_NOT_CONTROLLED_BY_POLICY = 0;
    /**
     * Require that MTE be enabled on the device, if supported. Can be set by a device owner or a
     * profile owner of an organization-owned managed profile.
     */
    public static final int MTE_ENABLED = 1;
    /** Require that MTE be disabled on the device. Can be set by a device owner. */
    public static final int MTE_DISABLED = 2;
    /** @hide */
    @IntDef(
            prefix = {"MTE_"},
            value = {MTE_ENABLED, MTE_DISABLED, MTE_NOT_CONTROLLED_BY_POLICY})
    @Retention(RetentionPolicy.SOURCE)
    public static @interface MtePolicy {}
    /**
     * Set MTE policy for device. MTE_ENABLED does not necessarily enable MTE if set on a device
     * that does not support MTE.
     *
     * The default policy is MTE_NOT_CONTROLLED_BY_POLICY.
     *
     * Memory Tagging Extension (MTE) is a CPU extension that allows to protect against certain
     * classes of security problems at a small runtime performance cost overhead.
     *
     * @param policy the policy to be set
     */
    public void setMtePolicy(@MtePolicy int policy) {
        // TODO(b/244290023): implement
        // This is SecurityException to temporarily make ParentProfileTest happy.
        // This is not used.
        throw new SecurityException("not implemented");
    }
    /**
     * Get currently set MTE policy. This is not necessarily the same as the state of MTE on the
     * device, as the device might not support MTE.
     *
     * @return the currently set policy
     */
    public @MtePolicy int getMtePolicy() {
        // TODO(b/244290023): implement
        // This is SecurityException to temporarily make ParentProfileTest happy.
        // This is not used.
        throw new SecurityException("not implemented");
    }
    /**
     * This object is a single place to tack on invalidation and disable calls.  All
     * binder caches in this class derive from this Config, so all can be invalidated or