Added in version 37.2

PolicyIdentifier


public class PolicyIdentifier
extends Object

java.lang.Object
   ↳ android.app.admin.PolicyIdentifier<T>


Represents a type safe identifier for a policy. Use it as a key for setPolicy and related APIs.

Policies should be structured as:

{@literal @}TypePolicyDefinition
private static final PolicyIdentifier<Type> POLICY_NAME =
    new SimplePolicyIdentifier<>("POLICY_NAME");

Currently policy definitions are restricted to the android.app.admin.policy namespace. This restriction might be lifted in the future.

Summary

Public methods

static <U> PolicyIdentifier<U> createForTesting(String id)

This method is deprecated. Use ERROR(SimplePolicyIdentifier.createForTesting(String)/android.app.admin.PolicyIdentifier.SimplePolicyIdentifier#createForTesting(java.lang.String) SimplePolicyIdentifier.createForTesting(String)) instead.

Inherited methods

Public methods

createForTesting

Added in version 37.2
public static PolicyIdentifier<U> createForTesting (String id)

This method is deprecated.
Use ERROR(SimplePolicyIdentifier.createForTesting(String)/android.app.admin.PolicyIdentifier.SimplePolicyIdentifier#createForTesting(java.lang.String) SimplePolicyIdentifier.createForTesting(String)) instead.

Create an instance of PolicyIdentifier for testing purposes. This must NOT be used in any real production code.

Parameters
id String: This value cannot be null.

Returns
PolicyIdentifier<U> This value cannot be null.