From 8dacbab8ca61e68785b5bb5b18e7f34683161acd Mon Sep 17 00:00:00 2001
From: Quddus Chong
Date: Wed, 24 Jun 2015 15:06:52 -0700
Subject: [PATCH] docs: Updated M Preview API Overview and Behavior Changes for
Preview 2 release.
Change-Id: I9ad6f1de161ba5c97a5425ffaaced7f29269e626
---
docs/html/preview/api-overview.jd | 66 ++++++++++++---------------
docs/html/preview/behavior-changes.jd | 33 +++++++++-----
2 files changed, 50 insertions(+), 49 deletions(-)
diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd
index 1686d79213ba0..75b3c528b42bf 100644
--- a/docs/html/preview/api-overview.jd
+++ b/docs/html/preview/api-overview.jd
@@ -86,9 +86,11 @@ web link and skip prompting users to select an app. To learn how to implement th
App Linking.
Auto Backup for Apps
-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
+
The system now performs automatic full data backup and restore for apps. For the
+duration of the M Developer Preview program, all
+apps are backed up, independent of which SDK version they target. After the final M SDK release,
+your app must target M to enable this behavior; 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
Auto Backup for Apps.
@@ -152,10 +154,9 @@ conjunction with a public or secret key implementation for user authentication.<
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()}
+{@code android.security.keystore.KeyGenParameterSpec.Builder.setUserAuthenticationValidityDurationSeconds()}
method when you set up a {@link javax.crypto.KeyGenerator} or
-{@link java.security.KeyPairGenerator}. This feature currently works for symmetric cryptographic
-operations.
+{@link java.security.KeyPairGenerator}.
Avoid showing the re-authentication dialog excessively -- your apps should try using the
cryptographic object first and if the the timeout expires, use the
@@ -236,7 +237,7 @@ can summon the assistant within any app, by long-pressing on the HomeYour 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.
+additional information by using the new {@code android.app.assist.AssistContent} class.
To provide the assistant with additional context from your app, follow these steps:
@@ -273,7 +274,7 @@ and connect a compatible Bluetooth stylus with their phone or tablet. While con
information from the touch screen is fused with pressure and button information from the stylus to
provide a greater range of expression than with the touch screen alone. Your app can listen for
stylus button presses and perform secondary actions, by registering the new
-{@code View.onStylusButtonPressListener} and {@code GestureDetector.OnStylusButtonPressListener}
+{@code View.onContextClickListener} and {@code GestureDetector.onContextClickListener}
callbacks in your activity.
Use the {@link android.view.MotionEvent} methods and constants to detect stylus button
@@ -284,11 +285,11 @@ interactions:
{@link android.view.MotionEvent#TOOL_TYPE_STYLUS}.
For apps targeting M Preview, the
{@link android.view.MotionEvent#getButtonState() getButtonState()}
-method returns {@code MotionEvent.STYLUS_BUTTON_PRIMARY} when the user
+method returns {@code MotionEvent.BUTTON_STYLUS_PRIMARY} when the user
presses the primary stylus button. If the stylus has a second button, the same method returns
-{@code MotionEvent.STYLUS_BUTTON_SECONDARY} when the user presses it. If the user presses
+{@code MotionEvent.BUTTON_STYLUS_SECONDARY} when the user presses it. If the user presses
both buttons simultaneously, the method returns both values OR'ed together
-({@code STYLUS_BUTTON_PRIMARY|STYLUS_BUTTON_SECONDARY}).
+({@code BUTTON_STYLUS_PRIMARY|BUTTON_STYLUS_SECONDARY}).
For apps targeting a lower platform version, the
{@link android.view.MotionEvent#getButtonState() getButtonState()} method returns
@@ -314,7 +315,7 @@ provision Hotspot 2.0 credentials in your app, use the new methods of the
{@link android.net.wifi.WifiEnterpriseConfig} class, such as {@code setPlmn()} and
{@code setRealm()}. In the {@link android.net.wifi.WifiConfiguration} object, you can set the
{@link android.net.wifi.WifiConfiguration#FQDN} and the {@code providerFriendlyName} fields.
-The new {@code ScanResult.PasspointNetwork} property indicates if a detected
+The new {@code ScanResult.isPasspointNetwork()} method indicates if a detected
network represents a Hotspot 2.0 access point.
@@ -356,10 +357,10 @@ allows users to start a voice search from a game controller or remote control co
TV. The system invokes the new {@code android.app.Activity.onSearchRequested()} callback when the
user starts a search. To determine if the user's input device has a built-in microphone, retrieve
the {@link android.view.InputDevice} object from that callback, then call the new
-{@code InputDevice.hasMic()} method.
- New {@code android.media.AudioDevicesManager} class which lets you retrieve a list of all
-attached source and sink audio devices. You can also specify an
-{@code android.media.OnAudioDeviceConnectionListener} object if you want your app to be notified
+{@code InputDevice.hasMicrophone()} method.
+ New {@code AudioManager.getDevices() method which lets you retrieve a list of all
+ audio devices currently connected to the system. You can also register an
+{@code android.media.AudioDeviceCallback} object if you want your app to be notified
when an audio device is connected or disconnected.
@@ -407,14 +408,15 @@ flash unit. If the torch mode is turned on or off successfully, the
Reprocessing API
The {@link android.hardware.camera2 Camera2} API is extended to support YUV and private
-opaque format image reprocessing. Your app determine if the reprocessing capabilities are available
-via {@code CameraCharacteristics.REQUEST_AVAILABLE_CAPABILITIES}. If a device supports reprocessing,
-you can create a reprocessable camera capture session by calling
+opaque format image reprocessing. To determine if these reprocessing capabilities are available,
+call {@link android.hardware.camera2.CameraManager#getCameraCharacteristics(java.lang.String)
+getCameraCharacteristics()} and check for the {@code REPROCESS_MAX_CAPTURE_STALL} key. If a
+device supports reprocessing, you can create a reprocessable camera capture session by calling
{@code CameraDevice.createReprocessableCaptureSession()}, and create requests for input
buffer reprocessing.
-Use the {@code ImageWriter} class to connect the input buffer flow to the camera reprocessing
-input. To get an empty buffer, follow this programming model:
+Use the {@code android.media.ImageWriter} class to connect the input buffer flow to the camera
+reprocessing input. To get an empty buffer, follow this programming model:
- Call the {@code ImageWriter.dequeueInputImage()} method.
@@ -428,10 +430,10 @@ data directly. Instead, pass the {@code ImageFormat.PRIVATE} image directly to t
{@code ImageWriter} by calling the {@code ImageWriter.queueInputImage()} method without any
buffer copy.
-The {@code ImageReader} class now supports {@code android.graphics.ImageFormat.PRIVATE} format
-image streams. This support allows your app to maintain a circular image queue of
-{@code ImageReader} output images, select one or more images, and send them to the
-{@code ImageWriter} for camera reprocessing.
+The {@link android.media.ImageReader} class now supports
+{@code android.graphics.ImageFormat.PRIVATE} format image streams. This support allows your app to
+maintain a circular image queue of {@link android.media.ImageReader} output images, select one or
+more images, and send them to the {@code ImageWriter} for camera reprocessing.
Android for Work Features
This preview includes the following new APIs for Android for Work:
@@ -441,10 +443,10 @@ can now control the following settings to improve management of
Corporate-Owned, Single-Use (COSU) devices:
- Disable or re-enable the keyguard with the
-{@code DevicePolicyManager.setKeyguardEnabledState()} method.
+{@code DevicePolicyManager.setKeyguardDisabled()} method.
- Disable or re-enable the status bar (including quick settings, notifications, and the
navigation swipe-up gesture that launches Google Now) with the
-{@code DevicePolicyManager.setStatusBarEnabledState()} method.
+{@code DevicePolicyManager.setStatusBarDisabled()} method.
- Disable or re-enable safe boot with the {@link android.os.UserManager} constant
{@code DISALLOW_SAFE_BOOT}.
- Prevent the screen from turning off while plugged in with the
@@ -489,16 +491,6 @@ uninstallAllUserCaCerts()}
installKeyPair()}
-- Enterprise factory reset protection: When provisioning a Device Owner, you can
-now configure parameters to unlock Factory Reset Protection (FRP) by setting the
-{@code DeviceManagerPolicy.EXTRA_PROVISIONING_RESET_PROTECTION_PARAMETERS} bundle. An NFC Programmer
-app can provide these parameters after a device has been reset to unlock FRP and provision the device,
-without requiring the previously configured Google account. If you don't modify these parameters,
-FRP remains in-place and prevents the device from being activated without the previously activated
-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.
-
diff --git a/docs/html/preview/behavior-changes.jd b/docs/html/preview/behavior-changes.jd
index 5ddac7a8eca16..8a8ea059e87c9 100644
--- a/docs/html/preview/behavior-changes.jd
+++ b/docs/html/preview/behavior-changes.jd
@@ -23,8 +23,9 @@ sdk.platform.apiLevel=MNC
- Android Keystore Changes
- Wi-Fi and Networking Changes
- Camera Service Changes
- - ART Runtime
+ - Runtime
- APK Validation
+ - USB Connection
- Android for Work Changes
@@ -46,8 +47,8 @@ sdk.platform.apiLevel=MNC
system changes and API behavior changes. This document highlights
some of the key changes that you should understand and account for in your apps.
-If you have previously published an app for Android, be aware that your app
- might be affected by these changes in the platform.
+If you have previously published an app for Android, be aware that these changes in the
+platform affect your app.
Runtime Permissions
This preview introduces a new permissions model, where users can now directly manage
@@ -55,11 +56,11 @@ app permissions at runtime. This model gives users improved visibility and contr
permissions, while streamlining the installation and auto-update processes for app developers.
Users can grant or revoke permissions individually for installed apps.
-On your apps that target the M Preview, make sure to check and request for permissions at
-runtime. To determine if your app has been granted a permission, call the
-new {@code Context.checkSelfPermission()} method. To request for a permission, call the new
-{@code Activity.requestPermission()} method. Even if your app is not targeting M, you
-should test your app under the new permissions model.
+On your apps that target the M Preview release or higher, make sure to check for and request
+permissions at runtime. To determine if your app has been granted a permission, call the
+new {@code Context.checkSelfPermission()} method. To request a permission, call the new
+{@code Activity.requestPermission()} method. Even if your app is not targeting the M Preview
+release, you should test your app under the new permissions model.
For details on supporting the new permissions model in your app, see the
@@ -329,7 +330,7 @@ processes that use the camera subsystem when the user has switched to a differen
-ART Runtime
+Runtime
The ART runtime now properly implements access rules for the
{@link java.lang.reflect.Constructor#newInstance(java.lang.Object...) newInstance()} method. This
change fixes a problem where Dalvik was checking access rules incorrectly in previous versions.
@@ -362,14 +363,22 @@ implemented. Apps which previously worked that have bad {@code DT_NEEDED} entrie
declared in the manifest but not present in the APK itself. An APK must be re-signed if any of the
contents are removed.
+USB Connection
+Device connections through the USB port are now set to charge-only mode by default. To access
+the device and its content over a USB connection, users must explicitly grant permission for such
+interactions. If your app supports user interactions with the device over a USB port, take into
+consideration that the interaction must be explicitly enabled.
+
+
Android for Work Changes
This preview includes the following behavior changes for Android for Work:
- Work contacts in personal contexts. The Google Dialer
Call Log now displays work contacts when the user views past calls.
-Setting {@code DevicePolicyManager.setCrossProfileCallerIdDisabled()} to {@code true} hides the
-work profile contacts in the Google Dialer Call Log. Work contacts can be displayed along with
-personal contacts to devices over Bluetooth only if
+Setting
+{@link android.app.admin.DevicePolicyManager#setCrossProfileCallerIdDisabled(android.content.ComponentName, boolean) setCrossProfileCallerIdDisabled()}
+to {@code true} hides the work profile contacts in the Google Dialer Call Log. Work contacts can be
+displayed along with personal contacts to devices over Bluetooth only if
you set {@code DevicePolicyManager.setBluetoothContactSharingDisabled()} to {@code false}. By
default, it is set to {@code true}.