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

Commit 9889cd23 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add extra for DPM for EnforcingAdmin" into main

parents 381f6149 66374fcd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1439,6 +1439,7 @@ package android.app.admin {
    field public static final int EXEMPT_FROM_HIBERNATION = 3; // 0x3
    field public static final int EXEMPT_FROM_POWER_RESTRICTIONS = 4; // 0x4
    field public static final int EXEMPT_FROM_SUSPENSION = 0; // 0x0
    field @FlaggedApi("android.app.admin.flags.enforcing_admin_extra_enabled") public static final String EXTRA_ENFORCING_ADMIN = "android.app.extra.ENFORCING_ADMIN";
    field public static final String EXTRA_FORCE_UPDATE_ROLE_HOLDER = "android.app.extra.FORCE_UPDATE_ROLE_HOLDER";
    field public static final String EXTRA_LOST_MODE_LOCATION = "android.app.extra.LOST_MODE_LOCATION";
    field public static final String EXTRA_PROFILE_OWNER_NAME = "android.app.extra.PROFILE_OWNER_NAME";
+11 −0
Original line number Diff line number Diff line
@@ -2295,6 +2295,17 @@ public class DevicePolicyManager {
    @SystemApi
    public static final String EXTRA_RESTRICTION = "android.app.extra.RESTRICTION";
    /**
     * A parcelable extra that contains {@link EnforcingAdmin} information that enforces a user
     * restriction or policy.
     * @hide
     */
    @SystemApi
    @FlaggedApi(Flags.FLAG_ENFORCING_ADMIN_EXTRA_ENABLED)
    // Suppress API linter warning to have consistent value with other extras in this file.
    @SuppressLint("ActionValue")
    public static final String EXTRA_ENFORCING_ADMIN = "android.app.extra.ENFORCING_ADMIN";
    /**
     * Activity action: have the user enter a new password.
     *
+8 −0
Original line number Diff line number Diff line
@@ -492,3 +492,11 @@ flag {
  bug: "414733570"
  is_exported: true
}

flag {
  name: "enforcing_admin_extra_enabled"
  namespace: "enterprise"
  description: "Adds a new API for extra that contains EnforcingAdmin"
  bug: "414733570"
  is_exported: true
}
+3 −0
Original line number Diff line number Diff line
@@ -126,6 +126,9 @@ public class RestrictedLockUtils {
    public static Intent getShowAdminSupportDetailsIntent(@Nullable EnforcingAdmin admin) {
        final Intent intent = new Intent(Settings.ACTION_SHOW_ADMIN_SUPPORT_DETAILS);
        if (admin != null) {
            // Although EXTRA_ENFORCING_ADMIN contains all info from other extras, we keep them
            // to provide backward compatibility.
            intent.putExtra(DevicePolicyManager.EXTRA_ENFORCING_ADMIN, admin);
            if (admin.getComponentName() != null) {
                intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, admin.getComponentName());
            }