From aa9d7788e0ef2ea6d6178064a2128c44fc9bf644 Mon Sep 17 00:00:00 2001
From: Quddus Chong
+ alt="" width="320" height="541" id="figure1" />
Figure 1. Fullscreen activity showing a heads-up notification
@@ -177,7 +177,7 @@ notifications look right with the new color scheme:If you are currently adding sounds and vibrations to your notifications by using the {@link android.media.Ringtone}, {@link android.media.MediaPlayer}, or {@link android.os.Vibrator} classes, remove this code so that -the system can present notifications correctly in Do Not Disturb mode. Instead, use the {@link android.app.Notification.Builder} methods instead to add sounds and vibration.
+the system can present notifications correctly in Do +Not Disturb mode. Instead, use the {@link android.app.Notification.Builder} +methods instead to add sounds and vibration.Notifications now appear in a small floating window (also called a heads-up notification) when the device is active @@ -218,40 +220,46 @@ gives your app more control over the presentation of media buttons, while providing a consistent experience for users across the lockscreen and unlocked device.
-The L Developer Preview introduces a new {@code android.app.Notification.MediaStyle} template which is recommended for this purpose. {@code MediaStyle} converts notification actions that you added with {@link android.app.Notification.Builder#addAction(int, java.lang.CharSequence, android.app.PendingIntent) Notification.Builder.addAction()} into compact buttons embedded in your app's media playback notifications.
+The L Developer Preview introduces a new +{@code android.app.Notification.MediaStyle} template which is recommended for +this purpose. {@code MediaStyle} converts notification actions that you added +with +{@link android.app.Notification.Builder#addAction(int, java.lang.CharSequence, + android.app.PendingIntent) +Notification.Builder.addAction()} into compact buttons embedded in your app's +media playback notifications.
If you are using the new -{@code android.media.session.MediaSession} class (see Media Playback Control below), attach your session -token with {@code Notification.MediaStyle.setMediaToken()} to inform the -system that this notification controls an ongoing media session.
+{@code android.media.session.MediaSession} class +(see Media Playback Control below), attach +your session token with {@code Notification.MediaStyle.setMediaToken()} to +inform the system that this notification controls an ongoing media session.Call {@code Notification.Builder.setVisibility(Notification.VISIBILITY_PUBLIC)} to mark a -notification as safe to show atop any lockscreen (secure or otherwise). For more information, see -Lockscreen Notifications.
+notification as safe to show atop any lockscreen (secure or otherwise). For more +information, see Lockscreen Notifications.With the introduction of the new concurrent documents and activities tasks feature in the upcoming -release (see Concurrent documents and activities in Recents -screen below), +
With the introduction of the new concurrent documents and activities +tasks feature in the upcoming release (see Concurrent +documents and activities in Recents screen below), the {@link android.app.ActivityManager#getRecentTasks -ActivityManager.getRecentTasks()} method is now -deprecated to improve user privacy. For backward -compatibility, this method still returns a small subset of its data, including the -calling application’s own tasks and possibly some other non-sensitive tasks -(such as Home). If your app is using this method to retrieve its own tasks, -use {@code android.app.ActivityManager.getAppTasks()} instead to retrieve that -information.
+ActivityManager.getRecentTasks()} method is now deprecated to improve user +privacy. For backward compatibility, this method still returns a small subset of +its data, including the calling application’s own tasks and possibly some other +non-sensitive tasks (such as Home). If your app is using this method to retrieve +its own tasks, use {@code android.app.ActivityManager.getAppTasks()} instead to +retrieve that information.The upcoming release adds support for Android's new material design -style. You can create -apps with material design that are visually dynamic and have UI element transitions -that feel natural to users. This support includes:
+style. You can create apps with material design that are visually dynamic and +have UI element transitions that feel natural to users. This support includes:Lockscreens in the L Developer Preview have the ability to present notifications. -Users can choose via Settings whether to allow sensitive notification -content to be shown over a secure lockscreen.
+Lockscreens in the L Developer Preview have the ability to present +notifications. Users can choose via Settings whether to allow +sensitive notification content to be shown over a secure lockscreen.
Your app can control the level of detail visible when its notifications are displayed over the secure lockscreen. To control the visibility level, call @@ -287,8 +295,12 @@ notification’s icon.
When {@code VISIBILITY_PRIVATE} is set, you can also provide a redacted version of the notification content that hides personal details. For example, -an SMS app might display a notification that shows "You have 3 new text messages." but hides the message content and senders. To provide this alternative notification, first create the replacement notification using {@link android.app.Notification.Builder}. When you create the private notification object, attach -the replacement notification to it through the {@code Notification.Builder.setPublicVersion()} method.
+an SMS app might display a notification that shows "You have 3 new text messages." +but hides the message content and senders. To provide this alternative +notification, first create the replacement notification using +{@link android.app.Notification.Builder}. When you create the private +notification object, attach the replacement notification to it through the +{@code Notification.Builder.setPublicVersion()} method.To insert a logical break so that the system treats your activity as a new task, use {@code android.content.Intent.FLAG_ACTIVITY_NEW_DOCUMENT} when -launching the activity with {@link android.app.Activity#startActivity(android.content.Intent) startActivity()}. You can also get this behavior by declaring the +launching the activity with {@link android.app.Activity#startActivity(android.content.Intent) +startActivity()}. You can also get this behavior by declaring the <activity> attribute {@code documentLaunchMode="intoExisting"} or {@code ="always"} in your manifest.
@@ -381,7 +394,8 @@ as well as bug fixes. The default user-agent string for a been updated to incorporate 36.0.0.0 as the version number.Additionally, this release brings support for the -WebAudio, WebGL, and +WebAudio, +WebGL, and WebRTC open standards. To learn more about the new features included in this release, see WebView for Android.
@@ -424,8 +438,10 @@ ES 3.1. Key new functionality provided in OpenGL ES 3.1 includes:The Java interface for OpenGL ES 3.1 on Android is provided with GLES31. When using OpenGL ES 3.1, be sure that you declare it in your manifest file with the -{@code <uses-feature>} tag and the {@code android:glEsVversion} attribute. For example:
+The Java interface for OpenGL ES 3.1 on Android is provided with GLES31. When +using OpenGL ES 3.1, be sure that you declare it in your manifest file with the +{@code <uses-feature>} +tag and the {@code android:glEsVversion} attribute. For example:
<manifest> @@ -434,7 +450,9 @@ ES 3.1. Key new functionality provided in OpenGL ES 3.1 includes: </manifest>-
For more information about using OpenGL ES, including how to check the device’s supported OpenGL ES version at runtime, see the OpenGL ES API guide.
+For more information about using OpenGL ES, including how to check the +device’s supported OpenGL ES version at runtime, see the +OpenGL ES API guide.
The L Developer Preview extends the Storage Access Framework to let users select an entire directory, rather than individual files, to -give your app read/write access to media files. When a directory is selected, -your app also has access to all its child directories and content.
+The L Developer Preview extends the Storage Access Framework to let users select an entire directory subtree, +giving apps read/write access to all contained documents without requiring user +confirmation for each item.
-To get the absolute paths to directories on external storage devices where -applications can store media files, call the new -{@code android.content.Context.getExternalMediaDirs()} method. No -additional -permissions are needed by your app to read or write to the returned paths. -In this context, "external storage devices" are those devices which the system -considers to be a -permanent part of the device, and includes emulated external storage and -physical media slots such as SD cards in battery compartments.
+To select a directory subtree, build and send an +{@code android.intent.action.OPEN_DOCUMENT_TREE} {@link android.content.Intent}. +The system displays all +{@link android.provider.DocumentsProvider} instances that support subtree selection, +letting the user browse and select a directory. The returned URI represents access to the selected +subtree. You can then use {@code DocumentsContract.buildChildDocumentsUriUsingTree()} +and {@code DocumentsContract.buildDocumentUriUsingTree()} along with +{@code ContentResolver.query()} to explore the subtree.
-You can bring up a system UI to allow the user to pick a directory subtree. -To do so, send {@code android.intent.action.OPEN_DOCUMENT_TREE} in an -{@link android.content.Intent}. If the call is successful, the system displays -the {@link android.provider.DocumentsProvider} instances installed on the -device for the user to select. When the user selects a directory from this UI, -the system returns a URI representing the selected directory tree.
+The new {@code DocumentsContract.createDocument()} method lets you create +new documents or directories anywhere under the subtree. To manage +existing documents, use {@code DocumentsContract.renameDocument()} and +{@code DocumentsContract.deleteDocument()}. Check {@code DocumentsContract.Document.COLUMN_FLAGS} +to verify provider support for these calls before issuing them.
-If you want to access a document in an existing directory, call the -{@code android.provider.DocumentsContract.buildDocumentViaUri()} method. -Pass the method a URI representing the path to the parent directory, and the -target document -ID. The method returns a new {@link android.net.Uri} which your app can -use to write media content with {@code DocumentsContract.createDocument()}. +
If you're implementing a {@link android.provider.DocumentsProvider} and want +to support subtree selection, implement {@code DocumentsProvider.isChildDocument()} +and include {@code Documents.Contract.FLAG_SUPPORTS_IS_CHILD} in your +{@code Root.COLUMN_FLAGS}.
+ +The L Developer Preview also introduces new package-specific directories on +shared storage where your app can place media files for inclusion in +{@link android.provider.MediaStore}. The new +{@code android.content.Context.getExternalMediaDirs()} returns paths to these +directories on all shared storage devices. Similarly to +{@link android.content.Context#getExternalFilesDir(java.lang.String) Context.getExternalFilesDir()}, +no additional permissions are needed by your app to access the returned paths. The +platform periodically scans for new media in these directories, but you can also +use {@link android.media.MediaScannerConnection} to explicitly scan for new +content.
Android 4.3 introduced platform support for Bluetooth Low Energy +
Android 4.3 introduced platform support for + Bluetooth Low Energy (BLE) in the central role. In the L Developer Preview, an Android device can now act as a Bluetooth LE peripheral device. Apps can use this capability to make their presence known to @@ -569,7 +596,8 @@ nearby devices. For instance, you can build apps that allow a device to function as a pedometer or health monitor and communicate its data with another BLE device.
-The new {@code android.bluetooth.le} APIs enable your apps to broadcast advertisements, scan for responses, and form connections with nearby BLE devices. +
The new {@code android.bluetooth.le} APIs enable your apps to broadcast +advertisements, scan for responses, and form connections with nearby BLE devices. You must add the {@code android.permission.BLUETOOTH_ADMIN} permission in your manifest in order for your app to use the new advertising and scanning features. @@ -692,7 +720,7 @@ in {@code <sdk>/tools}.
Figure 2.HTML visualization generated by the Battery @@ -726,7 +754,7 @@ $ historian.par [-p powerfile] bugreport.txt > out.html
+ alt="" width="360" height="609" id="figure3" />
Figure 3. Launcher screen showing managed apps (marked with a lock badge) @@ -734,17 +762,10 @@ $ historian.par [-p powerfile] bugreport.txt > out.html
The L Developer Preview provides new functionality for running apps within -an enterprise environment:
-To start the managed provisioning process, send {@code ACTION_PROVISION_MANAGED_PROFILE} in an {@link android.content.Intent}. If the @@ -767,47 +788,71 @@ for the current user and any associated managed profiles. Your Launcher can make the managed apps visually prominent by appending a “work” badge to the icon drawable with {@code android.os.UserManager.getBadgeDrawableForUser()}.
-The L Developer Preview introduces a new Lock-to-App mode that +
The L Developer Preview introduces a new task locking API that lets you temporarily restrict users from leaving your app or being interrupted -by notifications. Once your app activates this mode, users will not be able to -see notifications, access other apps, or return to the Home screen, until your +by notifications. This could be used, for example, if you are developing an +education app to support high stakes assessment requirements on Android. +Once your app activates this mode, users will not be able to see +notifications, access other apps, or return to the Home screen, until your app exits the mode.
-To prevent unauthorized usage, the device on which you want to activate -this mode must have managed profiles or must be fully controlled by a device administrator (see Managed Provisioning for more information). Furthermore, the device or managed profile owner must -authorize apps to use this mode by calling {@code android.app.admin.DevicePolicyManager.setLockTaskComponents()}.
+To prevent unauthorized usage, only authorized apps can activate task locking. +Furthermore, task locking authorization must be granted by a +specially-configured device owner app, through the {@code android.app.admin.DevicePolicyManager.setLockTaskComponents()} method.
-Before activating this mode in your app, verify that your activity is authorized by calling {@code DevicePolicyManager.isLockTaskPermitted()}.
+To set up a device owner, follow these steps:
++$ adb root +$ adb shell stop +$ rm /tmp/device_owner.xml +$ echo "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>" +>> /tmp/device_owner.xml +$ echo "&device-owner package=\"<your_device_owner_package>\" +name=\"*<your_organization_name>\" />" >> /tmp/device_owner.xml +$ adb push /tmp/device_owner.xml /data/system/device_owner.xml +$ adb reboot ++
To activate Lock-to-App mode, call +
Before using the task locking API in your app, verify that your activity is +authorized by calling {@code DevicePolicyManager.isLockTaskPermitted()}.
+ +To activate task locking, call {@code android.app.Activity.startLockTask()} from your authorized activity.
-When Lock-to-App mode is active, the following behavior takes -effect:
+When task locking is active, the following behavior takes effect:
The device will remain in this mode until an authorized activity calls -{@code Activity.stopLockTask()}. -
You can now render PDF document pages into bitmap images for printing by using the new {@code android.graphics.pdf.PdfRenderer} class. You must specify a -{@link android.os.ParcelFileDescriptor} that is seekable (that is, the content can be randomly -accessed) on which the system writes the the printable content. Your app can -obtain a page for rendering with {@code openPage()}, then call {@code render()} -to turn the opened {@code PdfRenderer.Page} into a bitmap. You can also set -additional parameters if you only want to convert a portion of the document into -a bitmap image (for example, to implement tiled rendering in order to zoom in on the document).
+{@link android.os.ParcelFileDescriptor} that is seekable (that is, the content +can be randomly accessed) on which the system writes the the printable content. +Your app can obtain a page for rendering with {@code openPage()}, then call +{@code render()} to turn the opened {@code PdfRenderer.Page} into a bitmap. You +can also set additional parameters if you only want to convert a portion of the +document into a bitmap image (for example, to implement +tiled rendering in +order to zoom in on the document).The following values are now supported in the {@code <uses-feature>} element, so you -can ensure that your app is installed only on devices that provide the features +
The following values are now supported in the +{@code <uses-feature>} +element, so you can ensure that your app is installed only on devices that provide the features your app needs.
<uses-feature android:name="android.software.leanback"
android:required="true" />
@@ -866,7 +913,9 @@ devices that fully implement the {@code android.webkit.*} APIs. Example:
The following values are now supported in the {@code <uses-permission>} to declare the +
The following values are now supported in the +{@code + <uses-permission>} to declare the permissions your app requires in order to access certain APIs.
1dbkwMm7%p3W__#j#F*bUJTNAjJY6**ayU9XI5>Lx
z_ro0nwx~yhF*(}|VREYKly#KlLb=LEK(!esy^}tdKy7}- oBQ{v$g;&Mb>Ek@olm%N$7Q^mdp_e#lOXi)<=dw?Z$arEI&l`~!NU
z#ognQREr2b^KUFtY Eo;K!p;
z>wF7$d-?S8-RwfoT@UJ