1、Runtime Permissions

  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 Context.checkSelfPermission() method. To request a permission, call the new Activity.requestPermission() method. Even if your app is not targeting the M Preview release, you should test your app under the new permissions model.

2、Power-Saving Optimizations

  If a device is unplugged and left stationary with the screen off for a period of time, it goes into Doze mode where it attempts to keep the system in a sleep state.

  The following restrictions apply to your apps while in Doze:

  • Network access is disabled, unless your app receives a high priority Google Cloud Messaging tickle.
  • Wake locks are ignored.
  • Alarms scheduled with the AlarmManager class are disabled, except for alarms that you've set with thesetAlarmClock() method and AlarmManager.setAndAllowWhileIdle().
  • WiFi scans are not performed.
  • Syncs and jobs for your sync adapters and JobScheduler are not permitted to run.

3、App standby

  With this preview, the system may determine that apps are idle when they are not in active use.

4、Adoptable Storage Devices

  With this preview, users can adopt external storage devices such as SD cards. Adopting an external storage device encrypts and formats the device to behave like internal storage. This feature allows users to move both apps and private data of those apps between storage devices. When moving apps, the system respects theandroid:installLocation preference in the manifest.

5、Apache HTTP Client Removal

  This preview 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 yourbuild.gradle file:

android {
    useLibrary 'org.apache.http.legacy'
}

6、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 AudioManager.requestAudioFocus() method instead. Similarly, the setStreamMute() method is deprecated; instead, call theAudioManager.adjustStreamVolume() method and pass in the direction value ADJUST_MUTE orADJUST_UNMUTE.

7、Text Selection

  When users select text in your app, you can now display text selection actions such as CutCopy, and Paste in a floating toolbar

8、Android Keystore Changes

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

9、Wi-Fi and Networking Changes

  This preview 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 the disableAllOthers=true setting, the device disconnected from other networks such as cellular data. In this preview, 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 newConnectivityManager.bindProcessToNetwork() method) to ensure that its network traffic is sent on the selected network.

10、Camera Service Changes

  In this preview, 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.

11、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 thenewInstance() 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 preview 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). With RTLD_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).

12、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.

13、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.

14、Android for Work Changes

  This preview includes the following behavior changes for 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 set DevicePolicyManager.setBluetoothContactSharingDisabled() to false. By default, it is set to true.
  • WiFi configuration removal: WiFi configurations added by a Profile Owner (for example, through calls to theaddNetwork() method) are now removed if that work profile is deleted.
  • WiFi configuration lockdown: Any WiFi configuration created by an active Device Owner can no longer be modified or deleted by the user if Settings.Global.WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN 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 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:
    • Calling the 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.
    • In addition, the setKeyguardDisabledFeatures() method is now available for Profile Owners, as well as to Device Owners.
    • A Profile Owner can set these keyguard restrictions:
    • The createAndInitializeUser() and createUser() methods have been deprecated.
    • The setScreenCaptureDisabled() method now also blocks the assist structure when an app of the given user is in the foreground.
    • EXTRA_PROVISIONING_DEVICE_ADMIN_PACKAGE_CHECKSUM now defaults to SHA-256. SHA-1 is still supported for backwards compatibility but will be removed in future.EXTRA_PROVISIONING_DEVICE_ADMIN_SIGNATURE_CHECKSUM now only accepts SHA-256.
    • Device initializer APIs which existed in the MNC preview are now removed. They will not appear in the final M release.
    • EXTRA_PROVISIONING_RESET_PROTECTION_PARAMETERS is removed so NFC bump provisioning cannot programmatically unlock a factory reset protected device.
    • Android for Work APIs are optimized for M runtime permissions, including Work profiles, assist layer, and others. New DevicePolicyManager permission APIs don't affect pre-M apps.
  • Changes to other APIs:
    • Data Usage: The android.app.usage.NetworkUsageStats class has been renamedandroid.app.usage.NetworkStats.
  • Changes to global settings:
    • These settings can no longer be set via setGlobalSettings():

      • BLUETOOTH_ON
      • DEVELOPMENT_SETTINGS_ENABLED
      • MODE_RINGER
      • NETWORK_PREFERENCE
      • WIFI_ON
    • These global settings can now be set via setGlobalSettings():
      • WIFI_DEVICE_OWNER_CONFIGS_LOCKDOWN

