Android 12 版本
Android 12 总览
https://developer.android.google.cn/about/versions/12?hl=zh-cn
文章基于官方资料上提取
Android 12 功能和变更列表
https://developer.android.google.cn/about/versions/12/summary?hl=zh-cn
行为变更:所有应用
https://developer.android.google.cn/about/versions/12/behavior-changes-all?hl=zh-cn
以下是部分主要内容:
用户体验:
SplashScreen API
(应用启动画面)
https://developer.android.google.cn/guide/topics/ui/splash-screen?hl=zh-cn
https://juejin.cn/post/6995390367520686087- 网络 intent 解析
未获准处理相应的网域,则该网络 intent 会解析为用户的默认浏览器应用 Display#getRealSize 和 getRealMetrics
:废弃和限制- 前台服务通知的用户体验延迟
安全和隐私设置:
- 大致位置(位置权限细分)
- 剪贴板访问通知(
getPrimaryClip() 与 getPrimaryClipDescription()
) - 应用无法关闭系统对话框(Intent 限制)
- 不受信任的触摸事件被屏蔽(透点击部分拦截)
Activity:
- 按下“返回”按钮时,不再完成根启动器 activity
行为变更:以 Android 12 为目标平台的应用
https://developer.android.google.cn/about/versions/12/behavior-changes-12?hl=zh-cn
安全和隐私设置:
- 待处理 intent 可变性(必须为应用创建的每个 PendingIntent 对象指定可变性)
- 不安全的 intent 启动
性能:
- 前台服务启动限制(无法在后台运行时启动前台服务)
- 精确的闹钟权限(SCHEDULE_EXACT_ALARM)
废弃
https://developer.android.google.cn/about/versions/12/deprecations?hl=zh-cn
新功能和 API
概览
https://developer.android.google.cn/about/versions/12/features?hl=zh-cn
用户体验:
Material You
- 富媒体内容插入(
OnReceiveContentListener
)
https://developer.android.google.cn/guide/topics/input/receive-rich-content?hl=zh-cn - 应用启动画面 API
- 圆角 API(
RoundedCorner
) AppSearch
(搜索引擎)- 通知的丰富图片支持(
MessagingStyle() 和 BigPictureStyle()
)
安全和隐私设置:
- 隐私信息中心
- 蓝牙权限(
BLUETOOTH_SCAN、BLUETOOTH_ADVERTISE 和 BLUETOOTH_CONNECT
权限) - 权限组查找(
getGroupOfPlatformPermission()、getPlatformPermissionsForGroup()
) - 已知签名者权限保护标志(
knownSigner
) - 安全锁定屏幕通知操作(
setAuthenticationRequired()
) - 媒体
- 图片(
Tombstone、 RenderEffect、ImageDecoder
) - 相机(
Camera2
) - 连接性
- 存储
核心功能:
- 自动更新应用(
PackageInstaller
) - 设备芯片组信息
- 核心 Java API 的更新
微件改进
https://developer.android.google.cn/about/versions/12/features/widgets?hl=zh-cn
Intent
系统广播 intent(API 级别 31)
https://developer.android.google.cn/about/versions/12/reference/broadcast-intents-31?hl=zh-cn
通用应用 intent(API 级别 31)
https://developer.android.google.cn/about/versions/12/reference/common-intents-31?hl=zh-cn