【译】Android 6.0 Changes (机翻加轻微人工校对)

Android 6.0 Changes

In this document

  1. Runtime Permissions
  2. Doze and App Standby
  3. Apache HTTP Client Removal
  4. BoringSSL
  5. Access to Hardware Identifiers
  6. Notifications
  7. AudioManager Changes
  8. Text Selection
  9. Browser Bookmark Changes
  10. Android Keystore Changes
  11. Wi-Fi and Networking Changes
  12. Camera Service Changes
  13. Runtime
  14. APK Validation
  15. USB Connection
  16. Android for Work Changes

API Differences

  1. API level 22 to 23 »

See Also

  1. Android 6.0 API Overview

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.

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

包括Android 6.0(API等级23)新的特性和功能,各种制度变迁和API行为更改。本文主要介绍了一些你应该了解的重要变化。

如果您发布了以前版本的Android应用,请注意这些变化对您应用程序的影响。

Runtime Permissions (运行时权限)



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.

On your apps that target Android 6.0 (API level 23) 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 checkSelfPermission() method. To request a permission, call the new requestPermissions() method. Even if your app is not targeting Android 6.0 (API level 23), you should test your app under the new permissions model.

For details on supporting the new permissions model in your app, see Working with System Permissions. For tips on how to assess the impact on your app, see Permissions Best Practices.

这个版本引入了新的权限管理模块,用户现在可以直接管理运行时应用程序的权限。这种模式为用户提供了更好的可视性和权限控制,同时简化了应用程序开发人员安装和自动更新过程。用户可以单独授予或撤销安装的应用程序的权限。

在您的目标版本6.0(API级别23)或更高的Android应用程序中,请务必在运行时检查并请求的权限。要确定您的应用程序是否已被授予了某个权限,可以调用新的checkSelfPermission()方法。要请求权限,调用新的requestPermissions()方法。即使您的应用程序没有针对Android6.0(API等级23),你也应该测试下的新权限管理模块。

为了在你的应用程序的详细信息中支持新的权限管理模块,请参阅Working with System Permissions.有关如何评估对你的应用程序的影响,请参 Permissions Best Practices

Doze and App Standby(打盹和App待机)



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 into Doze 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.

To learn more about these power-saving changes, see Optimizing for Doze and App Standby.

这个版本引入了对闲置设备和应用程序新的节能优化。这些功能会影响所有的应用程序,所以确保你的应用程序已测试这些新的模式。

打盹:如果在一段时间内一个用户拔掉一个设备并使其静止的,而其屏幕关闭,装置会进入打盹模式(试图保持系统处于睡眠状态)。在这种模式下,设备周期性地短时间恢复正常操作,使得应用程序可以同步,并且系统可以执行任何挂起的操作。
App待机:App待机允许系统来确定当用户不积极地使用某个应用时这个应用处于空闲状态。当用户不操作某个应用一定时间后,系统会做出此确定。如果设备拔出后,系统将关闭网络访问,并暂停其认为空闲的应用程序的同步和工作。
要了解更多有关这些节能的变化,请参阅优化了打盹和App待机。

(unplugs a device 的具体意义不确定,这个和google 云有关?)

Apache HTTP Client Removal(Apache HTTP Client 移除)



Android 6.0 release removes support for the Apache HTTP client. If your app is using this client and targets Android 2.3 (API level 9) or higher, use the HttpURLConnection class instead. This API is more efficient because it reduces network use through transparent compression and response caching, and minimizes power consumption. To continue using the Apache HTTP APIs, you must first declare the following compile-time dependency in your build.gradle file:

android {    useLibrary ‘org.apache.http.legacy‘}就是移除了对Apache HTTP client建议用HttpURLConnection,如果非得用自己把库引进去(在SDK的平台23可选文件夹下有)

BoringSSL



Android is moving away from OpenSSL to the BoringSSL library. If you’re using the Android NDK in your app, don‘t link against cryptographic libraries that are not a part of the NDK API, such as libcrypto.so and libssl.so. These libraries are not public APIs, and may change or break without notice across releases and devices. In addition, you may expose yourself to security vulnerabilities. Instead, modify your native code to call the Java cryptography APIs via JNI or to statically link against a cryptography library of your choice.

不用OpenSSL用BoringSSL了。后面是关于libcrypto.so 和 libssl.soNDK的事,就不翻译了

