Example usage for android.app.admin DevicePolicyManager EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE

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

Introduction

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

Prototype

String EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE

To view the source code for android.app.admin DevicePolicyManager EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE.

Click Source Link

Document

A android.os.Parcelable extra of type android.os.PersistableBundle that allows a mobile device management application or NFC programmer application which starts managed provisioning to pass data to the management application instance after provisioning.

Usage

From source file:com.example.android.nfcprovisioning.ProvisioningValuesLoader.java

private void gatherAdminExtras(HashMap<String, String> values) {
    HashMap<String, String> newMap = new HashMap<String, String>();
    Properties props = new Properties();
    Set<String> keys = new HashSet(values.keySet());
    for (String key : keys) {
        if (key.startsWith("android.app.extra")) {
            continue;
        }/*from   w w w.  j a  va 2 s.co m*/
        props.put(key, values.get(key));
        values.remove(key);
    }
    StringWriter sw = new StringWriter();
    try {
        props.store(sw, "admin extras bundle");
        values.put(DevicePolicyManager.EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE, sw.toString());
        Log.d(TAG, "Admin extras bundle="
                + values.get(DevicePolicyManager.EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE));
    } catch (IOException e) {
        Log.e(TAG, "Unable to build admin extras bundle");
    }
}