diff --git a/docs/html/preview/behavior-changes.jd b/docs/html/preview/behavior-changes.jd index 643fe551d5ed9..6be7f5d1726f8 100644 --- a/docs/html/preview/behavior-changes.jd +++ b/docs/html/preview/behavior-changes.jd @@ -11,28 +11,29 @@ page.image=images/cards/card-n-changes_2x.png
The Preview contains system behavior changes aimed at improving the battery - life of devices. These changes can impact the availability of system - resources and system notifications to your app. You should review these - changes and evaluate how your app may need to adjust to them. + life of devices, RAM usage, and app performance. These changes can impact the + availability of system resources and system notifications to your app. You + should review these changes and evaluate how your app may need to adjust to + them.
Figure 1. Illustration of how Doze applies a first level of system activity restrictions to improve battery life. @@ -81,34 +85,37 @@ page.image=images/cards/card-n-changes_2x.png
When a device is on battery power, and the screen has been off for a certain time, the device enters Doze and applies the first subset of restrictions: It - shuts off app network access, and defers jobs and syncs. After some more time - elapses, the system applies the rest of the Doze restrictions to {@link - android.os.PowerManager.WakeLock}, {@link android.app.AlarmManager} alarms, - GPS, and Wi-Fi scans.. Regardless of whether some or all Doze restrictions - are being applied, the system wakes the device for brief maintenance windows, - during which applications are allowed network access and can execute any - deferred jobs/syncs. + shuts off app network access, and defers jobs and syncs. If the device is + stationary for a certain time after entering Doze, the system applies the + rest of the Doze restrictions to {@link android.os.PowerManager.WakeLock}, + {@link android.app.AlarmManager} alarms, GPS, and Wi-Fi scans.. Regardless of + whether some or all Doze restrictions are being applied, the system wakes the + device for brief maintenance windows, during which applications are allowed + network access and can execute any deferred jobs/syncs.
-
- Figure 1. Illustration of how Doze applies a second level of - system activity restrictions to further improve battery life. + Figure 2. Illustration of how Doze applies a second level of + system activity restrictions after the device is stationary for a certain time.
Note that activating the screen on or plugging in the device exits Doze and removes these processing restrictions. The additional behavior does not affect recommendations and best practices in adapting your app to the prior - version of Doze introduced in Android 6.0 (API level 23). You should still + version of Doze introduced in Android 6.0 (API level 23), as discussed in + + Optimizing for Doze and App Standby. You should still follow those recommendations, such as using Google Cloud Messaging (GCM) to - send and receive messages, and start planning updates for the additional Doze - behavior. + send and receive messages, and start planning updates to accomodate the + additional Doze behavior.
-The Preview removes three implicit broadcasts in order to help optimize both @@ -150,7 +157,8 @@ page.image=images/cards/card-n-changes_2x.png
The Preview includes changes to permissions that may affect your app, @@ -216,7 +224,7 @@ page.image=images/cards/card-n-changes_2x.png -
This Preview includes changes intended to improve the usability of the @@ -227,7 +235,7 @@ page.image=images/cards/card-n-changes_2x.png
-The Preview enables users to set Display sizewhich magnifies @@ -238,13 +246,22 @@ page.image=images/cards/card-n-changes_2x.png sw320dp, which is the width of a Nexus 4, a common medium-sized phone.
+
+
+
+- Figure 1. The screen on the right shows the effect of + Figure 3. The screen on the right shows the effect of increasing the Display size of a device running an N Preview system image.
+When the device density changes, the system notifies running apps in the following ways: @@ -276,7 +293,7 @@ page.image=images/cards/card-n-changes_2x.png
-The Preview includes Vision Settings on the Welcome screen, where users can @@ -337,60 +354,22 @@ java.lang.NoSuchFieldException: No field array in class Ljava/util/ArrayList; -
- The Preview contains changes for apps that target Android for Work, including - changes to certificate installation, password resetting, secondary user - management, and access to device identifiers. If you are building apps for - Android for Work environments, you should review these changes and modify - your app accordingly. + The Preview includes namespace changes to prevent loading of non-public APIs. + If you use the NDK, you should only be using public APIs from the Android + platform. Using non-public APIs in the next official release of Android + can cause your app to crash.
-DevicePolicyManager.setCertInstallerPackage(). If the installer
- is not already installed, the system throws an
- IllegalArgumentException.
- DevicePolicyManager.resetPassword()to clear passwords or change
- ones that are already set. Device admins can still set a password, but only
- when the device has no password, PIN, or pattern.
- DISALLOW_MODIFY_ACCOUNTS user restrictions are in place.
- DISALLOW_ADD_USER restriction
- is automatically set. This prevents users from creating unmanaged secondary
- users. In addition, the CreateUser() and
- createAndInitial() methods are deprecated; the new
- DevicePolicyManager.createAndManageUser() method replaces them.
- DevicePolicyManagewr.getWifiMacAddress() . If Wi-Fi has never
- been enabled on the device, this method returns a value of {@code null}.
- - In the Preview, an application built with the NDK and targeting the N Preview - API cannot link against the platform libraries shipped with the NDK. This - change affects both the dlopen(3) and DT_NEEDED entries in your {@code .so} - files. + In order to alert you to use of non-public APIs, apps running on a Preview + device generate an error in logcat output when an app calls a non-public API. + This error is also displayed on the device screen as a message to help + raise awareness of this situation. You should review your app code to + remove use of non-public platform APIs and thoroughly test your apps using + a preview device or emulator.
@@ -402,6 +381,12 @@ java.lang.NoSuchFieldException: No field array in class Ljava/util/ArrayList; your APK contains all the .so files you intended to link against.
++ Caution: Some third-party libraries may link to non-public + APIs. If your app uses these libraries, your app may crash when running + on the next official release of Android. +
+Apps should not depend on or use native libraries that are not included in the NDK, because they may change, or be removed from one Android release to @@ -457,3 +442,49 @@ JavaVM::AttachCurrentThread from <jni.h>. {@code libcrypto.so} from BoringSSL or OpenSSL in your app. + +
+ The Preview contains changes for apps that target Android for Work, including + changes to certificate installation, password resetting, secondary user + management, and access to device identifiers. If you are building apps for + Android for Work environments, you should review these changes and modify + your app accordingly. +
+ +DevicePolicyManager.setCertInstallerPackage(). If the installer
+ is not already installed, the system throws an
+ IllegalArgumentException.
+ DevicePolicyManager.resetPassword()to clear passwords or change
+ ones that are already set. Device admins can still set a password, but only
+ when the device has no password, PIN, or pattern.
+ DISALLOW_MODIFY_ACCOUNTS user restrictions are in place.
+ DISALLOW_ADD_USER restriction
+ is automatically set. This prevents users from creating unmanaged secondary
+ users. In addition, the CreateUser() and
+ createAndInitial() methods are deprecated; the new
+ DevicePolicyManager.createAndManageUser() method replaces them.
+ DevicePolicyManagewr.getWifiMacAddress() . If Wi-Fi has never
+ been enabled on the device, this method returns a value of {@code null}.
+