Access to Hardware Identifier(访问硬件标识)



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 WifiInfo.getMacAddress() and theBluetoothAdapter.getAddress() methods now return a constant value of 02:00:00:00:00:00.

To access the hardware identifiers of nearby external devices via Bluetooth and Wi-Fi scans, your app must now have theACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION permissions:

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.

为了给用户提供更好的数据保护,从此版本起,Android删除了使用Wi-Fi和蓝牙访问设备的本地硬件标识的代码。WifiInfo.getMacAddress()和theBluetoothAdapter.getAddress()方法现在返回常量02:00:00:00:00:00。

要通过蓝牙和Wi-Fi扫描访问附近外部设备的硬件标识符,你的应用程序现在必须拥有ACCESS_FINE_LOCATION或ACCESS_COARSE_LOCATION权限:

WifiManager.getScanResults()
BluetoothDevice.ACTION_FOUND
BluetoothLeScanner.startScan()
注意:当运行Android6.0(API等级23)的设备启动后台Wi-Fi或蓝牙扫描,此操作对外部设备来说是一个可见的随机的MAC地址。

Notifications(通知栏)



This release removes the Notification.setLatestEventInfo() method. Use the Notification.Builder class instead to construct notifications. To update a notification repeatedly, reuse the Notification.Builder instance. Call the build() method to get updated Notification instances.

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

删除了 Notification.setLatestEventInfo()方法 用Notification.Builder来创建和重用(更新)通知

用  adb shell dumpsys notification --noredact 打印通知

AudioManager Changes



Setting the volume directly or muting specific streams via the AudioManager class is no longer supported. ThesetStreamSolo() method is deprecated, and you should call the requestAudioFocus() method instead. Similarly, thesetStreamMute() method is deprecated; instead, call the adjustStreamVolume() method and pass in the direction value ADJUST_MUTE or ADJUST_UNMUTE.

通过AudioManager类直接调整音量或静音不再支持。 setStreamSolo()方法已过时,您应该调用requestAudioFocus()方法。同样,setStreamMute()方法已过时;应该调用adjustStreamVolume()方法并传递的方向值ADJUST_MUTE或ADJUST_UNMUTE。

Text Selection(文本选择器)


When users select text in your app, you can now display text selection actions such as CutCopy, and Paste in afloating toolbar. The user interaction implementation is similar to that for the contextual action bar, as described inEnabling the contextual action mode for individual views.

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

  1. In your View or Activity object, change yourActionMode calls from startActionMode(Callback)to startActionMode(Callback, ActionMode.TYPE_FLOATING).
  2. Take your existing implementation ofActionMode.Callback and make it extendActionMode.Callback2 instead.
  3. Override the onGetContentRect() method to provide the coordinates of the content Rect object (such as a text selection rectangle) in the view.
  4. If the rectangle positioning is no longer valid, and this is the only element to be invalidated, call theinvalidateContentRect() method.

If you are using Android Support Library revision 22.2, be aware that floating toolbars are not backward-compatible and appcompat takes control over ActionMode objects by default. This prevents floating toolbars from being displayed. To enable ActionMode support in anAppCompatActivity, call getDelegate(), then callsetHandleNativeActionModesEnabled() on the returned AppCompatDelegate object and set the input parameter tofalse. This call returns control of ActionMode objects to the framework. In devices running Android 6.0 (API level 23), that allows the framework to support ActionBar or floating toolbar modes, while on devices running Android 5.1 (API level 22) or lower, only the ActionBar modes are supported.

当用户在应用程序中选择文本,你现在可以显示文本选择操作,如剪切,复制,在一个悬浮的工具栏中。用户交互实现类似于对上下文动作栏的实现,详见Enabling the contextual action mode for individual views.

为了实现文本选择的浮动工具栏,您现有的应用程序中请进行以下更改:

1.在您的View or Activity对象,改变你的ActionMode回调,从startActionMode(Callback)到startActionMode(Callback, ActionMode.TYPE_FLOATING).
2.把你现有的实现ActionMode.Callback的类改为继承extendActionMode.Callback2。
3.重写onGetContentRect()方法来提供内容的矩形对象在视图中的坐标(如文本选择矩形)。
4.如果矩形定位不再有效,并且这是唯一被无效的组件,请调用theinvalidateContentRect()方法。

