次の方法で共有


UserPolicy.acquire synchronous method

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

Asynchronously acquires a UserPolicy object based on a serialized content policy. The I/O call is made on the calling thread.

Signature

public static UserPolicy acquire(
                                     final byte[] serializedContentPolicy,
                                     final String userId,
                                     final AuthenticationRequestCallback authenticationCallback,
                                     final ConsentCallback consentCallback,
                                     final int policyAcquisitionFlags,
                                     final Context applicationContext) 
                               throws ProtectionException

Parameters

Name Datatype Notes
serializedContentPolicy
byte[]
A serialized content policy
userId
String
Optional.
A userId is used for caching a user policy for offline usage. For multiple user scenarios, caller must supply a userId.
If userId is null, then the user policy is cached without userId and is retrievable with null userId as well. A null userId also retrieves any matching offline user policy cached without userId or any userId.
authenticationCallback
AuthenticationRequestCallback
consentCallback
ConsentCallback
policyAcquisitionFlags
int
For more information, see PolicyAcquisitionFlags
applicationContext

Throws

ProtectionException

Returns

UserPolicy

Defined in

UserPolicy.java

Supported Platforms

Minimum supported OS version
Android 4.0.3 (API level 15)