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

Commit 66374fcd authored by Irem Uguz's avatar Irem Uguz
Browse files

Add extra for DPM for EnforcingAdmin

The extra will be used for policy transparency on RestrictedLockUtils.
It's marked as SystemApi because RestrictedLockUtils is a mainline
module.

Flag: android.app.admin.flags.enforcing_admin_extra_enabled
Bug: 414733570
Test: None
FCRS_CODE : mdyqt2vlizwx7v

Change-Id: I27f40ff512c1e9b1fc504092da87cc41a31a9564
parent 7c66c9b6
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());
            }