如果您使用的是 Android Support Library revision 22.2,要知道,浮动工具栏不向后兼容和appcompat接管默认ActionMode对象的控制权。这可以防止漂浮被显示的工具栏。要启用anAppCompatActivity ActionMode支持,请调用getDelegate(),然后调用setHandleNativeActionModesEnabled()返回AppCompatDelegate对象上,并设置输入参数为false。此调用返回控制ActionMode对象的框架。在运行Android 6.0(API等级23)的设备中,允许此框架来支持动作条或浮动工具栏模式,而在运行Android 5.1(API级别22)或更低的设备,只有对 ActionBar 的支持。

Browser Bookmark Changes(浏览书签)



This release removes support for global bookmarks. The android.provider.Browser.getAllBookmarks() andandroid.provider.Browser.saveBookmark() methods are now removed. Likewise, the READ_HISTORY_BOOKMARKS andWRITE_HISTORY_BOOKMARKS 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.

此版本删除了对全局书签的支持。该android.provider.Browser.getAllBookmarks()和android.provider.Browser.saveBookmark()方法现在已被删除。同样地,READ_HISTORY_BOOKMARKS 和WRITE_HISTORY_BOOKMARKS权限被除去。如果您的应用目标Android6.0(API级别23)或更高,不要访问全局书签provider或使用书签权限。相反,您的应用程序应该在内部存储书签数据。

Android Keystore Changes(Android 秘钥存储)



With this release, the Android Keystore provider no longer supports DSA. ECDSA is still supported.

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

在此版本中,Android的密钥库提供程序不再支持DSA。ECDSA仍然支持。

当锁屏被禁用或复位(例如,由用户或设备管理员)按键,不需要加密的其余部分将不再被删除。其余需要加密的密钥将被删除。

Wi-Fi and Networking Changes



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

  • Your apps can now change the state of WifiConfiguration objects only if you created these objects. You are not permitted to modify or delete WifiConfiguration objects created by the user or by other apps.
  • Previously, if an app forced the device to connect to a specific Wi-Fi network by using enableNetwork() with thedisableAllOthers=true setting, the device disconnected from other networks such as cellular data. In This release, the device no longer disconnects from such other networks. If your app’s targetSdkVersion is “20” or lower, it is pinned to the selected Wi-Fi network. If your app’s targetSdkVersion is “21” or higher, use the multinetwork APIs (such as openConnection()bindSocket(), and the new bindProcessToNetwork() method) to ensure that its network traffic is sent on the selected network.

这个版本引入了对无线网络连接和网络API的更改如下:

  • 您的应用程序可以现在只能改变自己创建的WifiConfiguration对象的状态。不能修改或删除用户或其他应用程序创建的WifiConfiguration对象。
  • 以前,如果一个应用程序通过使用enableNetwork()与thedisableAllOthers= true设置强制该设备连接到一个特定的Wi-Fi网络,此设备会从其他网络(如蜂窝网络)断开连接。在此版本中,该设备不再从其他网络断开。如果你的应用程序的targetSdkVersion是“20”或更低,它被固定在选择的Wi-Fi网络。如果你的应用程序的targetSdkVersion是“21”或更高,使用多网络API(如openConnection(),bindSocket(),和新的bindProcessToNetwork()方法),以确保它的网络流量发送到所选择的网络上。

Camera Service Changes(相机服务)



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.
  • Active camera clients for lower priority apps may be “evicted” when a higher priority application attempts to use the camera. In the deprecated Camera API, this results in onError() being called for the evicted client. In the Camera2API, it results in onDisconnected() being called for the evicted client.
  • 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.

在此版本中,该模型用于访问共享资源的相机业务已经从之前的“先来先服务”的访问模式,其中高优先级进程所青睐??的访问模式。更改为:

  • 访问摄像机子系统的资源,包括开放和配置摄像头装置,是基于客户端应用程序中的“优先级”。与用户可见或前景活动应用过程一般给予较高优先级的,使得照相机资源获取并使用更加可靠。
  • 客户优先级较低的应用程序尝试使用摄像头是可以被“驱逐”当一个更高优先级的应用程序尝试使用相机。在弃用摄像头API中这将导致onError()被调用给被驱逐的client。在Camera2API中将回调onDisconnected()。
  • 在与合适的摄像机的硬件设备,单独的应用程序流程都能够独立地打开,同时使用单独的摄像机装置。但是,多工序的用例,其中同时接入引起的性能或任何打开相机装置的能力显著退化,现在已可以检测和由照相机服务禁止。这种变化可能会导致“驱逐”低优先级的客户,即使在没有其他应用程序直接试图访问同一相机设备。
  • 更改当前用户造成了前一个用户帐户拥有的应用程序的激活摄像头的客户端被驱逐。访问摄像机仅限于由当前设备用户拥有用户简档。在实践中,这意味着,一个“客人”的帐户,例如,将不能够离开运行使用照相机子系统当用户已切换到其他帐户的过程。

