diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd index bf5eec49c0b95..fd76e0a2af35e 100644 --- a/docs/html/preview/api-overview.jd +++ b/docs/html/preview/api-overview.jd @@ -15,7 +15,8 @@ page.image=images/cards/card-api-overview_16-9_2x.png show less
Please see Behavior Changes for complete information.
-This preview enhances Android’s intent system by providing more powerful app linking. +This feature allows you to associate an app with a web domain you own. Based on this +association, the platform can determine the default app to use to handle a particular +web link and skip prompting users to select an app. To learn how to implement this feature, see +App Linking. + +
The system now performs automatic full data backup and restore for apps. This behavior is enabled by default for apps targeting M Preview; you do not need to add any additional code. If users delete their Google accounts, their backup data is deleted as well. To learn how this feature works and how to configure what to back up on the file system, see -Automatic App Data Backup.
+Auto Backup for Apps.This preview offers new APIs to let you authenticate users by using their fingerprint scans on @@ -121,9 +129,9 @@ style="float:right; margin:0 0 10px 20px" width="282" height="476" />
If you are testing this feature, follow these steps:
Your app can authenticate users based on how recently they last unlocked their device. You can -use the same public or secret key to authenticate users. This feature frees -users from having to remember additional app-specific passwords, and avoids the need for you to -implement your own authentication user interface.
+Your app can authenticate users based on how recently they last unlocked their device. This +feature frees users from having to remember additional app-specific passwords, and avoids the need +for you to implement your own authentication user interface. Your app should use this feature in +conjunction with a public or secret key implementation for user authentication.
-You can set your own authentication policy by setting constraints against the key that you are -generating or importing. To set the constraints for using a key, use the -{@code android.security.KeyPairGeneratorSpec.Builder} and -{@code android.security.KeyGeneratorSpec.Builder} classes for public key pairs and secret keys -respectively. If you are importing keys, use the {@link android.security.KeyStoreParameter.Builder} -class to set your constraints. You can use the +
To set the timeout duration for which the same key can be re-used after a user is successfully +authenticated, call the new +{@code android.security.keystore.KeyGenParameterSpec.setUserAuthenticationValidityDurationSeconds()} +method when you set up a {@link javax.crypto.KeyGenerator} or +{@link java.security.KeyPairGenerator}. This feature currently works for symmetric cryptographic +operations.
+ +Avoid showing the re-authentication dialog excessively -- your apps should try using the +cryptographic object first and if the the timeout expires, use the {@link android.app.KeyguardManager#createConfirmDeviceCredentialIntent(java.lang.CharSequence, java.lang.CharSequence) createConfirmDeviceCredentialIntent()} -method to re-authenticate the user within your app if the timeout expired. +method to re-authenticate the user within your app.
To see an app implementation of this feature, refer to the - + Confirm Device Credentials sample.
+style="float:right; margin:0 0 20px 30px" width="312" height="335" />
-This preview provides you with APIs to makes sharing intuitive and quick for users. You can now -define deep links that target a specific activity in your app. These deep links are -exposed to users via the Share menu. This feature allows users to share content to -targets, such as contacts, within other apps. For example, the deep link might launch an -activity in another social network app, which lets the user share content directly to a specific -friend or community in that app.
+This preview provides you with APIs to make sharing intuitive and quick for users. You can now +define direct share targets that launch a specific activity in your app. These direct share +targets are exposed to users via the Share menu. This feature allows users to share +content to targets, such as contacts, within other apps. For example, the direct share target might +launch an activity in another social network app, which lets the user share content directly to a +specific friend or community in that app.
-To enable sharing via deep links, you must define a class that extends the +
To enable direct share targets you must define a class that extends the
{@code android.service.}
{@code chooser.ChooserTargetService} class. Declare your
{@code ChooserTargetService} in the manifest. Within that declaration, specify the
@@ -203,10 +214,6 @@ manifest.
To see an app implementation of this feature, refer to the - - Deep Link Sharing sample.
-@@ -226,9 +233,10 @@ class="external-link">Voice Actions developer site. This preview offers a new way for users to engage with your apps through an assistant. To use this feature, the user must enable the assistant to use the current context. Once enabled, the user can summon the assistant within any app, by long-pressing on the Home button.
-The platform passes the current context to the assistant. In addition to the standard set of -information that the platform passes to the assistant, your app can share additional information -by using the new {@code android.app.Activity.AssistContent} class.
+Your app can elect to not share the current context with the assistant by setting the +{@link android.view.WindowManager.LayoutParams#FLAG_SECURE} flag. In addition to the +standard set of information that the platform passes to the assistant, your app can share +additional information by using the new {@code android.app.Activity.AssistContent} class.
To provide the assistant with additional context from your app, follow these steps:
@@ -324,9 +332,6 @@ feature is useful if you want to switch to 4K display resolution. While in 4K di UI continues to be rendered at the original resolution (such as 1080p) and is upscaled to 4K, but {@link android.view.SurfaceView} objects may show content at the native resolution. -To test the new 4K display mode, simulate a secondary display of a larger resolution using the -Developer Options settings.
-Theme attributes are now supported in {@link android.content.res.ColorStateList} for devices running the M Preview. The @@ -494,22 +499,16 @@ Google credentials.
Additionally, by setting app restrictions on Google Play services, Device Owners can specify alternative Google accounts for unlocking FRP to replace the ones activated on the device.
-A Profile or Device Owner can also set a permission policy +
A Profile or Device Owner can set a permission policy for all runtime requests of all applications using {@code DevicePolicyManager.setPermissionPolicy()}, to either prompt the user to grant the permission as normal or automatically grant or deny the permission silently. If the latter policy @@ -517,8 +516,10 @@ is set, the user cannot modify the selection made by the Profile or Device Owner app’s permissions screen in Settings.
API Level: M
Along with new features and capabilities, the M Developer Preview includes a variety of system changes and API behavior changes. This document highlights some of the key changes that you should be understand and account for in your apps.
@@ -67,16 +65,16 @@ new {@code Context.checkSelfPermission()} method. To request for a permission, c Android M Preview Runtime Permissions. -This preview introduces new power-saving optimizations for idle devices and apps.
-If a device is unplugged and left stationary with the screen off for a period of time, it goes into Doze mode where it attempts to keep the system in a sleep state. In this mode, devices periodically resume normal operations for brief periods of time so that app syncing can occur and the system can perform any pending operations.
-The following restrictions apply to your apps while in Doze mode:
+The following restrictions apply to your apps while in Doze:
When the device exists doze mode, it executes any jobs and syncs that are pending.
+When the device exits doze, it executes any jobs and syncs that are pending.
You can test this feature by connecting a device running the M Preview to your development machine and calling the following commands:
@@ -98,10 +96,11 @@ $ adb shell dumpsys battery unplug $ adb shell dumpsys deviceidle step $ adb shell dumpsys deviceidle -h -Note: The upcmoning -Google Cloud Messaging release lets you designate +
Note: The upcoming + +Google Cloud Messaging release lets you designate high-priority messages. If your app receives high-priority GCM messages, it’s granted -brief network access even when the device is in doze mode. +brief network access even when the device is in doze.
-$ adb shell am broadcast -a android.os.action.DISCHARGING +$ adb shell dumpsys battery unplug $ adb shell am set-idle <packageName> true $ adb shell am set-idle <packageName> false $ adb shell am get-idle <packageName>
Note: The upcoming -Google Cloud Messaging (GCM) release lets you + +Google Cloud Messaging (GCM) release lets you designate high-priority messages. If your app receives high-priority GCM messages, it’s granted brief network access even when the app is idle.
@@ -266,20 +267,6 @@ DSA. ECDSA is still supported. is disabled or reset (for example, by the user or a Device Administrator). Keys which require encryption at rest will be deleted during these events. --Support for the {@code -night} resource qualifier has been updated. Previously, night mode was -only available when a device was docked and in car mode. With this preview, night mode is -available on -all devices and is user-configurable via Settings > Display > Theme. You can adjust -this setting globally using {@link android.app.UiModeManager#setNightMode(int) setNightMode()}. The -Dark theme corresponds to {@link android.app.UiModeManager#MODE_NIGHT_YES}. When the device is in -night mode, the resource framework prefers resources that have the {@code -night} qualifier. To -take advantage of user-configurable Dark mode in your app, extend from the -{@code Theme.Material.DayNight} set of themes rather than {@code Theme.Material} or -{@code Theme.Material.Light}. -
-This preview introduces the following behavior changes to the Wi-Fi and networking APIs.
@@ -370,11 +357,12 @@ contents are removed.This preview includes the following behavior changes for Android for Work: