Example usage for android.app.admin DevicePolicyManager getBindDeviceAdminTargetUsers

List of usage examples for android.app.admin DevicePolicyManager getBindDeviceAdminTargetUsers

Introduction

In this page you can find the example usage for android.app.admin DevicePolicyManager getBindDeviceAdminTargetUsers.

Prototype

public @NonNull List<UserHandle> getBindDeviceAdminTargetUsers(@NonNull ComponentName admin) 

Source Link

Document

Returns the list of target users that the calling device or profile owner can use when calling #bindDeviceAdminServiceAsUser .

Usage

From source file:com.afwsamples.testdpc.common.Util.java

@TargetApi(VERSION_CODES.O)
public static List<UserHandle> getBindDeviceAdminTargetUsers(Context context) {
    if (!BuildCompat.isAtLeastO()) {
        return Collections.emptyList();
    }//from   w ww. j  av a  2s  .  c o  m

    final DevicePolicyManager dpm = getDevicePolicyManager(context);
    return dpm.getBindDeviceAdminTargetUsers(DeviceAdminReceiver.getComponentName(context));
}