Runtime



The ART runtime now properly implements access rules for the newInstance() method. This change fixes a problem where Dalvik was checking access rules incorrectly in previous versions. If your app uses the newInstance() method and you want to override access checks, call the setAccessible() method with the input parameter set to true. If your app uses the v7 appcompat library or the v7 recyclerview library, you must update your app to use to the latest versions of these libraries. Otherwise, make sure that any custom classes referenced from XML are updated so that their class constructors are accessible.

This release updates the behavior of the dynamic linker. The dynamic linker now understands the difference between a library’s soname and its path (public bug 6670), and search by soname is now implemented. Apps which previously worked that have bad DT_NEEDED entries (usually absolute paths on the build machine’s file system) may fail when loaded.

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

On previous versions of Android, if your app requested the system to load a shared library with text relocations, the system displayed a warning but still allowed the library to be loaded. Beginning in this release, the system rejects this library if your app‘s target SDK version is 23 or higher. To help you detect if a library failed to load, your app should log the dlopen(3) failure, and include the problem description text that the dlerror(3) call returns. To learn more about handling text relocations, see this guide.

ART runtime现在可以正确地实现访问规则中的newInstance()方法。这修复了此前一个bug。如果你的应用程序使用newInstance()方法,并要覆盖访问检查,调用setAccessible()方法的输入参数设置为true。如果你的应用程序使用V7 appcompat库或V7 recyclerview库,您必须更新您的应用程序使用这些库的最新版本。否则,请确保从XML引用的任何自定义类已更新,这样它们的类的构造函数可以访问。

此版本更新动态链接程序的行为。动态链接器现在明白库的SONAME和它的路径的区别,而且通过 soname搜索现已实现。装载时有坏DT_NEEDED项(通常是在build机器的文件系统上的绝对路径),这在以前的应用程序中可能会失败。

dlopen(3)RTLD_LOCAL标志现在可以正确实施。需要注意的是RTLD_LOCAL是默认的,所以调用todlopen(3)没有明确使用RTLD_LOCAL会受到影响(除非你的应用程序明确使用RTLD_GLOBAL)。 WithRTLD_LOCAL,符号将不被提供给由以后的调用加载到dlopen(3)(而不是由DT_NEEDED条目被引用)库。

在Android的早期版本中,如果您的应用程序请求系统来加载有文本重定位的共享库,系统将显示一个警告,但仍允许加载。在这个版本开始,系统将拒绝加载这个库,如果你的应用程序的目标SDK版本为23或更高。为了帮助您检测一个库加载失败,您的应用程序应该记录的dlopen(3)故障,包括问题的描述文本的dlerror(3)回调。要了解更多关于处理文本重定位,请参阅guide

APK Validation



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.

平台现在执行的APK更严格的验证。如果一个文件在manifest 中声明,但没有出现在APK本身,此APK会被认为是冲突的。如果任何的内容被删除一个APK必须重新签名。

USB Connection



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

通过USB端口的设备连接现在设置在默认情况下被设置为仅充电模式。要访问设备,并对其内容通过USB连接,用户必须明确地给这种操作许可。如果您的应用程序允许用户通过USB端口和设备交互,此交互必须显式启用。

Android for Work Changes



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

此版本包括Android的以下行为变化for Work:

  • Work contacts in personal contexts. The Google Dialer Call Log now displays work contacts when the user views past calls. Setting setCrossProfileCallerIdDisabled() to 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 setsetBluetoothContactSharingDisabled() to false. By default, it is set to true.
  • Wi-Fi configuration removal: Wi-Fi configurations added by a Profile Owner (for example, through calls to theaddNetwork() method) are now removed if that work profile is deleted.
  • Wi-Fi configuration lockdown: Any Wi-Fi configuration created by an active Device Owner can no longer be modified or deleted by the user if 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.
  • 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 > Accounts and in the initial device setup wizard.
  • Changes to specific DevicePolicyManager API behaviors:
  • Changes to other APIs:
    • Data Usage: The android.app.usage.NetworkUsageStats class has been renamed NetworkStats.
  • Changes to global settings:

