diff options
Diffstat (limited to 'docs/html/preview')
| -rw-r--r-- | docs/html/preview/api-overview.jd | 248 | ||||
| -rw-r--r-- | docs/html/preview/behavior-changes.jd | 224 | ||||
| -rw-r--r-- | docs/html/preview/download.jd | 19 | ||||
| -rw-r--r-- | docs/html/preview/download_mp2.jd | 367 | ||||
| -rw-r--r-- | docs/html/preview/features/runtime-permissions.jd | 148 | ||||
| -rw-r--r-- | docs/html/preview/index.jd | 3 | ||||
| -rw-r--r-- | docs/html/preview/overview.jd | 70 | ||||
| -rw-r--r-- | docs/html/preview/support.jd | 201 |
8 files changed, 984 insertions, 296 deletions
diff --git a/docs/html/preview/api-overview.jd b/docs/html/preview/api-overview.jd index 4300b43..e15a657 100644 --- a/docs/html/preview/api-overview.jd +++ b/docs/html/preview/api-overview.jd @@ -103,8 +103,9 @@ the <a href="{@docRoot}training/articles/keystore.html">Android Keystore system< <h3 id="fingerprint-authentication">Fingerprint Authentication</h3> <p>To authenticate users via fingerprint scan, get an instance of the new -{@code android.hardware.fingerprint.FingerprintManager} class and call the -{@code FingerprintManager.authenticate()} method. Your app must be running on a compatible +{@link android.hardware.fingerprint.FingerprintManager} class and call the +{@link android.hardware.fingerprint.FingerprintManager#authenticate(android.hardware.fingerprint.FingerprintManager.CryptoObject, android.os.CancellationSignal, int, android.hardware.fingerprint.FingerprintManager.AuthenticationCallback, android.os.Handler) authenticate()} +method. Your app must be running on a compatible device with a fingerprint sensor. You must implement the user interface for the fingerprint authentication flow on your app, and use the standard Android fingerprint icon in your UI. The Android fingerprint icon ({@code c_fp_40px.png}) is included in the @@ -113,8 +114,8 @@ class="external-link">sample app</a>. If you are developing multiple apps that u authentication, note that each app must authenticate the user’s fingerprint independently. </p> -<p>To use this feature in your app, first add the {@code USE_FINGERPRINT} permission in your -manifest.</p> +<p>To use this feature in your app, first add the + {@link android.Manifest.permission#USE_FINGERPRINT} permission in your manifest.</p> <pre> <uses-permission @@ -156,7 +157,7 @@ conjunction with a public or secret key implementation for user authentication.< <p>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.Builder.setUserAuthenticationValidityDurationSeconds()} +{@link android.security.keystore.KeyGenParameterSpec.Builder#setUserAuthenticationValidityDurationSeconds(int) setUserAuthenticationValidityDurationSeconds()} method when you set up a {@link javax.crypto.KeyGenerator} or {@link java.security.KeyPairGenerator}.</p> @@ -184,13 +185,13 @@ launch an activity in another social network app, which lets the user share cont specific friend or community in that app.</p> <p>To enable direct share targets you must define a class that extends the -{@code android.service.} <br> -{@code chooser.ChooserTargetService} class. Declare your -{@code ChooserTargetService} in the manifest. Within that declaration, specify the -{@code BIND_CHOOSER_TARGET_SERVICE} permission and an intent filter with the -{@code SERVICE_INTERFACE} action.</p> -<p>The following example shows how you might declare the {@code ChooserTargetService} in your -manifest.</p> +{@link android.service.chooser.ChooserTargetService} class. Declare your +service in the manifest. Within that declaration, specify the +{@link android.Manifest.permission#BIND_CHOOSER_TARGET_SERVICE} permission and an +intent filter using the +{@link android.service.chooser.ChooserTargetService#SERVICE_INTERFACE SERVICE_INTERFACE} action.</p> +<p>The following example shows how you might declare the +{@link android.service.chooser.ChooserTargetService} in your manifest.</p> <pre> <service android:name=".ChooserTargetService" android:label="@string/service_name" @@ -201,7 +202,8 @@ manifest.</p> </service> </pre> -<p>For each activity that you want to expose to the {@code ChooserTargetService}, add a +<p>For each activity that you want to expose to +{@link android.service.chooser.ChooserTargetService}, add a {@code <meta-data>} element with the name {@code "android.service.chooser.chooser_target_service"} in your app manifest. </p> @@ -223,10 +225,20 @@ manifest.</p> This preview provides a new voice interaction API which, together with <a href="https://developers.google.com/voice-actions/" class="external-link">Voice Actions</a>, allows you to build conversational voice experiences into your apps. Call the -{@code android.app.Activity.isVoiceInteraction()} method to determine if your activity was -started in response to a voice action. If so, your app can use the -{@code android.app.VoiceInteractor} class to request a voice confirmation from the user, select -from a list of options, and more. To learn more about implementing voice actions, see the +{@link android.app.Activity#isVoiceInteraction()} method to determine if a voice action triggered +your activity. If so, your app can use the +{@link android.app.VoiceInteractor} class to request a voice confirmation from the user, select +from a list of options, and more.</p> + +<p>Most voice interactions originate from a user voice action. A voice interaction activity can +also, however, start without user input. For example, another app launched through a voice +interaction can also send an intent to launch a voice interaction. To determine if your activity +launched from a user voice query or from another voice interaction app, call the +{@link android.app.Activity#isVoiceInteractionRoot()} method. If another app launched your +activity, the method returns {@code false}. Your app may then prompt the user to confirm that +they intended this action.</p> + +<p>To learn more about implementing voice actions, see the <a href="https://developers.google.com/voice-actions/interaction/" class="external-link">Voice Actions developer site</a>. </p> @@ -239,7 +251,7 @@ can summon the assistant within any app, by long-pressing on the <strong>Home</s <p>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.assist.AssistContent} class.</p> +additional information by using the new {@link android.app.assist.AssistContent} class.</p> <p>To provide the assistant with additional context from your app, follow these steps:</p> @@ -249,25 +261,32 @@ additional information by using the new {@code android.app.assist.AssistContent} {@link android.app.Application#registerOnProvideAssistDataListener(android.app.Application.OnProvideAssistDataListener) registerOnProvideAssistDataListener()}.</li> <li>In order to provide activity-specific contextual information, override the {@link android.app.Activity#onProvideAssistData(android.os.Bundle) onProvideAssistData()} -callback and, optionally, the new {@code Activity.onProvideAssistContent()} callback. +callback and, optionally, the new +{@link android.app.Activity#onProvideAssistContent(android.app.assist.AssistContent) onProvideAssistContent()} +callback. </ol> <h2 id="notifications">Notifications</h2> <p>This preview adds the following API changes for notifications:</p> <ul> - <li>New {@code NotificationListenerService.INTERRUPTION_FILTER_ALARMS} filter level that + <li>New {@link android.app.NotificationManager#INTERRUPTION_FILTER_ALARMS} filter level that corresponds to the new <em>Alarms only</em> do not disturb mode.</li> - <li>New {@code Notification.CATEGORY_REMINDER} category value that is used to distinguish - user-scheduled reminders from other events + <li>New {@link android.app.Notification#CATEGORY_REMINDER} category value that is used to + distinguish user-scheduled reminders from other events ({@link android.app.Notification#CATEGORY_EVENT}) and alarms ({@link android.app.Notification#CATEGORY_ALARM}).</li> - <li>New {@code android.graphics.drawable.Icon} class which can be attached to your notifications - via the {@code Notification.Builder.setSmallIcon(Icon)} and - {@code Notification.Builder.setLargeIcon(Icon)} methods.</li> - <li>New {@code NotificationManager.getActiveNotifications()} method that allows your apps to - find out which of their notifications are currently alive. To see an app implementation that - uses this feature, see the <a href="https://github.com/googlesamples/android-ActiveNotifications" - class="external-link">Active Notifications sample</a>.</li> + <li>New {@link android.graphics.drawable.Icon} class that you can attach to your notifications + via the + {@link android.app.Notification.Builder#setSmallIcon(android.graphics.drawable.Icon) setSmallIcon()} + and {@link android.app.Notification.Builder#setLargeIcon(android.graphics.drawable.Icon) setLargeIcon()} + methods. Similarly, the + {@link android.app.Notification.Builder#addAction(int, java.lang.CharSequence, android.app.PendingIntent) + addAction()} method now accepts an {@link android.graphics.drawable.Icon} object instead of a + drawable resource ID.</li> + <li>New {@link android.app.NotificationManager#getActiveNotifications()} method that allows your + apps to find out which of their notifications are currently alive. To see an app implementation + that uses this feature, see the <a href="https://github.com/googlesamples/android-ActiveNotifications" + class="external-link">Active Notifications sample</a>.</li> </ul> <h2 id="bluetooth-stylus">Bluetooth Stylus Support</h2> @@ -275,9 +294,9 @@ callback and, optionally, the new {@code Activity.onProvideAssistContent()} call and connect a compatible Bluetooth stylus with their phone or tablet. While connected, position 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.onContextClickListener} and {@code GestureDetector.onContextClickListener} -callbacks in your activity.</p> +stylus button presses and perform secondary actions, by registering +{@link android.view.View.OnContextClickListener} and +{@link android.view.GestureDetector.OnContextClickListener} objects in your activity.</p> <p>Use the {@link android.view.MotionEvent} methods and constants to detect stylus button interactions:</p> @@ -287,11 +306,11 @@ interactions:</p> {@link android.view.MotionEvent#TOOL_TYPE_STYLUS}.</li> <li>For apps targeting M Preview, the {@link android.view.MotionEvent#getButtonState() getButtonState()} -method returns {@code MotionEvent.BUTTON_STYLUS_PRIMARY} when the user +method returns {@link android.view.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.BUTTON_STYLUS_SECONDARY} when the user presses it. If the user presses +{@link android.view.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 BUTTON_STYLUS_PRIMARY|BUTTON_STYLUS_SECONDARY}).</li> +({@link android.view.MotionEvent#BUTTON_STYLUS_PRIMARY}|{@link android.view.MotionEvent#BUTTON_STYLUS_SECONDARY}).</li> <li> For apps targeting a lower platform version, the {@link android.view.MotionEvent#getButtonState() getButtonState()} method returns @@ -302,89 +321,95 @@ For apps targeting a lower platform version, the <h2 id="ble-scanning">Improved Bluetooth Low Energy Scanning</h2> <p> -If your app performs performs Bluetooth Low Energy scans, you can use the new -{@code android.bluetooth.le.ScanSettings.Builder.setCallbackType()} method to specify that -you want callbacks to only be notified when an advertisement packet matching the set -{@link android.bluetooth.le.ScanFilter} is first found, and when it is not seen for a period of -time. This approach to scanning is more power-efficient than what’s provided in the previous -platform version. +If your app performs performs Bluetooth Low Energy scans, use the new +{@link android.bluetooth.le.ScanSettings.Builder#setCallbackType(int) setCallbackType()} +method to specify that you want the system to notify callbacks when it first finds, or sees after a +long time, an advertisement packet matching the set {@link android.bluetooth.le.ScanFilter}. This +approach to scanning is more power-efficient than what’s provided in the previous platform version. </p> <h2 id="hotspot">Hotspot 2.0 Release 1 Support</h2> <p> This preview adds support for the Hotspot 2.0 Release 1 spec on Nexus 6 and Nexus 9 devices. To 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.isPasspointNetwork()} method indicates if a detected +{@link android.net.wifi.WifiEnterpriseConfig} class, such as +{@link android.net.wifi.WifiEnterpriseConfig#setPlmn(java.lang.String) setPlmn()} and +{@link android.net.wifi.WifiEnterpriseConfig#setRealm(java.lang.String) setRealm()}. In the +{@link android.net.wifi.WifiConfiguration} object, you can set the +{@link android.net.wifi.WifiConfiguration#FQDN} and the +{@link android.net.wifi.WifiConfiguration#providerFriendlyName} fields. +The new {@link android.net.wifi.ScanResult#isPasspointNetwork()} method indicates if a detected network represents a Hotspot 2.0 access point. </p> <h2 id="4K-display">4K Display Mode</h2> <p>The platform now allows apps to request that the display resolution be upgraded to 4K rendering on compatible hardware. To query the current physical resolution, use the new -{@code android.view.Display.Mode} APIs. If the UI is drawn at a lower logical resolution and is +{@link android.view.Display.Mode} APIs. If the UI is drawn at a lower logical resolution and is upscaled to a larger physical resolution, be aware that the physical resolution the -{@code Display.Mode.getPhysicalWidth()} method returns may differ from the logical +{@link android.view.Display.Mode#getPhysicalWidth()} method returns may differ from the logical resolution reported by {@link android.view.Display#getSize(android.graphics.Point) getSize()}.</p> <p>You can request the system to change the physical resolution in your app as it runs, by setting -the {@code WindowManager.LayoutParams.preferredDisplayModeId} property of your app’s window. This -feature is useful if you want to switch to 4K display resolution. While in 4K display mode, the -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.</p> +the {@link android.view.WindowManager.LayoutParams#preferredDisplayModeId} property of your app’s +window. This feature is useful if you want to switch to 4K display resolution. While in 4K display +mode, the 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.</p> <h2 id="behavior-themeable-colorstatelists">Themeable ColorStateLists</h2> <p>Theme attributes are now supported in {@link android.content.res.ColorStateList} for devices running the M Preview. The {@link android.content.res.Resources#getColorStateList(int) getColorStateList()} and {@link android.content.res.Resources#getColor(int) getColor()} methods have been deprecated. If -you are calling these APIs, call the new {@code Context.getColorStateList()} or -{@code Context.getColor()} methods instead. These methods are also available in the -v4 appcompat library via {@link android.support.v4.content.ContextCompat}.</p> +you are calling these APIs, call the new +{@link android.content.Context#getColorStateList(int) getColorStateList()} or +{@link android.content.Context#getColor(int) getColor()} methods instead. These methods are also +available in the v4 appcompat library via {@link android.support.v4.content.ContextCompat}.</p> <h2 id="audio">Audio Features</h2> <p>This preview adds enhancements to audio processing on Android, including: </p> <ul> <li>Support for the <a href="http://en.wikipedia.org/wiki/MIDI" class="external-link">MIDI</a> -protocol, with the new {@code android.media.midi} APIs. Use these APIs to send and receive MIDI +protocol, with the new {@link android.media.midi} APIs. Use these APIs to send and receive MIDI events.</li> - <li>New {@code android.media.AudioRecord.Builder} and {@code android.media.AudioTrack.Builder} + <li>New {@link android.media.AudioRecord.Builder} and {@link android.media.AudioTrack.Builder} classes to create digital audio capture and playback objects respectively, and configure audio source and sink properties to override the system defaults.</li> <li>API hooks for associating audio and input devices. This is particularly useful if your app allows users to start a voice search from a game controller or remote control connected to Android -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.hasMicrophone()} method.</li> - <li>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.</li> +TV. The system invokes the new +{@link android.app.Activity#onSearchRequested(android.view.SearchEvent) 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 {@link android.view.InputDevice#hasMicrophone()} method.</li> + <li>New {@link android.media.AudioManager#getDevices(int) getDevices()} method which lets you +retrieve a list of all audio devices currently connected to the system. You can also register an +{@link android.media.AudioDeviceCallback} object if you want the system to notify your app +when an audio device connects or disconnects.</li> </ul> <h2 id="video">Video Features</h2> <p>This preview adds new capabilities to the video processing APIs, including:</p> <ul> -<li>New {@code android.media.MediaSync} class which helps applications to synchronously render +<li>New {@link android.media.MediaSync} class which helps applications to synchronously render audio and video streams. The audio buffers are submitted in non-blocking fashion and are returned via a callback. It also supports dynamic playback rate. </li> -<li>New {@code MediaDrm.EVENT_SESSION_RECLAIMED} event, which indicates that a session opened by -the app has been reclaimed by the resource manager. If your app uses DRM sessions, you should -handle this event and make sure not to use a reclaimed session. +<li>New {@link android.media.MediaDrm#EVENT_SESSION_RECLAIMED} event, which indicates that a +session opened by the app has been reclaimed by the resource manager. If your app uses DRM sessions, +you should handle this event and make sure not to use a reclaimed session. </li> -<li>New {@code MediaCodec.CodecException.ERROR_RECLAIMED} error code, which indicates that the -resource manager reclaimed the media resource used by the codec. With this exception, the codec -must be released, as it has moved to terminal state. +<li>New {@link android.media.MediaCodec.CodecException#ERROR_RECLAIMED} error code, which indicates +that the resource manager reclaimed the media resource used by the codec. With this exception, the +codec must be released, as it has moved to terminal state. </li> -<li>New {@code MediaCodecInfo.CodecCapabilities.getMaxSupportedInstances()} interface to get a -hint for the max number of the supported concurrent codec instances. +<li>New {@link android.media.MediaCodecInfo.CodecCapabilities#getMaxSupportedInstances() +getMaxSupportedInstances()} interface to get a hint for the max number of the supported +concurrent codec instances. </li> -<li>New {@code MediaPlayer.setPlaybackParams()} method to set the media playback rate for fast or +<li>New {@link android.media.MediaPlayer#setPlaybackParams(android.media.PlaybackParams) +setPlaybackParams()} method to set the media playback rate for fast or slow motion playback. It also stretches or speeds up the audio playback automatically in conjunction with the video.</li> </ul> @@ -394,48 +419,55 @@ conjunction with the video.</li> camera reprocessing of images:</p> <h3 id="flashlight">Flashlight API</h3> -<p>If a camera device has a flash unit, you can call the {@code CameraManager.setTorchMode()} +<p>If a camera device has a flash unit, you can call the +{@link android.hardware.camera2.CameraManager#setTorchMode(java.lang.String, boolean) setTorchMode()} method to switch the flash unit’s torch mode on or off without opening the camera device. The app does not have exclusive ownership of the flash unit or the camera device. The torch mode is turned off and becomes unavailable whenever the camera device becomes unavailable, or when other camera -resources keeping the torch on become unavailable. Other apps can also call {@code setTorchMode()} +resources keeping the torch on become unavailable. Other apps can also call +{@link android.hardware.camera2.CameraManager#setTorchMode(java.lang.String, boolean) setTorchMode()} to turn off the torch mode. When the last app that turned on the torch mode is closed, the torch mode is turned off.</p> <p>You can register a callback to be notified about torch mode status by calling the -{@code CameraManager.registerTorchCallback()} method. The first time the callback is registered, -it is immediately called with the torch mode status of all currently known camera devices with a -flash unit. If the torch mode is turned on or off successfully, the -{@code CameraManager.TorchCallback.onTorchModeChanged()} method is invoked.</p> +{@link android.hardware.camera2.CameraManager#registerTorchCallback(android.hardware.camera2.CameraManager.TorchCallback, android.os.Handler) registerTorchCallback()} +method. The first time the callback is registered, it is immediately called with the torch mode +status of all currently known camera devices with a flash unit. If the torch mode is turned on or +off successfully, the +{@link android.hardware.camera2.CameraManager.TorchCallback#onTorchModeChanged(java.lang.String, boolean) onTorchModeChanged()} +method is invoked.</p> <h3 id="reprocessing">Reprocessing API</h3> <p>The {@link android.hardware.camera2 Camera2} API is extended to support YUV and private 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 +getCameraCharacteristics()} and check for the +{@link android.hardware.camera2.CameraCharacteristics#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.</p> +<a href="/reference/android/hardware/camera2/CameraDevice.html#createReprocessableCaptureSession(android.hardware.camera2.params.InputConfiguration, java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler)"><code>createReprocessableCaptureSession()</code></a>, +and create requests for input buffer reprocessing.</p> -<p>Use the {@code android.media.ImageWriter} class to connect the input buffer flow to the camera +<p>Use the {@link android.media.ImageWriter} class to connect the input buffer flow to the camera reprocessing input. To get an empty buffer, follow this programming model:</p> <ol> -<li>Call the {@code ImageWriter.dequeueInputImage()} method.</li> +<li>Call the {@link android.media.ImageWriter#dequeueInputImage()} method.</li> <li>Fill the data into the input buffer.</li> -<li>Send the buffer to the camera by calling the {@code ImageWriter.queueInputImage()} method.</li> +<li>Send the buffer to the camera by calling the +{@link android.media.ImageWriter#queueInputImage(android.media.Image) queueInputImage()} method.</li> </ol> -<p>If you are using a {@code ImageWriter} object together with an -{@code android.graphics.ImageFormat.PRIVATE} image, your app cannot access the image -data directly. Instead, pass the {@code ImageFormat.PRIVATE} image directly to the -{@code ImageWriter} by calling the {@code ImageWriter.queueInputImage()} method without any -buffer copy.</p> +<p>If you are using a {@link android.media.ImageWriter} object together with an +{@link android.graphics.ImageFormat#PRIVATE} image, your app cannot access the image +data directly. Instead, pass the {@link android.graphics.ImageFormat#PRIVATE} image directly to the +{@link android.media.ImageWriter} by calling the +{@link android.media.ImageWriter#queueInputImage(android.media.Image) queueInputImage()} method +without any buffer copy.</p> <p>The {@link android.media.ImageReader} class now supports -{@code android.graphics.ImageFormat.PRIVATE} format image streams. This support allows your app to +{@link 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.</p> +more images, and send them to the {@link android.media.ImageWriter} for camera reprocessing.</p> <h2 id="afw">Android for Work Features</h2> <p>This preview includes the following new APIs for Android for Work:</p> @@ -445,14 +477,16 @@ can now control the following settings to improve management of Corporate-Owned, Single-Use (COSU) devices: <ul> <li>Disable or re-enable the keyguard with the -{@code DevicePolicyManager.setKeyguardDisabled()} method.</li> +{@link android.app.admin.DevicePolicyManager#setKeyguardDisabled(android.content.ComponentName, boolean) +setKeyguardDisabled()} method.</li> <li>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.setStatusBarDisabled()} method.</li> +{@link android.app.admin.DevicePolicyManager#setStatusBarDisabled(android.content.ComponentName, boolean) setStatusBarDisabled()} +method.</li> <li>Disable or re-enable safe boot with the {@link android.os.UserManager} constant -{@code DISALLOW_SAFE_BOOT}.</li> +{@link android.os.UserManager#DISALLOW_SAFE_BOOT}.</li> <li>Prevent the screen from turning off while plugged in with the - {@link android.provider.Settings.Global} constant {@code STAY_ON_WHILE_PLUGGED_IN}.</li> + {@link android.provider.Settings.Global#STAY_ON_WHILE_PLUGGED_IN} constant.</li> </ul> </li> <li><strong>Silent install and uninstall of apps by Device Owner:</strong> A Device Owner can now @@ -463,11 +497,12 @@ provisioning of kiosks or other such devices without activating a Google account <li><strong>Silent enterprise certificate access: </strong> When an app calls {@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()}, prior to the user being prompted to select a certificate, the Profile or Device Owner can now call -the {@code DeviceAdminReceiver.onChoosePrivateKeyAlias()} method to provide the alias silently to -the requesting application. This feature lets you grant managed apps access to certificates -without user interaction.</li> +the {@link android.app.admin.DeviceAdminReceiver#onChoosePrivateKeyAlias(android.content.Context, android.content.Intent, int, android.net.Uri, java.lang.String) onChoosePrivateKeyAlias()} +method to provide the alias silently to the requesting application. This feature lets you grant +managed apps access to certificates without user interaction.</li> <li><strong>Auto-acceptance of system updates.</strong> By setting a system update policy with -{@code DevicePolicyManager.setSystemUpdatePolicy()}, a Device Owner can now auto-accept a system +{@link android.app.admin.DevicePolicyManager#setSystemUpdatePolicy(android.content.ComponentName, android.app.admin.SystemUpdatePolicy) setSystemUpdatePolicy()}, +a Device Owner can now auto-accept a system update, for instance in the case of a kiosk device, or postpone the update and prevent it being taken by the user for up to 30 days. Furthermore, an administrator can set a daily time window in which an update must be taken, for example during the hours when a kiosk device is not in use. When @@ -498,16 +533,17 @@ srcset="{@docRoot}preview/images/work-profile-screen.png 1x, {@docRoot}preview/i style="float:right; margin:0 0 10px 20px" width="282" height="476" /> <li><strong>Data usage tracking.</strong> A Profile or Device Owner can now query for the data usage statistics visible in <strong>Settings > Data</strong> usage by using the new -{@code android.app.usage.NetworkStatsManager} methods. Profile Owners are automatically granted +{@link android.app.usage.NetworkStatsManager} methods. Profile Owners are automatically granted permission to query data on the profile they manage, while Device Owners get access to usage data of the managed primary user.</li> <li><strong>Runtime permission management:</strong> <p>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 -is set, the user cannot modify the selection made by the Profile or Device Owner within the -app’s permissions screen in <strong>Settings</strong>.</p></li> +{@link android.app.admin.DevicePolicyManager#setPermissionPolicy(android.content.ComponentName, int) +setPermissionPolicy()}, to either prompt the user to grant the permission or automatically grant or +deny the permission silently. If the latter policy is set, the user cannot +modify the selection made by the Profile or Device Owner within the app’s permissions screen in +<strong>Settings</strong>.</p></li> <li><strong>VPN in Settings:</strong> VPN apps are now visible in <strong>Settings > More > VPN</strong>. Additionally, the notifications that accompany VPN usage are now specific to how that VPN is diff --git a/docs/html/preview/behavior-changes.jd b/docs/html/preview/behavior-changes.jd index 5c8ef41..bf4dc1a 100644 --- a/docs/html/preview/behavior-changes.jd +++ b/docs/html/preview/behavior-changes.jd @@ -10,20 +10,17 @@ sdk.platform.apiLevel=MNC <ol id="toc44" class="hide-nested"> <li><a href="#behavior-runtime-permissions">Runtime Permissions</a></li> - <li><a href="#behavior-power">Power-Saving Optimizations</a> - <ol> - <li><a href="#behavior-doze">Doze</a></li> - <li><a href="#behavior-app-standby">App Standby</a></li> - </ol> - </li> + <li><a href="#behavior-power">Power-Saving Optimizations</a></li> <li><a href="#behavior-adoptable-storage">Adoptable Storage Devices</a></li> <li><a href="#behavior-apache-http-client">Apache HTTP Client Removal</a></li> <li><a href="#behavior-audiomanager-Changes">AudioManager Changes</a></li> + <li><a href="#behavior-notifications">Notifications</a></li> <li><a href="#behavior-test-selection">Text Selection</a></li> <li><a href="#behavior-keystore">Android Keystore Changes</a></li> <li><a href="#behavior-network">Wi-Fi and Networking Changes</a></li> <li><a href="#behavior-camera">Camera Service Changes</a></li> <li><a href="#behavior-runtime">Runtime</a></li> + <li><a href="#behavior-hardware-id">Access to Hardware Identifier</a></li> <li><a href="#behavior-apk-validation">APK Validation</a></li> <li><a href="#behavior-usb">USB Connection</a></li> <li><a href="#behavior-afw">Android for Work Changes</a></li> @@ -58,9 +55,11 @@ Users can grant or revoke permissions individually for installed apps. </p> <p>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.</p> +new {@link android.content.Context#checkSelfPermission(java.lang.String) checkSelfPermission()} +method. To request a permission, call the new +{@link android.app.Activity#requestPermissions(java.lang.String[], int) requestPermissions()} +method. Even if your app is not targeting the M Preview release, you should test your app under +the new permissions model.</p> <p>For details on supporting the new permissions model in your app, see the <a href="{@docRoot}preview/features/runtime-permissions.html"> @@ -69,86 +68,19 @@ see the <a href="{@docRoot}preview/testing/guide.html#runtime-permissions">Testi <h2 id="behavior-power">Power-Saving Optimizations</h2> <p>This preview introduces new power-saving optimizations for idle devices and apps.</p> - -<h3 id="behavior-doze">Doze</h3> -<p>If a device is unplugged and left stationary with the screen off for a period of time, it -goes into <em>Doze</em> 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.</p> - -<p>The following restrictions apply to your apps while in Doze:</p> -<ul> -<li>Network access is disabled, unless your app receives a high priority Google Cloud Messaging -tickle.</li> -<li><a href="{@docRoot}reference/android/os/PowerManager.WakeLock.html">Wake locks</a> are ignored.</li> -<li>Alarms scheduled with the {@link android.app.AlarmManager} class are disabled, except for -alarms that you've set with the {@link android.app.AlarmManager#setAlarmClock setAlarmClock()} -method and {@code AlarmManager.setAndAllowWhileIdle()}.</li> -<li>WiFi scans are not performed.</li> -<li>Syncs and jobs for your sync adapters and {@link android.app.job.JobScheduler} are not -permitted to run.</li> -</ul> -</p> -<p>When the device exits doze, it executes any jobs and syncs that are pending.</p> -<p>You can test this feature by connecting a device running the M Preview to your development -machine and calling the following commands: -</p> -<pre class="no-prettyprint"> -$ adb shell dumpsys battery unplug -$ adb shell dumpsys deviceidle step -$ adb shell dumpsys deviceidle -h -</pre> -<p class="note"><strong>Note</strong>: The upcoming -<a href="https://developers.google.com/cloud-messaging/" class="external-link"> -Google Cloud Messaging</a> 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. -</p> - -<p>See the -<a href="{@docRoot}preview/testing/guide.html#doze-standby">Testing Guide</a> for tips on how -to test Doze in your apps. </p> - -<h3 id="behavior-app-standby">App standby</h3> -<p>With this preview, the system may determine that apps are idle when they are not in active -use. Your app is considered idle after a period of time, unless the system detects -any of these signals:</p> - <ul> -<li>The app is explicitly launched by the user.</li> -<li>The app has a process currently in the foreground (either as an activity or foreground service, -or in use by another activity or foreground service).</li> -<li>The app generates a notification that users see on the lock screen or in the -notification tray.</li> -<li>The user explicitly asks for the app to be exempt from optimizations, -via <strong>Settings</strong>.</li> +<li><strong>Doze</strong>: If a user unplugs a device and leaves it stationary, with its screen off, +for a period of time, the device goes into <em>Doze</em> 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. +<li><strong>App Standby</strong>: App Standby allows the system to determine that an app is idle +when the user is not actively using it. The system makes this determination when the user does not +touch the app for a certain period of time. If the device is unplugged, the system disables network +access and suspends syncs and jobs for the apps it deems idle.</li> </ul> -<p>If the device is unplugged, apps deemed idle will have their network access disabled -and their syncs and jobs suspended. When the device is plugged into a power supply, these apps are -allowed network access and can execute any jobs and syncs that are pending. If the -device is idle for long periods of time, idle apps are allowed network access around once a day.</p> - -<p>You can test this feature by connecting a device running the M Preview to your development -machine and calling the following commands: -</p> -<pre class="no-prettyprint"> -$ 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> -</pre> - -<p class="note"><strong>Note</strong>: The upcoming -<a href="https://developers.google.com/cloud-messaging/" class="external-link"> -Google Cloud Messaging</a> (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. -</p> - -<p>See the -<a href="{@docRoot}preview/testing/guide.html#doze-standby">Testing Guide</a> for tips on how -to test App Standby in your apps. </p> +<p>To learn more about these power-saving changes, see +<a href="{@docRoot}preview/power-mgmt.html">Power-Saving Optimizations</a>.</p> <h2 id="behavior-adoptable-storage">Adoptable Storage Devices</h2> <p> @@ -222,10 +154,25 @@ cryptography library of your choice.</p> <p>Setting the volume directly or muting specific streams via the {@link android.media.AudioManager} class is no longer supported. The {@link android.media.AudioManager#setStreamSolo(int,boolean) setStreamSolo()} method is deprecated, and you should call the -{@code AudioManager.requestAudioFocus()} method instead. Similarly, the +{@link android.media.AudioManager#requestAudioFocus(android.media.AudioManager.OnAudioFocusChangeListener, int, int) requestAudioFocus()} +method instead. Similarly, the {@link android.media.AudioManager#setStreamMute(int,boolean) setStreamMute()} method is -deprecated; instead, call the {@code AudioManager.adjustStreamVolume()} method -and pass in the direction value {@code ADJUST_MUTE} or {@code ADJUST_UNMUTE}.</p> +deprecated; instead, call the {@link android.media.AudioManager#adjustStreamVolume(int, int, int) +adjustStreamVolume()} method and pass in the direction value +{@link android.media.AudioManager#ADJUST_MUTE} or +{@link android.media.AudioManager#ADJUST_UNMUTE}.</p> + +<h2 id="behavior-notifications">Notifications</h2> +<p> +This release removes the {@code Notification.setLatestEventInfo()} method. Use the +{@link android.app.Notification.Builder} class instead to construct notifications. To update a +notification repeatedly, reuse the {@link android.app.Notification.Builder} instance. Call the +{@link android.app.Notification.Builder#build()} method to get +updated {@link android.app.Notification} instances. +</p> +<p>The {@code adb shell dumpsys notification} command no longer prints out your notification text. +Use the {@code adb shell dumpsys notification --noredact} command instead to print out the text +in a notification object.</p> <h2 id="behavior-test-selection">Text Selection</h2> @@ -247,11 +194,13 @@ apps:</p> {@link android.view.ActionMode} calls from {@code startActionMode(Callback)} to {@code startActionMode(Callback, ActionMode.TYPE_FLOATING)}.</li> <li>Take your existing implementation of {@code ActionMode.Callback} and make it extend -{@code ActionMode.Callback2} instead.</li> -<li>Override the {@code Callback2.onGetContentRect()} method to provide the coordinates of the -content {@link android.graphics.Rect} object (such as a text selection rectangle) in the view.</li> +{@link android.view.ActionMode.Callback2} instead.</li> +<li>Override the +{@link android.view.ActionMode.Callback2#onGetContentRect(android.view.ActionMode, android.view.View, android.graphics.Rect) onGetContentRect()} +method to provide the coordinates of the content {@link android.graphics.Rect} object +(such as a text selection rectangle) in the view.</li> <li>If the rectangle positioning is no longer valid, and this is the only element to be invalidated, -call the {@code ActionMode.invalidateContentRect()} method.</li> +call the {@link android.view.ActionMode#invalidateContentRect() invalidateContentRect()} method.</li> </ol> <p>If you are using <a href="{@docRoot}tools/support-library/index.html"> @@ -260,8 +209,9 @@ backward-compatible and appcompat takes control over {@link android.view.ActionM default. This prevents floating toolbars from being displayed. To enable {@link android.view.ActionMode} support in an {@link android.support.v7.app.AppCompatActivity}, call -{@code android.support.v7.app.AppCompatActivity.getDelegate()}, then call -{@code android.support.v7.app.AppCompatDelegate.setHandleNativeActionModesEnabled()} on the returned +{@link android.support.v7.app.AppCompatActivity#getDelegate()}, then call +{@link android.support.v7.app.AppCompatDelegate#setHandleNativeActionModesEnabled(boolean) +setHandleNativeActionModesEnabled()} on the returned {@link android.support.v7.app.AppCompatDelegate} object and set the input parameter to {@code false}. This call returns control of {@link android.view.ActionMode} objects to the framework. In devices running the M Preview, that allows the framework to support @@ -295,8 +245,8 @@ Wi-Fi network. If your app’s {@code targetSdkVersion} is {@code “21”} or h multinetwork APIs (such as {@link android.net.Network#openConnection(java.net.URL) openConnection()}, {@link android.net.Network#bindSocket(java.net.Socket) bindSocket()}, and the new -{@code ConnectivityManager.bindProcessToNetwork()} method) to ensure that its network traffic is -sent on the selected network.</li> +{@link android.net.ConnectivityManager#bindProcessToNetwork(android.net.Network) +bindProcessToNetwork()} method) to ensure that its network traffic is sent on the selected network.</li> </ul> <h2 id="behavior-camera">Camera Service Changes</h2> @@ -358,6 +308,32 @@ implemented. Apps which previously worked that have bad {@code DT_NEEDED} entrie {@code dlopen(3)} (as opposed to being referenced by {@code DT_NEEDED} entries).</p> </p> +<h2 id="behavior-hardware-id">Access to Hardware Identifier</h2> +<p>To provide users with greater data protection, starting in this release, Android +removes programmatic access to the device’s local hardware identifier for +apps using the Wi-Fi and Bluetooth APIs. The +{@link android.net.wifi.WifiInfo#getMacAddress() WifiInfo.getMacAddress()} and the +{@link android.bluetooth.BluetoothAdapter#getAddress() BluetoothAdapter.getAddress()} methods +now return a constant value of {@code 02:00:00:00:00:00}.</p> + +<p>To access the hardware identifiers of nearby external devices via Bluetooth and Wi-Fi scans, +your app must now have the following permissions:</p> +<ul> +<li>{@link android.net.wifi.WifiManager#getScanResults() WifiManager.getScanResults()}: +Your app must have {@link android.Manifest.permission#ACCESS_FINE_LOCATION} or +{@link android.Manifest.permission#ACCESS_COARSE_LOCATION} permission.</li> +<li>{@link android.bluetooth.BluetoothDevice#ACTION_FOUND BluetoothDevice.ACTION_FOUND}: +Your app must have {@link android.Manifest.permission#ACCESS_COARSE_LOCATION} permission.</li> +<li>{@link android.bluetooth.le.BluetoothLeScanner#startScan(android.bluetooth.le.ScanCallback) +BluetoothLeScanner.startScan()}: Your app must have +{@link android.Manifest.permission#ACCESS_FINE_LOCATION} or +{@link android.Manifest.permission#ACCESS_COARSE_LOCATION} permission.</li> +</ul> + +<p class="note"><strong>Note</strong>: When a device running M Developer Preview initiates a +background Wi-Fi or Bluetooth scan, the operation is visible to external devices as +originating from a randomized MAC address.</p> + <h2 id="behavior-apk-validation">APK Validation</h2> <p>The platform now performs stricter validation of APKs. An APK is considered corrupt if a file is declared in the manifest but not present in the APK itself. An APK must be re-signed if any of the @@ -379,19 +355,19 @@ 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}. +you set {@link android.app.admin.DevicePolicyManager#setBluetoothContactSharingDisabled(android.content.ComponentName, boolean) +setBluetoothContactSharingDisabled()} to {@code false}. By default, it is set to {@code true}. </li> - <li><strong>WiFi configuration removal:</strong> WiFi configurations added by a Profile Owner + <li><strong>Wi-Fi configuration removal:</strong> Wi-Fi configurations added by a Profile Owner (for example, through calls to the {@link android.net.wifi.WifiManager#addNetwork(android.net.wifi.WifiConfiguration) addNetwork()} method) are now removed if that work profile is deleted. </li> - <li><strong>WiFi configuration lockdown:</strong> Any WiFi configuration created by + <li><strong>Wi-Fi configuration lockdown:</strong> Any Wi-Fi configuration created by an active Device Owner can no longer be modified or deleted by the user if - <code>Settings.Global.WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN</code> is non-zero. - The user can still create and modify their own WiFi configurations. Active Device - Owners have the privilege of editing/removing any WiFi configurations, including + {@link android.provider.Settings.Global#WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN} is non-zero. + The user can still create and modify their own Wi-Fi configurations. Active Device + Owners have the privilege of editing or removing any Wi-Fi configurations, including those not created by them. </li> <li><strong>Download Work Policy Controller via Google account addition:</strong> When a Google @@ -399,11 +375,12 @@ account that requires management via a Work Policy Controller (WPC) app is added outside of a managed context, the add account flow now prompts the user to install the appropriate WPC. This behavior also applies to accounts added via <strong>Settings > Accounts</strong> and in the initial device setup wizard.</li> -<li><strong>Changes to specific DevicePolicyManager API behaviors:</strong> +<li><strong>Changes to specific {@link android.app.admin.DevicePolicyManager} API behaviors:</strong> <ul> - <li>Calling the {@link android.app.admin.DevicePolicyManager#setCameraDisabled(android.content.ComponentName,boolean) setCameraDisabled()} + <li>Calling the +{@link android.app.admin.DevicePolicyManager#setCameraDisabled(android.content.ComponentName,boolean) setCameraDisabled()} method affects the camera for the calling user only; calling it from the managed profile doesn’t -affect camera apps running on the primary user. </li> +affect camera apps running on the primary user.</li> <li>In addition, the {@link android.app.admin.DevicePolicyManager#setKeyguardDisabledFeatures(android.content.ComponentName,int) setKeyguardDisabledFeatures()} method is now available for Profile Owners, as well as to Device Owners. </li> @@ -417,16 +394,31 @@ affect camera apps running on the primary user. </li> </ul> </li> <li>The {@link android.app.admin.DevicePolicyManager#createAndInitializeUser(android.content.ComponentName, java.lang.String, java.lang.String, android.content.ComponentName, android.os.Bundle) createAndInitializeUser()} and {@link android.app.admin.DevicePolicyManager#createUser(android.content.ComponentName, java.lang.String) createUser()} methods have been deprecated.</li> - <li>The {@link android.app.admin.DevicePolicyManager#setScreenCaptureDisabled(android.content.ComponentName, boolean) setScreenCaptureDisabled()} method now also blocks the assist structure when an app of the given user is in the foreground. </li> - <li><code>EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM</code> now defaults to SHA-256. SHA-1 is still supported for backwards compatibility but will be removed in future. <code>EXTRA_PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM</code> now only accepts SHA-256.</li> - <li>Device initializer APIs which existed in the MNC preview are now removed. They will not appear in the final M release.</li> - <li><code>EXTRA_PROVISIONING_RESET_PROTECTION_PARAMETERS</code> is removed so NFC bump provisioning cannot programmatically unlock a factory reset protected device.</li> - <li>Android for Work APIs are optimized for M runtime permissions, including Work profiles, assist layer, and others. New <code>DevicePolicyManager</code> permission APIs don't affect pre-M apps.</li> + <li>The {@link android.app.admin.DevicePolicyManager#setScreenCaptureDisabled(android.content.ComponentName, boolean) setScreenCaptureDisabled()} +method now also blocks the assist structure when an app of the given user is in the foreground. </li> + <li>{@link android.app.admin.DevicePolicyManager#EXTRA_PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM} +now defaults to SHA-256. SHA-1 is still supported for backwards compatibility but will be removed +in future. +{@link android.app.admin.DevicePolicyManager#EXTRA_PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM} +now only accepts SHA-256.</li> + <li>Device initializer APIs which existed in the M Developer Preview are now removed.</li> + <li><code>EXTRA_PROVISIONING_RESET_PROTECTION_PARAMETERS</code> is removed so NFC bump +provisioning cannot programmatically unlock a factory reset protected device.</li> +<li>You can now use the {@link android.app.admin.DevicePolicyManager#EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE} +extra to pass data to the device owner app during NFC provisioning of the managed device.</li> + <li>Android for Work APIs are optimized for M runtime permissions, including Work profiles, +assist layer, and others. New {@link android.app.admin.DevicePolicyManager} permission APIs don't +affect pre-M apps.</li> +<li>When users back out of the synchronous part of the setup flow initiated through an +{@link android.app.admin.DevicePolicyManager#ACTION_PROVISION_MANAGED_PROFILE} or +{@link android.app.admin.DevicePolicyManager#ACTION_PROVISION_MANAGED_DEVICE} intent, the system +now returns a {@link android.app.Activity#RESULT_CANCELED} result code.</li> </ul></li> <li><strong>Changes to other APIs</strong>: <ul> - <li>Data Usage: The {@code android.app.usage.NetworkUsageStats} class has been renamed {@code android.app.usage.NetworkStats}.</li> + <li>Data Usage: The {@code android.app.usage.NetworkUsageStats} class has been renamed +{@link android.app.usage.NetworkStats}.</li> </ul> </li> @@ -438,12 +430,12 @@ affect camera apps running on the primary user. </li> <li><code>DEVELOPMENT_SETTINGS_ENABLED</code></li> <li><code>MODE_RINGER</code></li> <li><code>NETWORK_PREFERENCE</code></li> - <li><code>WIFI_ON</code></li> + <li><code>WIFI_ON</code></li> </ul> </li> - <li>These global settings can now be set via <code><a href="/reference/android/app/admin/DevicePolicyManager.html#setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String)">setGlobalSettings()</a></code>: + <li>These global settings can now be set via {@link android.app.admin.DevicePolicyManager#setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String) setGlobalSettings()}: <ul> - <li><code>WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN</code></li> + <li>{@link android.provider.Settings.Global#WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN}</li> </ul> </li> </ul> diff --git a/docs/html/preview/download.jd b/docs/html/preview/download.jd index 0dfabef..0b115f2 100644 --- a/docs/html/preview/download.jd +++ b/docs/html/preview/download.jd @@ -164,7 +164,7 @@ This is the Android SDK Preview License Agreement (the “License Agreement”). <div id="qv"> <h2>In this document</h2> <ol> - <li><a href="#sdk">Developer Preview 2 SDK</a></li> + <li><a href="#sdk">Developer Preview 3 SDK</a></li> <li><a href="#docs">Developer Documentation</a></li> <li><a href="#images">Hardware System Images</a></li> </ol> @@ -178,13 +178,13 @@ This is the Android SDK Preview License Agreement (the “License Agreement”). <p> - The Android M Preview SDK includes development tools, Android system files, and library files to + The Android M Preview SDK includes development tools, Android system images, and library files to help you test your app and the new APIs coming in the next release of the platform. This document describes how to get the downloadable components of the preview for testing your app. </p> -<h2 id="sdk">Developer Preview 2 SDK</h2> +<h2 id="sdk">Developer Preview 3 SDK</h2> <p> The Preview SDK is available for download through the <a href= @@ -197,7 +197,10 @@ This is the Android SDK Preview License Agreement (the “License Agreement”). <h2 id="docs">Developer Documentation</h2> <p> - The developer documentation download package provides detailed API reference information and an API difference report for the preview. + The developer documentation download package provides detailed API reference information and + an API difference report for the preview. Note that <a href="{@docRoot}reference/packages.html">API + level 23 reference</a> and <a href="{@docRoot}sdk/api_diff/23/changes.html">diffs</a> are now + also available online. </p> <table> @@ -206,11 +209,11 @@ This is the Android SDK Preview License Agreement (the “License Agreement”). <th scope="col">Download / Checksums</th> </tr> <tr id="docs-dl"> - <td>Android M Preview 2<br>Developer Docs</td> + <td>Android M Preview 3<br>Developer Docs</td> <td><a href="#top" onclick="onDownload(this)" - >m-preview-2-developer-docs.zip</a><br> - MD5: 1db6fff9c722b0339757e1cdf43663a8<br> - SHA-1: 5a4ae88d644e63824d21b0e18f8e3977a7665157 + >m-preview-3-developer-docs.zip</a><br> + MD5: -<br> + SHA-1: - </td> </tr> <table> diff --git a/docs/html/preview/download_mp2.jd b/docs/html/preview/download_mp2.jd new file mode 100644 index 0000000..0dfabef --- /dev/null +++ b/docs/html/preview/download_mp2.jd @@ -0,0 +1,367 @@ +page.title=Downloads +page.image=images/cards/card-download_16-9_2x.png + +@jd:body + +<div style="position:relative; min-height:600px"> + + <div class="wrap" id="tos" style="position:absolute;display:none;width:inherit;"> + + <p class="sdk-terms-intro">Before downloading and installing components of the Android Preview + SDK, you must agree to the following terms and conditions.</p> + + <h2 class="norule">Terms and Conditions</h2> + + <div class="sdk-terms" onfocus="this.blur()" style="width:678px"> +This is the Android SDK Preview License Agreement (the “License Agreement”). + +1. Introduction + +1.1 The Android SDK Preview (referred to in the License Agreement as the “Preview” and specifically including the Android system files, packaged APIs, and Preview library files, if and when they are made available) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the Preview. + +1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time. + +1.3 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States. + +2. Accepting the License Agreement + +2.1 In order to use the Preview, you must first agree to the License Agreement. You may not use the Preview if you do not accept the License Agreement. + +2.2 By clicking to accept and/or using the Preview, you hereby agree to the terms of the License Agreement. + +2.3 You may not use the Preview and may not accept the License Agreement if you are a person barred from receiving the Preview under the laws of the United States or other countries including the country in which you are resident or from which you use the Preview. + +2.4 If you will use the Preview internally within your company or organization you agree to be bound by the License Agreement on behalf of your employer or other entity, and you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the Preview on behalf of your employer or other entity. + +3. Preview License from Google + +3.1 Subject to the terms of the License Agreement, Google grants you a royalty-free, non-assignable, non-exclusive, non-sublicensable, limited, revocable license to use the Preview, personally or internally within your company or organization, solely to develop applications to run on the Android platform. + +3.2 You agree that Google or third parties owns all legal right, title and interest in and to the Preview, including any Intellectual Property Rights that subsist in the Preview. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you. + +3.3 You may not use the Preview for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Preview or any part of the Preview; or (b) load any part of the Preview onto a mobile handset or any other hardware device except a personal computer, combine any part of the Preview with other software, or distribute any software or device incorporating a part of the Preview. + +3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the Preview. + +3.5 Use, reproduction and distribution of components of the Preview licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement. You agree to remain a licensee in good standing in regard to such open source software licenses under all the rights granted and to refrain from any actions that may terminate, suspend, or breach such rights. + +3.6 You agree that the form and nature of the Preview that Google provides may change without prior notice to you and that future versions of the Preview may be incompatible with applications developed on previous versions of the Preview. You agree that Google may stop (permanently or temporarily) providing the Preview (or any features within the Preview) to you or to users generally at Google's sole discretion, without prior notice to you. + +3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features. + +3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the Preview. + +4. Use of the Preview by You + +4.1 Google agrees that nothing in the License Agreement gives Google any right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the Preview, including any intellectual property rights that subsist in those applications. + +4.2 You agree to use the Preview and write applications only for purposes that are permitted by (a) the License Agreement, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries). + +4.3 You agree that if you use the Preview to develop applications, you will protect the privacy and legal rights of users. If users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If users provide you with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, each user has given you permission to do so. + +4.4 You agree that you will not engage in any activity with the Preview, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of Google or any third party. + +4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so. + +4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach. + +4.7 The Preview is in development, and your testing and feedback are an important part of the development process. By using the Preview, you acknowledge that implementation of some features are still under development and that you should not rely on the Preview having the full functionality of a stable release. You agree not to publicly distribute or ship any application using this Preview as this Preview will no longer be supported after the official Android SDK is released. + +5. Your Developer Credentials + +5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials. + +6. Privacy and Information + +6.1 In order to continually innovate and improve the Preview, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the Preview are being used and how they are being used. Before any of this information is collected, the Preview will notify you and seek your consent. If you withhold consent, the information will not be collected. + +6.2 The data collected is examined in the aggregate to improve the Preview and is maintained in accordance with Google's Privacy Policy located at http://www.google.com/policies/privacy/. + +7. Third Party Applications + +7.1 If you use the Preview to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources. + +7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners. + +7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. + +8. Using Google APIs + +8.1 Google APIs + +8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service. + +8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. + +9. Terminating the License Agreement + +9.1 the License Agreement will continue to apply until terminated by either you or Google as set out below. + +9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the Preview and any relevant developer credentials. + +9.3 Google may at any time, terminate the License Agreement, with or without cause, upon notice to you. + +9.4 The License Agreement will automatically terminate without notice or other action upon the earlier of: +(A) when Google ceases to provide the Preview or certain parts of the Preview to users in the country in which you are resident or from which you use the service; and +(B) Google issues a final release version of the Android SDK. + +9.5 When the License Agreement is terminated, the license granted to you in the License Agreement will terminate, you will immediately cease all use of the Preview, and the provisions of paragraphs 10, 11, 12 and 14 shall survive indefinitely. + +10. DISCLAIMERS + +10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE PREVIEW IS AT YOUR SOLE RISK AND THAT THE PREVIEW IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE. + +10.2 YOUR USE OF THE PREVIEW AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE PREVIEW IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE. WITHOUT LIMITING THE FOREGOING, YOU UNDERSTAND THAT THE PREVIEW IS NOT A STABLE RELEASE AND MAY CONTAIN ERRORS, DEFECTS AND SECURITY VULNERABILITIES THAT CAN RESULT IN SIGNIFICANT DAMAGE, INCLUDING THE COMPLETE, IRRECOVERABLE LOSS OF USE OF YOUR COMPUTER SYSTEM OR OTHER DEVICE. + +10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + +11. LIMITATION OF LIABILITY + +11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING. + +12. Indemnification + +12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys’ fees) arising out of or accruing from (a) your use of the Preview, (b) any application you develop on the Preview that infringes any Intellectual Property Rights of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you of the License Agreement. + +13. Changes to the License Agreement + +13.1 Google may make changes to the License Agreement as it distributes new versions of the Preview. When these changes are made, Google will make a new version of the License Agreement available on the website where the Preview is made available. + +14. General Legal Terms + +14.1 the License Agreement constitutes the whole legal agreement between you and Google and governs your use of the Preview (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the Preview. + +14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google. + +14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable. + +14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement. + +14.5 EXPORT RESTRICTIONS. THE PREVIEW IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE PREVIEW. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE. + +14.6 The License Agreement may not be assigned or transferred by you without the prior written approval of Google, and any attempted assignment without such approval will be void. You shall not delegate your responsibilities or obligations under the License Agreement without the prior written approval of Google. + +14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. + </div><!-- sdk terms --> + + + + <div id="sdk-terms-form"> + <p> + <input id="agree" type="checkbox" name="agree" value="1" onclick="onAgreeChecked()" /> + <label id="agreeLabel" for="agree">I have read and agree with the above terms and conditions</label> + </p> + <p><a href="" class="button disabled" id="downloadForRealz" onclick="return onDownloadForRealz(this);"></a></p> + </div> + + + </div><!-- end TOS --> + + + <div id="landing"> + +<div id="qv-wrapper"> + <div id="qv"> + <h2>In this document</h2> + <ol> + <li><a href="#sdk">Developer Preview 2 SDK</a></li> + <li><a href="#docs">Developer Documentation</a></li> + <li><a href="#images">Hardware System Images</a></li> + </ol> + + <h2>Legacy downloads</h2> + <ol> + <li><a href="{@docRoot}preview/download_mp1.html">Developer Preview Archive</a></li> + </ol> + </div> +</div> + + +<p> + The Android M Preview SDK includes development tools, Android system files, and library files to + help you test your app and the new APIs coming in the next release of the platform. This document + describes how to get the downloadable components of the preview for testing your app. +</p> + + +<h2 id="sdk">Developer Preview 2 SDK</h2> + +<p> + The Preview SDK is available for download through the <a href= + "{@docRoot}tools/help/sdk-manager.html">Android SDK Manager</a>. For more information on + downloading and configuring the Preview SDK, see <a href= + "{@docRoot}preview/setup-sdk.html#downloadSdk">Set Up the Preview SDK</a>. +</p> + + +<h2 id="docs">Developer Documentation</h2> + +<p> + The developer documentation download package provides detailed API reference information and an API difference report for the preview. +</p> + +<table> + <tr> + <th scope="col">Description</th> + <th scope="col">Download / Checksums</th> + </tr> + <tr id="docs-dl"> + <td>Android M Preview 2<br>Developer Docs</td> + <td><a href="#top" onclick="onDownload(this)" + >m-preview-2-developer-docs.zip</a><br> + MD5: 1db6fff9c722b0339757e1cdf43663a8<br> + SHA-1: 5a4ae88d644e63824d21b0e18f8e3977a7665157 + </td> + </tr> +<table> + + +<h2 id="images">Hardware System Images</h2> + +<p> + These system images allow you to install a preview version of the platform on a physical device for + testing. By configuring a device with one of these images, you can install and test your app to + see how it performs on the next version of the platform. The process of installing a system image + on a device <em>removes all data from the device</em>, so you should backup your data before + installing a system image. +</p> + +<p class="warning"> + <b>Warning:</b> The following Android system images are previews and are subject to change. Your + use of these system images is governed by the Android SDK Preview License Agreement. The Android + preview system images are not stable releases, and may contain errors and defects that can result + in damage to your computer systems, devices, and data. The preview Android system images are not + subject to the same testing as the factory OS and can cause your phone and installed services and + applications to stop working. +</p> + +<table> + <tr> + <th scope="col">Device</th> + <th scope="col">Download / Checksums</th> + </tr> + <tr id="hammerhead"> + <td>Nexus 5 (GSM/LTE) <br>"hammerhead"</td> + <td><a href="#top" onclick="onDownload(this)" + >hammerhead-MPZ79M-preview-b1f4bde4.tgz</a><br> + MD5: 2ca9f18bf47a061b339bab52647ceb0d<br> + SHA-1: b1f4bde447eccbf8ce5d9b8b8ba954e3eac8e939 + </td> + </tr> + <tr id="shamu"> + <td>Nexus 6 <br>"shamu"</td> + <td><a href="#top" onclick="onDownload(this)" + >shamu-MPZ79M-preview-e1024040.tgz</a><br> + MD5: 24a2118da340b9afedfbdfc026f6ff81<br> + SHA-1: e10240408859d5188c4aae140e1c539130ba614b + </td> + </tr> + <tr id="volantis"> + <td>Nexus 9 <br>"volantis"</td> + <td><a href="#top" onclick="onDownload(this)" + >volantis-MPZ79M-preview-9f305342.tgz</a><br> + MD5: 9edabf0a4c61b247f1cbb9dfdc0a899e<br> + SHA-1: 9f30534216f10899a6a75495fc7e92408ea333a7 + </td> + </tr> + + <tr id="fugu"> + <td>Nexus Player <br>"fugu"</td> + <td><a href="#top" onclick="onDownload(this)" + >fugu-MPZ79N-preview-fb63af98.tgz</a><br> + MD5: e8d081137a20b66df595ee69523314b5<br> + SHA-1: fb63af98302dd97be8de9313734d389ccdcce250 + </td> + </tr> + +</table> + +<h3 id="install-image">Install an Image to a Device</h3> + +<p> + In order to use a device image for testing, you must install it on a compatible device. Follow + the instructions below to install a system image: +</p> + +<ol> + <li>Download and uncompress one of the system image packages listed here.</li> + <li>Backup any data you want to preserve from the device.</li> + <li>Follow the instructions at + <a href="https://developers.google.com/android/nexus/images#instructions">developers.google.com/android</a> + to flash the image onto your device.</li> +</ol> + +<h3 id="update-image">Updating a Device with the Preview</h3> + +<p> + Once you have installed a preview system image on a development device, the device is upgraded + automatically with the next preview release through over-the-air (OTA) updates. When the update + is available, the device displays notification that an update is available and allows you to + install it. You can also manually install the next preview image by repeating the procedure in + the previous section. +</p> + +<h3 id="revertDevice">Revert a Device to Factory Specifications</h3> + +<p> + If you want to uninstall the preview and revert the device to factory specifications, go to + <a href="http://developers.google.com/android/nexus/images">developers.google.com/android</a> and + download the image you want to flash to for your device. Follow the instructions on that page to + flash the image to your device. +</p> + + </div><!-- landing --> + +</div><!-- relative wrapper --> + + + +<script> + var urlRoot = "http://storage.googleapis.com/androiddevelopers/shareables/preview/"; + function onDownload(link) { + + $("#downloadForRealz").html("Download " + $(link).text()); + $("#downloadForRealz").attr('href', urlRoot + $(link).text()); + + $("#tos").fadeIn('fast'); + $("#landing").fadeOut('fast'); + + return true; + } + + + function onAgreeChecked() { + /* verify that the TOS is agreed */ + if ($("input#agree").is(":checked")) { + /* reveal the download button */ + $("a#downloadForRealz").removeClass('disabled'); + } else { + $("a#downloadForRealz").addClass('disabled'); + } + } + + function onDownloadForRealz(link) { + if ($("input#agree").is(':checked')) { + /* + $("#tos").fadeOut('fast'); + $("#landing").fadeIn('fast'); + */ + + ga('send', 'event', 'M Preview', 'System Image', $("#downloadForRealz").html()); + + /* + location.hash = ""; + */ + return true; + } else { + return false; + } + } + + $(window).hashchange( function(){ + if (location.hash == "") { + location.reload(); + } + }); + +</script> diff --git a/docs/html/preview/features/runtime-permissions.jd b/docs/html/preview/features/runtime-permissions.jd index 765a3d5..144a5fe 100644 --- a/docs/html/preview/features/runtime-permissions.jd +++ b/docs/html/preview/features/runtime-permissions.jd @@ -411,6 +411,14 @@ page.image=images/permissions_check.png {@link android.os.Build.VERSION#CODENAME CODENAME} is <code>"MNC"</code>. </p> +<p> + Alternatively, you can use the new methods introduced with revision 23 of the + v4 and v13 support libraries. The support library methods behave + appropriately whether or not the app is running on the M Developer Preview. + For more information, see <a href="#support-lib">Support library methods for + handling permissions</a>. +</p> + <h4 id="check-for-permission">Check if the app has the needed permission</h4> <p>When the user tries to do something that requires a permission, the app @@ -469,10 +477,7 @@ page.image=images/permissions_check.png <code>android.permission.WRITE_CONTACTS</code> </li> <li> - <code>android.permission.READ_PROFILE</code> - </li> - <li> - <code>android.permission.WRITE_PROFILE</code> + <code>android.permission.GET_ACCOUNTS</code> </li> </ul> </td> @@ -540,11 +545,6 @@ page.image=images/permissions_check.png <code>android.permission.BODY_SENSORS</code> </li> </ul> - <ul> - <li> - <code>android.permission.USE_FINGERPRINT</code> - </li> - </ul> </td> </tr> @@ -615,13 +615,14 @@ page.image=images/permissions_check.png </p> <p> - If the user turned down the permission request in the - past and chose the <em>Don't ask again</em> option in the permission request system - dialog, this method returns <code>false</code>. The method also returns - <code>false</code> if the device policy prohibits the app from having that - permission. + If the user turned down the permission request in the past and chose the + <em>Don't ask again</em> option in the permission request system dialog, this + method returns <code>false</code>. The method also returns <code>false</code> + if the device policy prohibits the app from having that permission. </p> + + <h4 id="request-permissions">Request permissions if necessary</h4> <p>If the app doesn't already have the permission it needs, the app calls the @@ -656,6 +657,16 @@ if (checkSelfPermission(Manifest.permission.READ_CONTACTS) } </pre> +<p class="note"> + <strong>Note:</strong> When your app calls the framework's + <code>requestPermissions()</code> method, the system shows a standard dialog + box to the user. Your app <em>cannot</em> configure or alter that dialog box. + If you need to provide any information or explanation to the user, you should + do that <em>before</em> you call <code>requestPermissions()</code>, as + described in <a href="#explain-need">Explain why the app needs + permissions</a>. +</p> + <h4 id="handle-response">Handle the permissions request response</h4> <p> @@ -875,7 +886,105 @@ $ adb pm revoke <package_name> <permission_name> app's normal operation. </p> -<h3 id="normal">Normal Permissions</h3> +<h3 id="support-lib">Support library methods for handling permissions</h3> + +<p> + Revision 23 of the v4 and v13 support libraries provide several new methods + for managing permissions. The support library methods work properly on any + device that can use those libraries. Thus, if you use the support library + methods, you do not need to check whether your app is running on a device + with the M Developer Preview. If an app is installed on a device running the + M Preview, the support library methods behave the same as their framework + equivalents. If the device is running an earlier version of Android, the + methods behave appropriately, as described below. +</p> + +<p> + The v4 support library provides the following permissions methods: +</p> + +<dl> + <dt> + <code>ContextCompat.checkSelfPermission()</code> + </dt> + + <dd> + Returns <code>true</code> if the app has the specified permission, whether + or not the device is using the M Preview. + </dd> + + <dt> + <code>ActivityCompat.requestPermissions()</code> + </dt> + + <dd> + If the device is not running the M Preview, invokes the callback + method in <code>ActivityCompat.OnRequestPermissionsResultCallback</code>. + Passes {@link android.content.pm.PackageManager#PERMISSION_GRANTED + PERMISSION_GRANTED} if the app already has the specified permission, or + {@link android.content.pm.PackageManager#PERMISSION_DENIED + PERMISSION_DENIED} if it does not. + </dd> + + <dt> + <code>ActivityCompat.shouldShowRequestPermissionRationale()</code> + </dt> + + <dd> + If the device is not running the M Preview, always returns + <code>false</code>. + </dd> +</dl> + +<p> + The v4 support library also contains the <code>PermissionChecker</code> + class, which provides several static utility methods for apps that use IPC to + provide services for other apps. For example, + <code>PermissionChecker.checkCallingPermission()</code> checks whether an IPC + made by a particular package has a specified permission. +</p> + +<p class="note"> + <strong>Note:</strong> If your app acts on behalf of third-party apps to call + platform methods that require runtime permissions on behalf of a third-party + app, you should use the appropriate <code>PermissionChecker</code> methods to + ensure that the other app is allowed to perform the operation. The platform + has a compatibility mode that allows users to revoke a legacy app's access to + permission-protected methods. If the user revokes access in compatibility + mode the app's permissions are not actually revoked; instead, access to the + APIs is restricted. The <code>PermissionChecker</code> methods verify app + permissions in both normal and legacy modes. +</p> + +<p> + The v13 support library provides the following permissions methods: +</p> + +<dl> + <dt> + <code>FragmentCompat.requestPermissions()</code> + </dt> + + <dd> + If the device is not running the M Preview, invokes the callback + method in <code>FragmentCompat.OnRequestPermissionsResultCallback</code>. + Passes {@link android.content.pm.PackageManager#PERMISSION_GRANTED + PERMISSION_GRANTED} if the app already has the specified permission, or + {@link android.content.pm.PackageManager#PERMISSION_DENIED + PERMISSION_DENIED} if it does not. + </dd> + + <dt> + <code>FragmentCompat.shouldShowRequestPermissionRationale()</code> + </dt> + + <dd> + If the device is not running the M Preview, always returns + <code>false</code>. + </dd> +</dl> + +<h3 id="normal">Normal permissions</h3> <p> Many permissions are designated as {@link @@ -911,6 +1020,7 @@ $ adb pm revoke <package_name> <permission_name> <ul> <li><code>android.permission.ACCESS_LOCATION_EXTRA_COMMANDS</code></li> <li><code>android.permission.ACCESS_NETWORK_STATE</code></li> + <li><code>android.permission.ACCESS_NOTIFICATION_POLICY</code></li> <li><code>android.permission.ACCESS_WIFI_STATE</code></li> <li><code>android.permission.ACCESS_WIMAX_STATE</code></li> <li><code>android.permission.BLUETOOTH</code></li> @@ -919,6 +1029,7 @@ $ adb pm revoke <package_name> <permission_name> <li><code>android.permission.CHANGE_NETWORK_STATE</code></li> <li><code>android.permission.CHANGE_WIFI_MULTICAST_STATE</code></li> <li><code>android.permission.CHANGE_WIFI_STATE</code></li> + <li><code>android.permission.CHANGE_WIMAX_STATE</code></li> <li><code>android.permission.DISABLE_KEYGUARD</code></li> <li><code>android.permission.EXPAND_STATUS_BAR</code></li> <li><code>android.permission.FLASHLIGHT</code></li> @@ -928,22 +1039,21 @@ $ adb pm revoke <package_name> <permission_name> <li><code>android.permission.KILL_BACKGROUND_PROCESSES</code></li> <li><code>android.permission.MODIFY_AUDIO_SETTINGS</code></li> <li><code>android.permission.NFC</code></li> - <li><code>android.permission.PERSISTENT_ACTIVITY</code></li> <li><code>android.permission.READ_SYNC_SETTINGS</code></li> <li><code>android.permission.READ_SYNC_STATS</code></li> - <li><code>android.permission.READ_USER_DICTIONARY</code></li> <li><code>android.permission.RECEIVE_BOOT_COMPLETED</code></li> <li><code>android.permission.REORDER_TASKS</code></li> + <li><code>android.permission.REQUEST_INSTALL_PACKAGES</code></li> <li><code>android.permission.SET_TIME_ZONE</code></li> <li><code>android.permission.SET_WALLPAPER</code></li> <li><code>android.permission.SET_WALLPAPER_HINTS</code></li> <li><code>android.permission.SUBSCRIBED_FEEDS_READ</code></li> <li><code>android.permission.TRANSMIT_IR</code></li> + <li><code>android.permission.USE_FINGERPRINT</code></li> <li><code>android.permission.VIBRATE</code></li> <li><code>android.permission.WAKE_LOCK</code></li> - <li><code>android.permission.WRITE_SETTINGS</code></li> <li><code>android.permission.WRITE_SYNC_SETTINGS</code></li> - <li><code>android.permission.WRITE_USER_DICTIONARY</code></li> <li><code>com.android.alarm.permission.SET_ALARM</code></li> <li><code>com.android.launcher.permission.INSTALL_SHORTCUT</code></li> + <li><code>com.android.launcher.permission.UNINSTALL_SHORTCUT</code></li> </ul> diff --git a/docs/html/preview/index.jd b/docs/html/preview/index.jd index 022838b..5410e4f 100644 --- a/docs/html/preview/index.jd +++ b/docs/html/preview/index.jd @@ -18,6 +18,7 @@ footer.hide=1 <div class="col-7of16 col-pull-9of16"> <h1 class="dac-hero-title">Android M Developer Preview</h1> <p class="dac-hero-description"> + <strong>Final SDK is now available!</strong> Get ready for the next version of Android. Test your apps on Nexus 5, 6, 9, and Player. Explore what's new — <strong>runtime permissions</strong>, <strong>Doze</strong> and <strong>App Standby</strong> power-saving features, new @@ -30,7 +31,7 @@ footer.hide=1 </a><br> <a class="dac-hero-cta" href="{@docRoot}preview/support.html"> <span class="dac-sprite dac-auto-chevron"></span> - Update to Developer Preview 2 + Update to Developer Preview 3 (final SDK) </a><br> </div> </div> diff --git a/docs/html/preview/overview.jd b/docs/html/preview/overview.jd index 009e268..9793592 100644 --- a/docs/html/preview/overview.jd +++ b/docs/html/preview/overview.jd @@ -6,20 +6,21 @@ page.tags="preview", "developer", "android" @jd:body <div class="cols" style= -"background-color:#ffebc3; padding: 5px 0;margin-bottom:1em; text-align:center;"> +"background-color:#f2daf5; padding: 5px 0;margin-bottom:1em; text-align:center;"> <h3> - Developer Preview 2 is now available + Developer Preview 3 is now available </h3> - + <p>Includes final SDK and near-final system images</p> + <div style="margin:auto 1em"> <ul class="dac-section-links"> <li class="dac-section-link"> - <a href="{@docRoot}preview/support.html#preview2-notes"> + <a href="{@docRoot}preview/support.html#preview3-notes"> <span class="dac-sprite dac-auto-chevron"></span> Read the Notes</a> </li> <li class="dac-section-link"> - <a href="{@docRoot}preview/support.html#preview2-get"> + <a href="{@docRoot}preview/support.html#preview3-get"> <span class="dac-sprite dac-auto-chevron"></span> Get the Update</a> </li> @@ -30,6 +31,7 @@ page.tags="preview", "developer", "android" Report Issues</a> </li> </ul> + </div> </div> <p> @@ -143,14 +145,13 @@ page.tags="preview", "developer", "android" <img src="{@docRoot}preview/images/m-preview-timeline-crop.png" alt= "Preview program timeline" id="timeline"> <p> - The M Developer Preview runs from May 28 until the final Android M SDK, which - we’ll release shortly before the public release during Q3 + The M Developer Preview runs from May 28 until the final Android M public release planned for Q3 2015. </p> <p> At key development milestones, we’ll deliver updates for your test devices. - The tentative milestones are + The milestones are </p> <ul> @@ -163,12 +164,12 @@ page.tags="preview", "developer", "android" </li> <li> - <strong>Preview 3</strong> (near final, late July). + <strong>Preview 3</strong> (final APIs and SDK, now available). </li> </ul> <p> - These updates culminate in the <strong>final SDK</strong> (later in Q3), + These updates culminate in the <strong>final SDK</strong> (available now), which delivers the official APIs for the new version of Android, as well as the final system behaviors and features. </p> @@ -181,8 +182,10 @@ page.tags="preview", "developer", "android" providing system images that you can download and flash manually. </p> <p class="note"> - <strong>Note:</strong> The final SDK and system images can not be delivered - by OTA, but will instead need to be <strong>flashed manually</strong> to + <strong>Note:</strong> Developer Preview 3 includes final APIs and near-final + system images available by both download and OTA. At the full public release of + Android M later in Q3, final system images will be available by download only, + so you'll need to <strong>flash manually</strong> to your test devices.</strong> </p> @@ -316,40 +319,29 @@ page.tags="preview", "developer", "android" <h2 id="preview_apis_and_publishing"> - Targeting, preview APIs, and publishing + Final SDK, targeting, and publishing </h2> <p> - The Android M Developer Preview is a development-only release and - <strong>does not have a standard API level</strong>. If you want to opt out + <p>With Developer Preview 3, the platform APIs are now official (API level 23) and the + <strong>final SDK is now available</strong>. We recommend updating your environment + right away through Android Studio. Once you've updated your environment, you can target + the new API level, compile against the new platform, and publish at your convenience + to Google Play (including alpha, beta, or release channels). + + <p>If you want to opt out of compatibility behaviors to test your app (which is strongly recommended), you can target the M Developer Preview by setting your app's <code><a href= "/guide/topics/manifest/uses-sdk-element.html">targetSdkVersion</a></code> to <code>“MNC”</code>. </p> -<p> - The Android M Developer Preview delivers <strong>preview APIs</strong> - — the APIs will not be official until the final SDK is released, - currently planned for the third quarter of 2015. This means that you can - <strong>expect minor API changes</strong> over time, especially during - initial weeks of the program. We’ll provide a summary of changes to you with - each update of the Android M Developer Preview. -</p> - -<p class="note"> - Note that although preview APIs may change, underlying system behaviors such - as runtime permissions and power-saving features are stable and ready for - testing right away. -</p> - -<p> - In terms of publishing, Google Play <strong>prevents publishing of apps - targeting the M Developer Preview</strong>. When the Android M final SDK is - available, you’ll be able to target the official Android M API level and - publish your app to Google Play. Meanwhile, if you want to distribute an app - targeting Android M to testers, you can do so via email or by direct download - from your site. + <p>Before releasing your app targeting Android M, we strongly recommend distributing it + to a group of testers through the new <a + href="http://android-developers.blogspot.com/2015/07/iterate-faster-on-google-play-with.html"> + beta testing features available in the Google Play Developer Console. See the + <a href="https://support.google.com/googleplay/android-developer/answer/3131213">Help + Center article</a> for more information. </p> <h2 id="get_started"> @@ -357,7 +349,7 @@ page.tags="preview", "developer", "android" </h2> <p> - To get started testing your app: + To get started testing your app with Android M: </p> <ol> @@ -379,7 +371,7 @@ page.tags="preview", "developer", "android" Preview updates will be delivered through over-the-air (OTA) updates.</a> </li> - <li>Download the <a href="{@docRoot}preview/download.html#docs">M Preview API + <li>Review the <a href="{@docRoot}reference/packages.html">API Reference</a> and <a href="{@docRoot}preview/samples.html">M Preview samples</a> to gain more insight into new API features and how to use them in your app. diff --git a/docs/html/preview/support.jd b/docs/html/preview/support.jd index d908f77..9ad9ac0 100644 --- a/docs/html/preview/support.jd +++ b/docs/html/preview/support.jd @@ -5,20 +5,21 @@ page.image=images/cards/card-support_16-9_2x.png @jd:body <div class="cols" style= -"background-color:#ffebc3; padding: 5px 0;margin-bottom:1em; text-align:center;"> +"background-color:#f2daf5; padding: 5px 0;margin-bottom:1em; text-align:center;"> <h3> - Developer Preview 2 is now available + Developer Preview 3 is now available </h3> - + <p>Includes final SDK and near-final system images</p> + <div style="margin:auto 1em"> <ul class="dac-section-links"> <li class="dac-section-link"> - <a href="#preview2-notes"> + <a href="#preview3-notes"> <span class="dac-sprite dac-auto-chevron"></span> Read the Notes</a> </li> <li class="dac-section-link"> - <a href="#preview2-get"> + <a href="#preview3-get"> <span class="dac-sprite dac-auto-chevron"></span> Get the Update</a> </li> @@ -29,6 +30,7 @@ page.image=images/cards/card-support_16-9_2x.png Report Issues</a> </li> </ul> + </div> </div> <p> @@ -46,6 +48,191 @@ page.image=images/cards/card-support_16-9_2x.png community</a>. </p> +<h2 id="preview3-notes"> + Developer Preview 3 +</h2> + +<div class="wrap"> + <div class="cols"> + <div class="col-9of16"> + <p> + <em>Date: August 2015<br> + Builds: XXXXXX (Nexus 5, 6, 9), MPZ79N (Nexus Player)<br> + Hardware support: Nexus 5, 6, 9, Player<br> + Emulator support: x86 & ARM 32/64-bit<br> + Google Play services: 7.8</em> + </p> + </div> + </div> +</div> + +<p> + Android M Developer Preview 3 is the <strong>final incremental update</strong> + to the Android M preview platform that was originally released in May 2015. + The update includes <strong>final APIs and final SDK</strong>, as well as + <strong>near-final system images</strong> for testing your apps. The + updated system images include a variety of fixes and enhancements across + the system, including those related to issues reported by developers + through the external issue tracker. +</p> + +<p> + If you are currently developing or testing on Android M, you should <strong>update + your environment to Developer Preview 3</strong> as soon as possible, so that + you can begin <strong>final compatibility testing</strong> in preparation for the public + release to device manufacturers.</p> + +<p class="important">Updating to Developer Preview 3 ensures that + you are building against final platform APIs and testing against + the final behaviors. If you are just getting started with the Android + M Developer Preview SDK, follow the instructions in <a href= + "/preview/setup-sdk.html">Set up the Preview SDK</a>, then update your + environment for Developer Preview 3. +</p> + +<h3> + What's included +</h3> + +<p> + Developer Preview 3 includes an updated SDK and system images, + documentation, and samples for developing against the final Android M + development platform. +</p> + +<ul> + <li> + <strong>SDK platform</strong> and <strong>system images</strong> (Nexus and + emulator) for building and testing. You can download the updated tools from + the SDK Manager, and the system images are available by over-the-air (OTA) + update or download (see below). + </li> + + <li> + <strong>Updated documentation</strong>. The <a href= + "/preview/behavior-changes.html">Behavior Changes</a>, <a href= + "/preview/api-overview.html">API Overview</a>, and <a href= + "/preview/features/runtime-permissions.html">Permissions</a> documents have + been updated to reflect the latest changes in the platform. An updated + <a href="/preview/download.html">Developer Documentation download + package</a> is available, including full reference docs and API diff + reports. + </li> + + <li> + <strong>Translations</strong> of the documentation are now available. Use + the language selector at the bottom right corner of any page to switch + languages. Note that some of the translated docs are not yet updated for + Developer Preview 3 (coming soon). + </li> + + <li>The <a href="/preview/samples.html">Android M code samples</a> are also + updated to account for API and behavior changes: + <ul> + <li> + <a href= + "https://github.com/googlesamples/android-RuntimePermissions">RuntimePermissions</a> + / <a href= + "https://github.com/googlesamples/android-RuntimePermissionsBasic">RuntimePermissionsBasic</a> + are updated to reflect latest permissions API changes, including + <code>shouldShowRequestPermissionRationale()</code>. + </li> + <li> + <a href= + "https://github.com/googlesamples/android-FingerprintDialog">FingerprintDialog</a> + adds a flow to ask for passwords when new fingerprints are added as + well as a preference if the app will use fingerprints as a method of + authentication. + </li> + </ul> + </li> +</ul> + +<h3 id="changes"> + Key changes +</h3> + +<ul> + <li>Add here + <ul> + <li> + </li> + </ul> + </li> + + <li>Other changes + <ul> + <li> + </li> + </ul> + </li> +</ul> + +<p> + For a complete list of changes, including renamed and removed APIs, please + refer to the API Diff reports below:</p> + <ul> + <li><a href="@docRoot"sdk/api_diff/mnc-preview-3/changes.html">API Differences: Preview 2 to Preview 3 (API level 23)</a></li> + <li><a href="@docRoot"sdk/api_diff/23/changes.html">API Differences: API level 22 to API level 23</a></li> + </ul> + +<h3 id="ki"> + Known issues +</h3> + +<ul> + <li>General issues: + <ul> + <li>Add + </li> + </ul> + </li> +</ul> + +<p> + For a complete list of reported issues, please refer to the <a href= + "https://code.google.com/p/android/issues/list">open issues list</a> on the + Developer Preview <a href= + "https://code.google.com/p/android-developer-preview/">issue tracker</a>. +</p> + +<h3 id="preview3-get"> + Get Developer Preview 3 +</h3> + +<p> + You can download the Developer Preview 3 final SDK platform and + emulator images from the SDK Manager. +</p> + +<p> + Developer Preview 3 system images for supported Nexus devices are available + by download and by over-the-air (OTA) update. The OTA update is available + only to supported devices that are currently running a Developer Preview build. + If your device is running a Developer Preview build, you should automatically receive + the OTA update within a few days of availability. +</p> + +<p> + If you are just getting started with Android M Developer Preview and want + to receive Developer Preview 3 via OTA, download the + Developer Preview 2 <a href="{@docRoot}preview/download_mp2.html#images"> + system image</a>, and flash it to your device. Then, + leave the device powered on for several hours. It registers with the + OTA service, and receives Developer Preview 3 by OTA. +</p> + +<p> + For instructions on how to download and flash your device to the Developer + Preview, see the links and instructions on the <a href= + "/preview/download.html">Downloads</a> page. +</p> + +<p> + For instructions on how to start developing and testing with Android M, read + <a href="/preview/setup-sdk.html">Setting up the SDK</a>. +</p> + <h2 id="preview2-notes"> Developer Preview 2 </h2> @@ -164,8 +351,8 @@ page.image=images/cards/card-support_16-9_2x.png </li> <li>Remote Bluetooth/Wi-Fi MAC's now require either the - <code>android.permission.LOCATION_FINE</code> or - <code>android.permission.LOCATION_COARSE</code> permission. + <code>android.permission.ACCESS_COARSE_LOCATION</code> or + <code>android.permission.ACCESS_FINE_LOCATION</code> permission. </li> <li>Some accounts and identity permissions are moved to |
