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

Commit 417a86aa authored by Irem Uguz's avatar Irem Uguz Committed by Android (Google) Code Review
Browse files

Merge "Reland "Add flag checks for DPM API calls"" into main

parents cc416559 bc422156
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -24,6 +24,10 @@ android_library {
    srcs: ["src/**/*.java"],
    resource_dirs: ["res"],

    static_libs: [
        "device_policy_aconfig_flags_java_export",
    ],

    libs: [
        "androidx.annotation_annotation",
    ],
+5 −2
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package com.android.settingslib;

import android.app.admin.DevicePolicyManager;
import android.app.admin.EnforcingAdmin;
import android.app.admin.flags.Flags;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
@@ -128,8 +129,10 @@ public class RestrictedLockUtils {
        if (admin != null) {
            // Although EXTRA_ENFORCING_ADMIN contains all info from other extras, we keep them
            // to provide backward compatibility.
            if (Flags.enforcingAdminExtraEnabled()) {
                intent.putExtra(DevicePolicyManager.EXTRA_ENFORCING_ADMIN, admin);
            if (admin.getComponentName() != null) {
            }
            if (Flags.enforcingAdminGetComponentNameEnabled() && admin.getComponentName() != null) {
                intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, admin.getComponentName());
            }
            intent.putExtra(Intent.EXTRA_USER, admin.getUserHandle());