工作接触的个人背景。在谷歌拨号呼叫日志现在显示的工作接触,当用户查看过去的电话。设置setCrossProfileCallerIdDisabled()为true隐藏在谷歌拨号呼叫记录的工作轮廓接触。工作的联系人只能与您setsetBluetoothContactSharingDisabled个人接触到设备通过蓝牙()为false一起显示。默认情况下,它被设置为true。
Wi-Fi配置去除:无线网络配置,通过配置文件所有者增加(例如,通过调用theaddNetwork()方法),如果该工作文件被删除,现在删除。
Wi-Fi配置锁定:通过积极的设备所有者创建的任何Wi-Fi配置不能再进行修改或删除用户如果WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN不为零。用户仍然可以创建和修改自己的无线网络配置。有源器件业主编辑的特权或删除任何Wi-Fi配置,包括那些不是由他们创建的。
下载工作策略控制器通过谷歌帐户另外:当需要通过工作方针控制器(WPC)的应用程序管理一个谷歌帐户添加到一个设备上的受控环境之外,添加帐户流程现在提示安装相应的WPC用户。这种行为也适用于通过设置>帐户与初始设备设置向导添加帐户。
更改特定DevicePolicyManager API的行为:
调用setCameraDisabled()方法会影响相机仅主叫用户;从管理的个人资料调用它不会影响主用户运行相机应用程序。
此外,setKeyguardDisabledFeatures()方法现在可用于资料业主,以及对设备的用户。
一个业主的个人资料可以设置这些键盘锁的限制:
KEYGUARD_DISABLE_TRUST_AGENTS和KEYGUARD_DISABLE_FINGERPRINT,从而影响该配置文件的父用户的键盘锁设置。
KEYGUARD_DISABLE_UNREDACTED_NOTIFICATIONS,受影响的只是通过在管理配置文件的应用程序生成的通知。
该createAndInitializeUser()和的createUser()方法已被弃用。
该setScreenCaptureDisabled()方法现在也阻止辅助结构,当给定用户的应用程序是在前台。
EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM现在默认SHA-256。 SHA-1仍然支持向后兼容性,但会在将来被移除。 EXTRA_PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUMnow只接受的SHA-256。
它存在在Android 6.0(API等级23)设备初始化的API,现在删除。
EXTRA_PROVISIONING_RESET_PROTECTION_PARAMETERS被删除,因此NFC凹凸供应不能以编程方式解锁恢复出厂设置保护装置。
现在,您可以使用EXTRA_PROVISIONING_ADMIN_EXTRAS_BUNDLE额外的过程中被管理设备的NFC配置数据传递给设备所有者的应用程序。
的Andr??oid为工作API是对于M运行权限优化,包括工作型材,辅助层及其它。新DevicePolicyManager权限的API不影响预-M的应用程序。
当用户退了出来,通过anACTION_PROVISION_MANAGED_PROFILE或ACTION_PROVISION_MANAGED_DEVICE意图发起的设置流程的同步部分,该系统现在返回aRESULT_CANCELED结果代码。
更改为其他API:
数据用途:android.app.usage.NetworkUsageStats类已更名为NetworkStats。
更改全局设置:
这些设置可以不再经由setGlobalSettings设置():
BLUETOOTH_ON
DEVELOPMENT_SETTINGS_ENABLED
MODE_RINGER
NETWORK_PREFERENCE
WIFI_ON
这些全局设置,现在可以通过setGlobalSettings设置():
WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN

(这个Work不知道是干什么的...)

时间: 2024-08-02 02:50:36

【译】Android 6.0 Changes (机翻加轻微人工校对)的相关文章

Android 4.0 ICS SystemUI浅析——StatusBar结构分析

Android 4.0 ICS SystemUI浅析——StatusBar结构分析 分类: Android2012-06-30 14:45 23687人阅读 评论(8) 收藏 举报 androidsignal代码分析iconseclipse平台 在上一篇文章<Android 4.0 ICS SystemUI浅析——SystemUI启动流程>中以及提到了SystemUI的组成,本文主要分析其中的StatusBar结构. 1.布局概览 首先,我们通过hierarchyviewer这个工具来查看一下

