天天看點

Android 6.0 ChangesAndroid 6.0 變化   Android 6.0 Changes

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-runtime-permissions">運作時權限 Runtime Permissions</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-power">Doze and App Standby</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client">阿帕奇 HTTPClient 移除</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client">Apache HTTP Client Removal</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client">OpenSSL 的分支 BoringSSL</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id">通路硬體辨別</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-hardware-id">Access to Hardware Identifiers</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-notifications">通知</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-notifications">Notifications</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-audiomanager-Changes">音頻管理變化</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-audiomanager-Changes">AudioManager Changes</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-text-selection">文本選擇</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-text-selection">Text Selection</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-bookmark-browser">浏覽器書簽變化</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-bookmark-browser">Browser Bookmark Changes</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-keystore">Android 密鑰庫變化</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-keystore">Android Keystore Changes</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-network">Wi-Fi 和網絡變化</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-network">Wi-Fi and Networking Changes</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-camera">像機服務變化</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-camera">Camera Service Changes</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-runtime">運作時變化</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-runtime">Runtime</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apk-validation">APK 校驗</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apk-validation">APK Validation</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-usb">USB 連接配接</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-usb">USB Connection</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-afw">Android 使用變化</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-afw">Android for Work Changes</a>

<a target="_blank" href="http://developer.android.com/sdk/api_diff/23/changes.html">API level 22 to 23 »</a>

<a target="_blank" href="http://developer.android.com/about/versions/marshmallow/android-6.0.html">Android 6.0 API Overview</a>

伴随着新特性和功能,Android 6.0 (API level 23)包含了各種各樣的系統變化和 API 行為變化。本文突出一些關鍵的變化,這些變化在你的應用中需要考慮到和處理。

Along with new features and capabilities, Android 6.0 (API level 23) includes a variety of system changes and API behavior changes. This document highlights some of the key changes that you should understand and account for in your apps.

如果你先前釋出過 Android 應用,就要了解這個平台影響你的應用的一些變化。

If you have previously published an app for Android, be aware that these changes in the platform affect your app.

This release introduces a new permissions model, where users can now directly manage app permissions at runtime. This model gives users improved visibility and control over permissions, while streamlining the installation and auto-update processes for app developers. Users can grant or revoke permissions individually for installed apps.

This release introduces new power-saving optimizations for idle devices and apps. These features affect all apps so make sure to test your apps in these new modes.

Doze: If a user unplugs a device and leaves it stationary, with its screen off, for a period of time, the device goes intoDoze 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.

App Standby: 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.

Note: When a device running Android 6.0 (API level 23) initiates a background Wi-Fi or Bluetooth scan, the operation is visible to external devices as originating from a randomized MAC address.

The <code>adb shell dumpsys notification</code> command no longer prints out your notification text. Use the <code>adb shell dumpsys notification --noredact</code> command instead to print out the text in a notification object.

Android 6.0 ChangesAndroid 6.0 變化   Android 6.0 Changes

To implement a floating toolbar for text selection, make the following changes in your existing apps:

This release removes support for global bookmarks. The <code>android.provider.Browser.getAllBookmarks()</code> and<code>android.provider.Browser.saveBookmark()</code> methods are now removed. Likewise, the <code>READ_HISTORY_BOOKMARKS</code> and<code>WRITE_HISTORY_BOOKMARKS</code> permissions are removed. If your app targets Android 6.0 (API level 23) or higher, don't access bookmarks from the global provider or use the bookmark permissions. Instead, your app should store bookmarks data internally.

Keys which do not require encryption at rest will no longer be deleted when secure lock screen is disabled or reset (forexample, by the user or a Device Administrator). Keys which require encryption at rest will be deleted during these events.

This release introduces the following behavior changes to the Wi-Fi and networking APIs.

In This release, the model for accessing shared resources in the camera service has been changed from the previous “first come, first serve” access model to an access model where high-priority processes are favored. Changes to the service behavior include:

Access to camera subsystem resources, including opening and configuring a camera device, is awarded based on the “priority” of the client application process. Application processes with user-visible or foreground activities are generally given a higher-priority, making camera resource acquisition and use more dependable.

On devices with appropriate camera hardware, separate application processes are able to independently open and use separate camera devices simultaneously. However, multi-process use cases, where simultaneous access causes significant degradation of performance or capabilities of any of the open camera devices, are now detected and disallowed by the camera service. This change may result in “evictions” for lower priority clients even when no other app is directly attempting to access the same camera device.

Changing the current user causes active camera clients in apps owned by the previous user account to be evicted. Access to the camera is limited to user profiles owned by the current device user. In practice, this means that a “Guest” account, for example, will not be able to leave running processes that use the camera subsystem when the user has switched to a different account.

The <code>dlopen(3) RTLD_LOCAL</code> flag is now correctly implemented. Note that <code>RTLD_LOCAL</code> is the default, so calls to<code>dlopen(3)</code> that didn’t explicitly use <code>RTLD_LOCAL</code> will be affected (unless your app explicitly used <code>RTLD_GLOBAL</code>). With<code>RTLD_LOCAL</code>, symbols will not be made available to libraries loaded by later calls to <code>dlopen(3)</code> (as opposed to being referenced by <code>DT_NEEDED</code> entries).

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 contents are removed.

Device connections through the USB port are now set to charge-only mode by default. To access the device and its content over a USB connection, users must explicitly grant permission for such interactions. If your app supports user interactions with the device over a USB port, take into consideration that the interaction must be explicitly enabled.

This release includes the following behavior changes for Android for Work:

Download Work Policy Controller via Google account addition: When a Google account that requires management via a Work Policy Controller (WPC) app is added to a device 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 Settings &gt; Accountsand in the initial device setup wizard.

A Profile Owner can set these keyguard restrictions:

Device initializer APIs which existed in the Android 6.0 (API level 23) are now removed.

<code>EXTRA_PROVISIONING_RESET_PROTECTION_PARAMETERS</code> is removed so NFC bump provisioning cannot programmatically unlock a factory reset protected device.

Changes to global settings:

<code>BLUETOOTH_ON</code>

<code>DEVELOPMENT_SETTINGS_ENABLED</code>

<code>MODE_RINGER</code>

<code>NETWORK_PREFERENCE</code>

<code>WIFI_ON</code>

繼續閱讀