Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 1 | page.title=Provisioning for Device Administration |
| 2 | @jd:body |
| 3 | |
| 4 | <!-- |
| 5 | Copyright 2015 The Android Open Source Project |
| 6 | |
| 7 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | you may not use this file except in compliance with the License. |
| 9 | You may obtain a copy of the License at |
| 10 | |
| 11 | http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | |
| 13 | Unless required by applicable law or agreed to in writing, software |
| 14 | distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | See the License for the specific language governing permissions and |
| 17 | limitations under the License. |
| 18 | --> |
| 19 | <div id="qv-wrapper"> |
| 20 | <div id="qv"> |
| 21 | <h2>In this document</h2> |
| 22 | <ol id="auto-toc"> |
| 23 | </ol> |
| 24 | </div> |
| 25 | </div> |
| 26 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 27 | <p>This page describes the process for deploying devices to corporate users |
| 28 | using NFC or with an activation code (for a complete list of requirements, see |
| 29 | <a href="{@docRoot}devices/tech/admin/implement.html">Implementing Device |
| 30 | Administration</a>).</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 31 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 32 | <p>To get started, download the |
| 33 | <a href="https://github.com/googlesamples/android-NfcProvisioning">NfcProvisioning |
| 34 | APK</a> |
| 35 | and |
| 36 | <a href="https://github.com/googlesamples/android-DeviceOwner">Android-DeviceOwner |
| 37 | APK</a>. |
| 38 | </p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 39 | |
Clay Murphy | a655ca3 | 2015-08-26 15:28:13 -0700 | [diff] [blame] | 40 | <p class="caution"><strong>Caution:</strong> If provisioning has already |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 41 | started, affected devices must be factory reset first.</p> |
Clay Murphy | a655ca3 | 2015-08-26 15:28:13 -0700 | [diff] [blame] | 42 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 43 | <h2 id=managed_provisioning>Managed provisioning</h2> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 44 | |
| 45 | <p>Managed Provisioning is a framework UI flow to ensure users are adequately |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 46 | informed of the implications of setting a device owner or managed profile. It is |
| 47 | designed to act as a setup wizard for managed profiles.</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 48 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 49 | <p class="note"><strong>Note:</strong> The device owner can be set only from an |
| 50 | unprovisioned device. If <code>Settings.Secure.USER_SETUP_COMPLETE</code> has |
| 51 | ever been set, the device is considered provisioned and the device owner cannot |
| 52 | be set.</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 53 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 54 | <p>Devices that enable default encryption offer a considerably simpler and |
| 55 | quicker device administration provisioning flow. The managed provisioning |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 56 | component:</p> |
| 57 | |
| 58 | <ul> |
| 59 | <li>Encrypts the device</li> |
| 60 | <li>Creates the managed profile</li> |
| 61 | <li>Disables non-required applications</li> |
| 62 | <li>Sets the enterprise mobility management (EMM) app as profile owner</li> |
| 63 | </ul> |
| 64 | |
| 65 | <p>In turn, the EMM app:</p> |
| 66 | |
| 67 | <ul> |
| 68 | <li>Adds user accounts</li> |
| 69 | <li>Enforces device compliance</li> |
| 70 | <li>Enables any additional system applications</li> |
| 71 | </ul> |
| 72 | |
| 73 | <p>In this flow, managed provisioning triggers device encryption. The framework |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 74 | copies the EMM app into the managed profile as part of managed provisioning. The |
| 75 | instance of the EMM app inside of the managed profile gets a callback from the |
| 76 | framework when provisioning is done. The EMM can then add accounts and enforce |
| 77 | policies; it then calls <code>setProfileEnabled()</code>, which makes the |
| 78 | launcher icons visible.</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 79 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 80 | <h2 id=profile_owner_provisioning>Profile owner provisioning</h2> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 81 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 82 | <p>Profile owner provisioning assumes the user of the device (and not a company |
| 83 | IT department) oversees device management. To enable profile owner provisioning, |
| 84 | you must send an intent with appropriate extras. For an example, use the TestDPC |
| 85 | application |
| 86 | (<a href="https://play.google.com/store/apps/details?id=com.afwsamples.testdpc&hl=en">Download |
| 87 | from Google Play</a> or <a href="https://github.com/googlesamples/android-testdpc/">Build |
| 88 | from GitHub</a>). Install TestDPC on the device, launch the app from the |
| 89 | launcher, then follow the app instructions. Provisioning is complete when badged |
| 90 | icons appear in the launcher drawer.</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 91 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 92 | <p>Mobile Device Management (MDM) applications trigger the creation of the |
| 93 | managed profile by sending an intent with action: |
| 94 | <a href="https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/admin/DevicePolicyManager.java">DevicePolicyManager.ACTION_PROVISION_MANAGED_PROFILE</a> |
| 95 | . Below is a sample intent that triggers the creation of the managed profile |
| 96 | and sets the DeviceAdminSample as the profile owner:</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 97 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 98 | <pre>adb shell am start -a android.app.action.PROVISION_MANAGED_PROFILE \ |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 99 | -c android.intent.category.DEFAULT \ |
| 100 | -e wifiSsid $(printf '%q' \"GoogleGuest\") \ |
| 101 | -e deviceAdminPackage "com.google.android.deviceadminsample" \ |
| 102 | -e android.app.extra.deviceAdminPackageName $(printf '%q' |
| 103 | .DeviceAdminSample\$DeviceAdminSampleReceiver) \ |
| 104 | -e android.app.extra.DEFAULT_MANAGED_PROFILE_NAME "My Organisation" |
| 105 | </pre> |
| 106 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 107 | <h2 id=device_owner_provisioning_via_nfc>Device owner provisioning via NFC</h2> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 108 | |
| 109 | <p>Device owner provisioning via NFC is similar to the profile owner method but |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 110 | requires more bootstrapping. To use this method, |
| 111 | <a href="http://developer.android.com/guide/topics/connectivity/nfc/nfc.html">NFC |
| 112 | bump</a> the device during the initial setup step (i.e., first page of the setup |
| 113 | wizard). This low-touch flow configures Wi-Fi, installs the DPC, and sets the |
| 114 | DPC as device owner.</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 115 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 116 | <p>A typical NFC bundle includes the following:</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 117 | |
| 118 | <pre> |
| 119 | EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_NAME |
| 120 | EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_LOCATION |
| 121 | EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM |
| 122 | EXTRA_PROVISIONING_WIFI_SSID |
| 123 | EXTRA_PROVISIONING_WIFI_SECURITY_TYPE |
| 124 | </pre> |
| 125 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 126 | <p>Devices must have NFC configured to accept the managed provisioning |
| 127 | mimetype from the setup experience:</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 128 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 129 | <pre>/packages/apps/Nfc/res/values/provisioning.xml |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 130 | |
| 131 | <bool name="enable_nfc_provisioning">true</bool> |
| 132 | <item>application/com.android.managedprovisioning</item> |
| 133 | </pre> |
| 134 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 135 | <h2 id=device_owner_provisioning_with_activation_code>Device owner provisioning |
| 136 | with activation code</h2> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 137 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 138 | <p>Select <em>Add Work Account</em> from the setup/out-of-box experience (this |
| 139 | triggers a lookup of the EMM from Android servers). The device installs the EMM |
| 140 | app and starts provisioning flow. As an extra option, Android device |
| 141 | administration supports the option of using email address with a six-digit |
| 142 | activation code to bootstrap the process as part of setup.</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 143 | |
| 144 | <h2 id=emm_benefits>EMM benefits</h2> |
| 145 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 146 | <p>An enterprise mobility management (EMM) app can help by conducting the |
| 147 | following tasks:</p> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 148 | |
| 149 | <ul> |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 150 | <li>Provision managed profile</li> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 151 | <li>Apply security policies |
| 152 | <ul> |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 153 | <li>Set password complexity</li> |
| 154 | <li>Lockdowns: disable screenshots, sharing from managed profile, etc.</li> |
| 155 | </ul></li> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 156 | <li>Configure enterprise connectivity |
| 157 | <ul> |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 158 | <li>Use WifiEnterpriseConfig to configure corporate Wi-Fi</li> |
| 159 | <li>Configure VPN on the device</li> |
| 160 | <li>Use <code>DPM.setApplicationRestrictions()</code> to configure corporate |
| 161 | VPN</li> |
| 162 | </ul></li> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 163 | <li>Enable corporate app Single Sign-On (SSO) |
| 164 | <ul> |
| 165 | <li>Install desired corporate apps |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 166 | <li>Use <code>DPM.installKeyPair()</code> to silently install corp client |
| 167 | certs</li> |
| 168 | <li>Use <code>DPM.setApplicationRestrictions()</code> to configure |
| 169 | hostnames, cert alias’ of corporate apps</li> |
| 170 | </ul></li> |
Clay Murphy | 648990e | 2015-04-08 17:58:14 -0700 | [diff] [blame] | 171 | </ul> |
| 172 | |
Heidi von Markham | 8fba474 | 2016-06-28 15:09:15 -0700 | [diff] [blame^] | 173 | <p>Managed provisioning is just one part of the EMM end-to-end workflow, with |
| 174 | the end goal of making corporate data accessible to apps in the managed |
| 175 | profile. For testing guidance, see |
| 176 | <a href="{@docRoot}devices/tech/admin/testing-setup.html">Setting up Device |
| 177 | Testing</a>.</p> |