Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 1 | page.title=API Overview |
Joe Fernandez | e786688 | 2015-05-06 17:15:03 -0700 | [diff] [blame] | 2 | page.keywords=preview,sdk,compatibility |
Dirk Dougherty | 7470945 | 2015-05-15 00:51:24 -0700 | [diff] [blame] | 3 | sdk.platform.apiLevel=22-mnc |
| 4 | page.image=images/cards/card-key-changes_16-9_2x.png |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 5 | @jd:body |
| 6 | |
| 7 | |
| 8 | <div id="qv-wrapper"> |
| 9 | <div id="qv"> |
| 10 | |
| 11 | <h2>In this document |
| 12 | <a href="#" onclick="hideNestedItems('#toc44',this);return false;" class="header-toggle"> |
| 13 | <span class="more">show more</span> |
| 14 | <span class="less" style="display:none">show less</span></a></h2> |
| 15 | |
| 16 | <ol id="toc44" class="hide-nested"> |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 17 | <li><a href="#backup">Auto Backup for Apps</a></li> |
| 18 | <li><a href="#notifications">Notifications</a></li> |
| 19 | <li><a href="#authentication">Authentication</a> |
| 20 | <ul> |
| 21 | <li><a href="#fingerprint-authentication">Fingerprint Authentication</a></li> |
| 22 | <li><a href="#confirm-credentials">Confirm Credentials</a></li> |
| 23 | </ul> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 24 | </li> |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 25 | <li><a href="#direct-share">Direct Share</a></li> |
| 26 | <li><a href="#voice-interactions">Voice Interactions</a></li> |
| 27 | <li><a href="#bluetooth-stylus">Bluetooth Stylus Support</a></li> |
| 28 | <li><a href="#audio">New Audio Features</a></li> |
| 29 | <li><a href="#afw">New Android for Work Features</a></li> |
| 30 | </ol> |
| 31 | |
| 32 | <h2>API Differences</h2> |
| 33 | <ol> |
| 34 | <li><a href="">API level 22 to M »</a> </li> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 35 | </ol> |
| 36 | |
| 37 | </div> |
| 38 | </div> |
| 39 | |
| 40 | <p>The M Developer Preview gives you an advance look at the upcoming release |
| 41 | for the Android platform, which offers new features for users and app |
| 42 | developers. This document provides an introduction to the most notable APIs.</p> |
| 43 | |
| 44 | <p>The M Developer Preview is intended for <strong>developer early |
| 45 | adopters</strong> and <strong>testers</strong>. If you are interested in |
| 46 | influencing the direction of the Android framework, |
| 47 | <a href="{@docRoot}preview/setup-sdk.html">give the M Developer Preview a |
| 48 | try</a> and send us your feedback!</p> |
| 49 | |
| 50 | <p class="caution"><strong>Caution:</strong> Do not not publish apps |
| 51 | that use the M Developer Preview to the Google Play store.</p> |
| 52 | |
| 53 | <p class="note"><strong>Note:</strong> This document often refers to classes and |
| 54 | methods that do not yet have reference material available on <a |
| 55 | href="{@docRoot}">developer.android.com</a>. These API elements are |
| 56 | formatted in {@code code style} in this document (without hyperlinks). For the |
| 57 | preliminary API documentation for these elements, download the <a |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 58 | href="http://storage.googleapis.com/androiddevelopers/preview/m-developer-preview-reference.zip"> |
| 59 | preview reference</a>.</p> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 60 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 61 | <h3>Important behavior changes</h3> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 62 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 63 | <p>If you have previously published an app for Android, be aware that your app might be affected |
| 64 | by changes in M.</p> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 65 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 66 | <p>Please see <a href="api-changes.html">Behavior Changes</a> for complete information.</p> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 67 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 68 | <h2 id="backup">Auto Backup for Apps</h2> |
| 69 | <p>The system now performs automatic full data backup and restore for apps. This behavior is |
| 70 | enabled by default for apps targeting M; you do not need to add any additional code. If users |
| 71 | delete their Google account, their backup data is deleted as well.</p> |
| 72 | <p>To learn how this feature works and how to configure what to back up on the file system, |
| 73 | see the <a href="">App Backup for Apps guide</a>.</p> |
| 74 | |
| 75 | <h2 id="notifications">Notifications</h2> |
| 76 | <p>M adds the following API changes for notifications:</p> |
| 77 | <ul> |
| 78 | <li>New {@code NotificationListenerService.INTERRUPTION_FILTER_ALARMS} filter level that |
| 79 | corresponds to the new <em>Alarms only</em> do not disturb mode.</li> |
| 80 | <li>New {@code Notification.CATEGORY_REMINDER} category value that is used to distinguish |
| 81 | user-scheduled reminders from other events |
| 82 | ({@link android.app.Notification#CATEGORY_EVENT}) and alarms |
| 83 | ({@link android.app.Notification#CATEGORY_ALARM}).</li> |
| 84 | <li>New {@code android.graphics.drawable.Icon} class which can be attached to your notifications |
| 85 | via the Notification.Builder.setIcon() and Notification.Builder.setLargeIcon() methods.</li> |
| 86 | <li>New {@code NotificationManager.getActiveNotifications()} method that allows your apps to |
| 87 | find out which of their notifications are currently alive.</li> |
| 88 | </ul> |
| 89 | |
| 90 | <h2 id="authentication">Authentication</h2> |
| 91 | <p>The M release offers new APIs to let you authenticate users by using their fingerprint scans on |
| 92 | supported devices, and check how recently the user was last authenticated using a device unlocking |
| 93 | mechanism (such as a lockscreen password). Use these APIs in conjunction with |
| 94 | the <a href="{@docRoot}training/articles/keystore.html">Android Keystore system</a>.</p> |
| 95 | |
| 96 | <h3 id="fingerprint-authentication">Fingerprint Authentication</h3> |
| 97 | |
| 98 | <p>To authenticate users via fingerprint scan, get an instance of the new |
| 99 | {@code android.hardware.fingerprint.FingerprintManager} class and call the |
| 100 | {@code FingerprintManager.authenticate()} method. Your app must be running on a device with a |
| 101 | fingerprint sensor. You must implement the user interface for the fingerprint |
| 102 | authentication flow on your app, and use the standard fingerprint Android icon in your UI. |
| 103 | If you are developing multiple apps that use fingerprint authentication, note that each app must |
| 104 | authenticate the user’s fingerprint independently. |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 105 | </p> |
| 106 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 107 | <img src="{@docRoot}preview/images/fingerprint-screen_2x.png" |
| 108 | srcset="{@docRoot}preview/images/fingerprint-screen.png 1x, preview/images/fingerprint-screen_2x.png 2x" |
| 109 | style="margin:0 0 10px 20px" width="282" height="476" /> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 110 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 111 | <p>To use this feature in your app, first add the {@code USE_FINGERPRINT} permission in your |
| 112 | manifest.</p> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 113 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 114 | <pre> |
| 115 | <uses-permission |
| 116 | android:name="android.permission.USE_FINGERPRINT" /> |
| 117 | </pre> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 118 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 119 | <p>The following snippet shows how you might listen for fingerprint events in your |
| 120 | {@code FingerprintManager.AuthenticationCallback} implementation.</p> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 121 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 122 | <pre> |
| 123 | // Call this to start listening for fingerprint events |
| 124 | public void startListening(FingerprintManager.CryptoObject cryptoObject) { |
| 125 | if (!isFingerprintAuthAvailable()) { |
| 126 | return; |
| 127 | } |
| 128 | mCancellationSignal = new CancellationSignal(); |
| 129 | mSelfCancelled = false; |
| 130 | mFingerprintManager.authenticate(cryptoObject, |
| 131 | mCancellationSignal, this, 0 /* flags */); |
| 132 | // Icon to display when prompting users to start a fingerprint scan |
| 133 | mIcon.setImageResource(R.drawable.ic_fp_40px); |
| 134 | } |
| 135 | |
| 136 | // Helper method to check if the device supports fingerprint |
| 137 | // scanning and if the user has enrolled at least one fingerprint. |
| 138 | public boolean isFingerprintAuthAvailable() { |
| 139 | return mFingerprintManager.isHardwareDetected() |
| 140 | && mFingerprintManager.hasEnrolledFingerprints(); |
| 141 | } |
| 142 | </pre> |
| 143 | |
| 144 | <h3 id="confirm-credentials">Confirm Credentials</h3> |
| 145 | <p>Your app can authenticate users based on how recently they last unlocked their device. You can |
| 146 | use the same public or secret key to authenticate users into multiple apps. This feature frees |
| 147 | users from having to remember additional app-specific passwords, and avoids the need for you to |
| 148 | implement your own authentication user interface.</p> |
| 149 | |
| 150 | <p>You can set your own authentication policy by setting constraints against the key that you are |
| 151 | generating or importing. To set the constraints for using a key, use the |
| 152 | {@code android.security.KeyPairGeneratorSpec.Builder} and |
| 153 | {@code android.security.KeyGeneratorSpec.Builder} classes for public key pairs and secret keys |
| 154 | respectively. If you are importing keys, use the {@link android.security.KeyStoreParameter.Builder} |
| 155 | class to set your constraints.</p> |
| 156 | |
| 157 | <p>The following example shows how you might create a symmetric key in the Keystore which can only be |
| 158 | used if the user has successfully unlocked the device within the last 5 minutes.</p> |
| 159 | |
| 160 | <pre> |
| 161 | private void createKey() { |
| 162 | // Generate a key to decrypt payment credentials, tokens, etc. |
| 163 | // This will most likely be a registration step for the user when |
| 164 | // they are setting up your app. |
| 165 | try { |
| 166 | KeyStore ks = KeyStore.getInstance("AndroidKeyStore"); |
| 167 | ks.load(null); |
| 168 | KeyGenerator keyGenerator = KeyGenerator.getInstance("AES", |
| 169 | "AndroidKeyStore"); |
| 170 | keyGenerator.init(new KeyGeneratorSpec.Builder(this) |
| 171 | // Alias of the entry in Android KeyStore where the key will appear |
| 172 | .setAlias(KEY_NAME) |
| 173 | // Key use constraints |
| 174 | .setPurposes(KeyStoreKeyProperties.Purpose.ENCRYPT |
| 175 | | KeyStoreKeyProperties.Purpose.DECRYPT) |
| 176 | .setBlockModes("CBC") |
| 177 | .setUserAuthenticationRequired(true) |
| 178 | // Require that the user has unlocked in the last 5 minutes |
| 179 | .setUserAuthenticationValidityDurationSeconds(5 * 60) |
| 180 | .setEncryptionPaddings("PKCS7Padding") |
| 181 | .build()); |
| 182 | keyGenerator.generateKey(); |
| 183 | } catch (NoSuchAlgorithmException | NoSuchProviderException |
| 184 | | InvalidAlgorithmParameterException | KeyStoreException |
| 185 | | CertificateException | IOException e) { |
| 186 | throw new RuntimeException(e); |
| 187 | } |
| 188 | } |
| 189 | </pre> |
| 190 | |
| 191 | <p>To determine the last time users logged into their account, call the |
| 192 | {@code android.accounts.AccountManager.confirmCredentials()} method. If the call is successful, the |
| 193 | method returns an bundle that includes a {@code KEY_LAST_AUTHENTICATED_TIME} value which indicates |
| 194 | the last time, in milliseconds, that the credential for that account was validated or created.</p> |
| 195 | |
| 196 | <h2 id="direct-share">Direct Share</h2> |
| 197 | |
| 198 | <img src="{@docRoot}preview/images/direct-share-screen_2x.png" |
| 199 | srcset="{@docRoot}preview/images/direct-share-screen.png 1x, preview/images/direct-share-screen_2x.png 2x" |
| 200 | style="float:right; margin:0 0 20px 30px" width="312" height="385" /> |
| 201 | |
| 202 | <p>This release provides you with APIs to makes sharing intuitive and quick for users. You can now |
| 203 | define <em>deep links</em> that target a specific activity in your app. These deep links are |
| 204 | exposed to users via the <em>Share</em> menu. This feature allows users to share content to |
| 205 | targets, such as contacts, within other apps. For example, the deep link might launch an |
| 206 | activity in another social network app, which lets the user share content directly to a specific |
| 207 | friend or community in that app.</p> |
| 208 | |
| 209 | <p>To enable sharing via deep links, you must define a class that extends the |
| 210 | {@code android.service.} <br> |
| 211 | {@code chooser.ChooserTargetService} class. Declare your |
| 212 | {@code ChooserTargetService} in the manifest. Within that declaration, specify the |
| 213 | {@code BIND_CHOOSER_TARGET_SERVICE} permission and an intent filter with the |
| 214 | {@code SERVICE_INTERFACE} action.</p> |
| 215 | <p>The following example shows how you might declare the {@code ChooserTargetService} in your |
| 216 | manifest.</p> |
| 217 | <br> |
| 218 | <br> |
| 219 | <br> |
| 220 | <pre> |
| 221 | <service android:name=".ChooserTargetService" |
| 222 | android:label="@string/service_name" |
| 223 | android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE"> |
| 224 | <intent-filter> |
| 225 | <action android:name="android.service.chooser.ChooserTargetService" /> |
| 226 | </intent-filter> |
| 227 | </service> |
| 228 | </pre> |
| 229 | |
| 230 | <p>For each activity that you want to expose to the {@code ChooserTargetService}, add a |
| 231 | {@code <meta-data>} element with the name |
| 232 | {@code "android.service.chooser.chooser_target_service"} in your app manifest. |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 233 | </p> |
| 234 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 235 | <pre> |
| 236 | <activity android:name=".MyShareActivity” |
| 237 | android:label="@string/share_activity_label"> |
| 238 | <intent-filter> |
| 239 | <action android:name="android.intent.action.SEND" /> |
| 240 | </intent-filter> |
| 241 | <meta-data |
| 242 | android:name="android.service.chooser.chooser_target_service" |
| 243 | android:value=".ChooserTargetService" /> |
| 244 | </activity> |
| 245 | </pre> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 246 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 247 | <h2 id="voice-interactions">Voice Interactions</h2> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 248 | <p> |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 249 | This release provides a new voice interaction API which, together with |
| 250 | <a href="https://developers.google.com/voice-actions/" class="external-link">Voice Actions</a>, |
| 251 | allows you to build conversational voice experiences into your apps. Call the |
| 252 | {@code android.app.Activity.isVoiceInteraction()} method to determine if your activity was |
| 253 | started in response to a voice action. If so, your app can use the |
| 254 | {@code android.app.VoiceInteractor} class to request a voice confirmation from the user, select |
| 255 | from a list of options, and more.</p> |
| 256 | <p>To learn more about implementing voice actions, see the voice interaction API |
| 257 | <a href="https://developers.google.com/voice-actions/interaction/" |
| 258 | class="external-link">guide</a>. |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 259 | </p> |
| 260 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 261 | <h2 id="bluetooth-stylus">Bluetooth Stylus Support</h2> |
| 262 | <p>The M release provides improved support for user input using a Bluetooth stylus. If the user |
| 263 | touches a stylus with a button on the screen of your app, the |
| 264 | {@link android.view.MotionEvent#getToolType(int) getTooltype()} method now returns |
| 265 | {@code TOOL_TYPE_STYLUS}. The {@link android.view.MotionEvent#getButtonState() getButtonState()} |
| 266 | method returns {@link android.view.MotionEvent#BUTTON_SECONDARY} when the user |
| 267 | presses the primary stylus button. If the stylus has a second button, the same method returns |
| 268 | {@link android.view.MotionEvent#BUTTON_TERTIARY} when the user presses it. If the user presses |
| 269 | both buttons simultaneously, the method returns both these values. In addition, the system reports |
| 270 | the user button-press action to the new {@code View.onStylusButtonPressListener} and |
| 271 | {@code GestureDetector.OnStylusButtonPressListener} callbacks in your activity, if you have |
| 272 | registered these listeners in your app.</p> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 273 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 274 | <h2 id="audio">New Audio Features</h2> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 275 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 276 | <p>This release adds enhancements to audio processing on Android, including: </p> |
| 277 | <ul> |
| 278 | <li>Support for the <a href="http://en.wikipedia.org/wiki/MIDI" class="external-link">MIDI</a> |
| 279 | protocol, with the new {@code android.media.midi} APIs. Use these APIs to send and receive MIDI |
| 280 | events.</li> |
| 281 | <li>New {@code android.media.AudioRecord.Builder} and {@code android.media.AudioTrack.Builder} |
| 282 | classes to create digital audio capture and playback objects respectively, and configure audio |
| 283 | source and sink properties to override the system defaults.</li> |
| 284 | <li>API hooks for associating audio and input devices. This is particularly useful if your app |
| 285 | allows users to start a voice search from a game controller or remote control connected to Android |
| 286 | TV. The system invokes the new {@code android.app.Activity.onSearchRequested()} callback when the |
| 287 | user starts a search. To determine if the user's input device has a built-in microphone, retrieve |
| 288 | the {@link android.view.InputDevice} object from that callback, then call the new |
| 289 | {@code InputDevice.hasMic()} method.</li> |
| 290 | <li>New {@code android.media.AudioDevicesManager} class which lets you retrieve a list of all |
| 291 | attached source and sink audio devices. You can also specify an |
| 292 | {@code android.media.OnAudioDeviceConnectionListener} object if you want your app to be notified |
| 293 | when an audio device is connected or disconnected.</li> |
| 294 | </ul> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 295 | |
Joe Fernandez | a06ac3a | 2015-05-15 15:42:17 -0700 | [diff] [blame] | 296 | <h2 id="afw">New Android for Work Features</h2> |
| 297 | <p>This release includes the following new APIs for Android for Work:</p> |
| 298 | <ul> |
| 299 | <li><strong>Enhanced controls for Corporate-Owned, Single-Use devices:</strong> The Device Owner |
| 300 | can now control the following settings to improve management of |
| 301 | Corporate-Owned, Single-Use (COSU) devices: |
| 302 | <ul> |
| 303 | <li>Disable or re-enable the keyguard with the |
| 304 | {@code DevicePolicyManager.setKeyguardEnabledState()} method.</li> |
| 305 | <li>Disable or re-enable the status bar (including quick settings, notifications, and the |
| 306 | navigation swipe-up gesture that launches Google Now) with the |
| 307 | {@code DevicePolicyManager.setStatusBarEnabledState()} method.</li> |
| 308 | <li>Disable or re-enable safe boot with the {@link android.os.UserManager} constant |
| 309 | {@code DISALLOW_SAFE_BOOT}.</li> |
| 310 | <li>Prevent the screen from turning off while plugged in with the |
| 311 | {@link android.provider.Settings.Global} constant {@code STAY_ON_WHILE_PLUGGED_IN}.</li> |
| 312 | </ul> |
| 313 | </li> |
| 314 | <li><strong>Silent install and uninstall of apps by Device Owner:</strong> A Device Owner can now |
| 315 | silently install and uninstall applications using the {@link android.content.pm.PackageInstaller} |
| 316 | APIs, independent of Google Play for Work. You can now provision devices through a Device Owner that |
| 317 | fetches and installs apps without user interaction. This feature is useful for enabling one-touch |
| 318 | provisioning of kiosks or other such devices without activating a Google account.</li> |
| 319 | <li><strong>Silent enterprise certificate access: </strong> When an app calls |
| 320 | {@link android.security.KeyChain#choosePrivateKeyAlias(android.app.Activity,android.security.KeyChainAliasCallback,java.lang.String[],java.security.Principal[],java.lang.String,int,java.lang.String) choosePrivateKeyAlias()}, |
| 321 | prior to the user being prompted to select a certificate, the Profile or Device Owner can now call |
| 322 | the {@code DeviceAdminReceiver.onChoosePrivateKeyAlias()} method to provide the alias silently to |
| 323 | the requesting application. This feature lets you grant managed apps access to certificates |
| 324 | without user interaction.</li> |
| 325 | <li><strong>Auto-acceptance of system updates.</strong> By setting a system update policy with |
| 326 | {@code DevicePolicyManager.setSystemUpdatePolicy()}, a Device Owner can now auto-accept a system |
| 327 | update, for instance in the case of a kiosk device, or postpone the update and prevent it being |
| 328 | taken by the user for up to 30 days. Furthermore, an administrator can set a time window in which an |
| 329 | update must be taken, for example during the hours when a kiosk device is not in use. When a |
| 330 | system update is available, the system checks if the Work Policy Controller app has set a system |
| 331 | update policy, and behaves accordingly. |
| 332 | </li> |
| 333 | <li> |
| 334 | <strong>Delegated certificate installation.</strong> A Profile or Device Owner can now grant a |
| 335 | third-party app the ability to call these {@link android.app.admin.DevicePolicyManager} certificate |
| 336 | management APIs: |
| 337 | <ul> |
| 338 | <li>{@link android.app.admin.DevicePolicyManager#getInstalledCaCerts(android.content.ComponentName) |
| 339 | getInstalledCaCerts()}</li> |
| 340 | <li>{@link android.app.admin.DevicePolicyManager#hasCaCertInstalled(android.content.ComponentName,byte[]) |
| 341 | hasCaCertInstalled()}</li> |
| 342 | <li>{@link android.app.admin.DevicePolicyManager#installCaCert(android.content.ComponentName,byte[]) |
| 343 | installCaCert()}</li> |
| 344 | <li>{@link android.app.admin.DevicePolicyManager#uninstallCaCert(android.content.ComponentName,byte[]) |
| 345 | uninstallCaCert()}</li> |
| 346 | <li>{@link android.app.admin.DevicePolicyManager#uninstallAllUserCaCerts(android.content.ComponentName) |
| 347 | uninstallAllUserCaCerts()}</li> |
| 348 | <li>{@link android.app.admin.DevicePolicyManager#installKeyPair(android.content.ComponentName,java.security.PrivateKey,java.security.cert.Certificate,java.lang.String) |
| 349 | installKeyPair()}</li> |
| 350 | </ul> |
| 351 | </li> |
| 352 | <li><strong>Enterprise factory reset protection.</strong> When provisioning a Device Owner, you can |
| 353 | now configure parameters for bypassing Factory Reset Protection (FRP), by setting the |
| 354 | {@code DeviceManagerPolicy.EXTRA_PROVISIONING_RESET_PROTECTION_PARAMETERS} bundle. An NFC Programmer |
| 355 | app can provide these parameters after a device has been reset to bypass FRP and provision the device, |
| 356 | without requiring the previously configured Google account. If you don't modify these parameters, |
| 357 | FRP remains in-place and prevents the device from being activated without the previously activated |
| 358 | Google credentials.</li> |
| 359 | <li><strong>Data usage tracking.</strong> A Profile or Device Owner can now query for the data |
| 360 | usage statistics visible in <em>Settings > Data</em> usage by using the new |
| 361 | {@code android.app.usage.NetworkStatsManager} methods. Profile Owners are automatically granted |
| 362 | permission to query data on the profile they manage, while Device Owners get access to usage data |
| 363 | of the managed primary user.</li> |
| 364 | </ul> |
Joe Fernandez | 306f1ce | 2015-05-01 12:51:21 -0700 | [diff] [blame] | 365 | |
| 366 | <p class="note"> |
| 367 | For a detailed view of all API changes in the M Developer Preview, see the <a href= |
| 368 | "{@docRoot}preview/reference.html">API Differences Report</a>. |
| 369 | </p> |