AppCan与Testin联合解决Android 5.0兼容性问题

2014年10月16日Google发布全新的Android 5.0系统,为用户带来新鲜功能和清新界面的同时,也给App适配带来了新的难题.当App遭遇5.0,您是否遇到过启动失败.控件无法兼容.迷一样的闪退?那么还有更多您还没有发现的兼容问题呢? 为了让广大开发者的应用更好服务用户,AppCan联合Testin共同为开发者扫清安卓5.0及以上版本不兼容的问题. 使用AppCan提供的云测入口: http://newdocx.appcan.cn/index.html?templateId=500

★android开发--ListView+Json+异步网络图片加载+滚动翻页的例子(图片能缓存,图片不错乱)

例子中用于解析Json的Gson请自己Google下载 主Activity: package COM.Example.Main; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import COM.Example.Main.R; import COM.Example.Main.stringG

Nexus 5 Android 6.0.1刷机、Root

Nexus 5 Android 6.0.1刷机.Root 2016-01-24   一.     准备 1.      备份通讯录等数据,切记. 2.      准备adb .fastboot.网上搜索可以下载到,如果已安装Android开发环境,可直接使用android-sdk\platform-tools目录下的adb.exe(依赖AdbWinApi.dll.AdbWinUsbApi.dll)和fastboot.exe.解压到D:\adb目录,并将D:\adb目录添加到环境变量. 3.   

android 127.0.0.1/localhost connection refused,在模拟器上应该用10.0.2.2访问你的电脑本机

调试中通过android simulator模拟器链接localhost或者127.0.0.1,因为我在电脑上面建立了apache,我的代码大概就是URL url = new URL(urlString);     URLConnection urlconn = url.openConnection(); 但是报错了!! Exception 1:java.net.ConnectException: localhost/127.0.0.1:8080 - Connection refused 问题是

【译】Android 7.0 for Developers

译者注: 译者:aroundme 原文地址:https://developer.android.com/about/versions/nougat/android-7.0.html 主要是介绍Android 7.0提供新特性. 翻译的动机主要是为了适配Android 7.0,提前踩点.防止大坑. 就翻译来看,除去一些可有可无的更新之外,关注点主要是集中在四点: * 通知栏一系列更新 * 对于应用后台优化(或者说限制) * WebView持续性更新(混合开发需要注意) * 对于GPU的优化,优化3

华为荣耀 4x 刷机体验 直奔 Android 6.0

序 手机是 华为荣耀 4X Android 4.4.4 最近手机运行缓慢,卡顿明显.需要清理一下手机, 主要的垃圾来自于微信,占用的空间太多了,使用360手机助手 + 360卫士将微信内以及系统的的垃圾清理干净,有一些小视频可以导出哦,很是方便. 完毕后,发现 HiSuit 有个刷机按钮,出于好奇,点了进去,有三个版本: 极客版 ( 有两个Android 5.1) 正式版 (有两个版本, Android 4.4 和 Android 5.1) 发货版 ( 这里是空的) 考虑到稳定性,还是选择了正式

【rfc6749】机翻 The OAuth 2.0 Authorization Framework

本文禁止转载 原文地址  http://tools.ietf.org/html/rfc6749 下面内容全部是谷歌娘的翻译 = = ,写这个的目的是给自己留个备份,这样就不用每次打开谷歌娘了. ------------------------- 机翻的分割线 ---------------------------------------- OAuth的2.0授权框架 抽象 OAuth的2.0授权框架允许第三方 应用程序获取有限的访问HTTP服务,无论是在 代表的资源所有者通过编排批准互动 资源所

[Android编译(二)] 从谷歌官网下载android 6.0源码、编译并刷入nexus 6p手机

1 前言 经过一周的奋战,终于从谷歌官网上下载最新的android 6.0.1_r62源码,编译成功,并成功的刷入nexus6p,接着root完毕,现写下这篇博客记录一下实践过程. 2 简介 自己下载android系统源码,修改定制,然后编译刷入安卓手机,想想还有点小激动呢.简单点说一句话--定制我们自己的MIUI,这就是android的魅力,这篇博客博主就来教大家实现自己的定制系统. 首先,要明白下面的基础知识: (1) 什么是aosp? aosp就是android open source p