Android M新特性之Behavior Changes的更多相关文章

  1. 可能是最早的学习Android N新特性的文章

    可能是最早的学习Android N新特性的文章 Google在今天放出了Android N开发者预览版.Android N支持Nexus6及以上的设备.5太子Nexus5不再得到更新. Android ...

  2. Android O新特性和行为变更总结zz

    https://mp.weixin.qq.com/s/Ezfm-Xaz3fzsaSm0TU5LMw Android O 行为变更https://developer.android.google.cn/ ...

  3. Android N 新特性

    2016年5月19日,谷歌在美国加州的山景城举办了 Google I/O 开发者大会中发布.2016年6月,Android N正式命名为“牛轧糖” 本届I/O开发者大会上,Google重点介绍了And ...

  4. 从开发者角度解析 Android N 新特性!

    大清早看到 Google 官方博客发布 Android N 的开发者预览版,立马从床上跳起来开始仔仔细细的读起来. 从开发者角度来看,Android N 的更新并不算大.网上之前流传的一些 Andro ...

  5. Android R 新特性分析及适配指南

    Android R(Android 11 API 30)于2020年9月9日正式发布,随国内各终端厂商在售Android设备的版本更新升级,应用软件对Android R 版本的兼容适配已迫在眉睫. 对 ...

  6. Android 13 新特性及适配指南

    Android 13(API 33)于 2022年8月15日 正式发布(发布时间较往年早了一些),正式版Release源代码也于当日被推送到AOSP Android开源项目. 截止到笔者撰写这篇文章时 ...

  7. Android N 新特性 + APP开发注意事项

    1. 多窗口MultiWindow 多窗口MultiWindow,这是Android N里对开发者影响比较大的特性,也是大家疑问比较多的地方.站在开发者的角度其实不必太担心这个特性会导致我们需要修改很 ...

  8. Android开发学习之路-Android N新特性-多窗口模式

    我们都知道,在最新的Android N系统中,加入了一个新的功能,就是多窗口模式.多窗口模式允许我们在屏幕上显示两个窗口,每个窗口显示的内容不同,也就是说,我们可以一遍看电视剧,一边聊微信. 这里我们 ...

  9. Android M新特性之Permissions

    User does not have to grant any permissions when they install or upgrade the app. Instead, the app r ...

随机推荐

  1. 淘宝druid数据库连接池

    昨天偶然间在@红薯的一篇技术分享中发现了它的身影,从此想到了去看看他到底是什么西,然后在@开源中国上看到了它的功能介绍,心痒难耐 开始了对它的配置测试. 但是第一次启动就发现了一个问题, Tomat报 ...

  2. PDO处理大批量数据的入库

    <?php //最东端 东经135度2分30秒 //最西端 东经73度40分 //最南端 北纬3度52分 //最北端 北纬53度33分 //转换为度的单位$dbName = 'txhl';//数 ...

  3. 浅谈文本溢出省略号代表修剪text-overflow

    一.示例 图片显示: HTML结构: CSS样式: 注意: CSS3 text-overflow 属性规定当文本溢出包含元素时发生的事情,其中 所有浏览器都支持 white-space 属性.  示例 ...

  4. llinux 压缩 解压

    1.zip  1) 将文件夹 mydir 压缩为 mydir.zip zip -r mydir.zip mydir 2) 将文件 one.two 压缩到 ot.zip zip -r ot.zip on ...

  5. 《第一本docker书》第4章 使用docker镜像和仓库 读书笔记

    docker最底端是一个引导文件系统,即bootfs. 第二层是root文件系统rootfs,位于引导文件系统之上. 在传统的Linux引导过程中,root文件系统会最先以只读的方式加载,当引导结束并 ...

  6. LTE Module User Documentation(翻译13)——频率复用算法(Frequency Reuse Algorithms)

    LTE用户文档 (如有不当的地方,欢迎指正!)   19 Frequency Reuse Algorithms(频率复用算法)   本节我们将描述如何在 LTE 仿真中使用频率复用(FR)算法.共有两 ...

  7. <开心一笑> 前端工程师你们伤不起!

    前端工程师你们伤不起!! 来自: 刻铭 2011-03-11 14:09:53 前端工程师伤不起  老子几年前进了互联网圈!!!!!!!成了前端工程师,名字是不是很拉风,有木有!!!!!!!!  尼玛 ...

  8. iOS - Mac OS X 终端设置

    Mac OS X 终端设置 1)Finder 中显示资源库 方法一: 在 "终端" 中输入下面的命令: 显示: chflags nohidden ~/Library/ 隐藏: ch ...

  9. 关于NOR-FLASH和NAND-fLASH的区别。——Arvin

    NANDFLASH: Nand-flash内存是flash内存的一种,1989年,东芝公司发表了NAND flash结构.其内部采用非线性宏单元模式,为固态大容量内存的实现提供了廉价有效的解决方案.N ...

  10. SiteFactory简单配制

    进入后台管理: 指向节点,有点节点ID,这个节点ID就是siteFactory根据规则能生成的页面,页面更新网址: http://www.elexcon.com/Category_节点ID/Index ...