测试应用如何处理行为变更
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Wear OS 5 以 Android 14(API 级别 34)为基础。在准备
在 Wear OS 5 上使用的 Wear OS 应用,负责处理系统
影响 Android 14 中所有应用的行为变更,以及
针对以 Android 14 为目标平台的应用的变更。
Wear OS 5 变更会影响所有应用
以下行为变更会影响
Wear OS。这些变更会影响在 Wear OS 5 或更高版本上运行的所有应用。
无论目标 SDK 版本如何。
隐私信息中心
Wear OS 5 增加了对隐私信息中心的支持,该信息中心提供了
让用户可以集中查看每个应用的数据使用情况。
新手表仅显示使用表盘格式的表盘
搭载 Wear OS 5 或更高版本的手表仅支持符合以下条件的表盘:
表盘格式。因此,我们建议您
使用表盘格式
Wear OS 5 变更会影响以 Android 14 为目标平台的应用
只有在您更新目标 SDK 时,以下变更才会影响您的应用
更新到 Android 14,即 Wear OS 5 所依赖的版本。
始终开启的应用可以移至后台
从 Wear OS 5 开始,系统会将始终开启的应用移至后台
它们在氛围模式下显示一段时间后。用户可以
在系统设置中配置超时。
锻炼记录应用必须声明前台服务类型
如果您的应用在设备上将锻炼作为用户健身课程的一部分记录,
搭载 Wear OS 5 或更高版本,您必须
在需要执行相应操作的前台服务中指定 health
前台服务类型
调用 ExerciseClient
。此外,如果您的应用可以监控位置信息
信息,您还必须指定 location
前台服务类型。
一些摘下手表的设备保持解锁状态更长
在搭载 Wear OS 5 或更高版本的受支持设备上,如果用户关闭手腕
然后将设备从手腕上取下,
系统会使设备保持解锁状态的更长时间
否则。
如果您的应用需要更高级别的安全性,例如在显示
可能属于敏感数据或隐私的数据,请检查是否已启用手腕检测。
可拖动的内容可能会与系统手势激活点重叠
从 Wear OS 5 开始,系统会处理动作事件手势
与系统界面中使用的手势导航分开。
如果应用的界面包含与系统手势重叠的大型可拖动空间
那么您可能需要为这些矩形添加系统手势排除矩形
观看次数。为此,请调用 setSystemGestureExclusionRects()
以指示
系统界面,以忽略指定区域中导航手势。类似于
如何处理移动应用中存在冲突的应用手势,以提供
全面提升应用的使用体验。
您可以使用 setSystemGestureExclusionRects()
API 来获取系统界面
以不同的方式响应手势请求。例如,系统界面可能会显示
额外的界面提示(如水平栏)来确认用户的意图。
对隐式 intent 和待处理 intent 的限制
如果您在应用中使用功能块,请检查您的
intent 会受到对隐式 intent 和待处理 intent 的限制的影响。
某些通知仍无法关闭
在搭载 Android 14 的设备上使用手持版应用时
(API 级别 34)或更高版本,用户可以关闭以下通知:
不可关闭。
不过,在 Wear OS 5 及更高版本上,这些通知仍无法关闭。
Android 14 中的其他变更
Android 14 中的以下变更最有可能影响您的 Wear OS
应用。
影响所有应用的 Android 14 变更
影响以 API 级别 34 为目标平台的应用的 Android 14 变更
为您推荐
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Test how your app handles behavior changes\n\nWear OS 5 is based on Android 14 (API level 34). When you prepare your\nWear OS app for use on Wear OS 5, handle the system\n[behavior changes that affect all apps in Android 14](/about/versions/14/behavior-changes-all), as well as the\n[changes for apps that target Android 14](/about/versions/14/behavior-changes-14).\n| **Caution:** Before you upload your app to the Play Store, [target Android 14](/training/wearables/versions/5/update-target-sdk) and [configure an emulator](/training/wearables/get-started/creating#configure-emulator) to test your app.\n\nWear OS 5 changes affecting all apps\n------------------------------------\n\nThe following behavior changes affect use cases and libraries that are specific\nto Wear OS. These changes affect all apps that run on Wear OS 5 or higher,\nregardless of target SDK version.\n\n### Privacy dashboard\n\nWear OS 5 adds support for the [privacy dashboard](/training/wearables/principles#privacy-dashboard), which offers\nusers a centralized view of each app's data usage.\n\n### New watches only show watch faces that use Watch Face Format\n\nWatches that launch with Wear OS 5 or higher only support watch faces that use\nthe [Watch Face Format](/training/wearables/wff). For this reason, we recommend that you migrate to\nusing the Watch Face Format.\n\nWear OS 5 changes affecting apps that target Android 14\n-------------------------------------------------------\n\nThe following changes affect your app only if you [update your target SDK\nversion to Android 14](/training/wearables/versions/5/update-target-sdk), the version on which Wear OS 5 is based.\n\n### Always-on apps can move to the background\n\nStarting in Wear OS 5, the [system moves always-on apps to the background](/training/wearables/always-on#background)\nafter they're visible in ambient mode for a certain period of time. Users can\nconfigure the timeout in system settings.\n\n### Exercise-recording apps must declare a foreground service type\n\nIf your app records exercise as part of a user's workout session on devices that\nrun Wear OS 5 or higher, you must\n[specify the `health` foreground service type](/health-and-fitness/guides/health-services/active-data#structure) in the foreground service that\ninvokes [`ExerciseClient`](/reference/kotlin/androidx/health/services/client/ExerciseClient). Additionally, if your app can monitor location\ninformation during the workout session, you must also specify the `location`\nforeground service type.\n\n### Some off-wrist devices stay unlocked longer\n\nOn supported devices that run Wear OS 5 or higher, if the user turns off wrist\ndetection and then takes the device off of their wrist, the\n[system keeps the device unlocked for a longer period of time](/training/wearables/apps/auth-wear#device-unlocked-longer) than it would\notherwise.\n\nIf your app requires a higher level of security---such as when displaying\npotentially sensitive or private data---check whether wrist detection is enabled.\n\n### Draggable content might overlap system gesture activation points\n\nStarting in Wear OS 5, the system treats motion event gestures\nseparately from gesture navigation used in the system's UI.\n\nIf your app's UI includes large draggable spaces that overlap system gesture\nareas, you might need to add system gesture exclusion rectangles for these\nviews. To do so, call [`setSystemGestureExclusionRects()`](/reference/android/view/View#setSystemGestureExclusionRects(java.util.List%3Candroid.graphics.Rect%3E)) to instruct the\nsystem UI to ignore navigation gestures in the given areas. This is similar to\nhow you [handle conflicting app gestures](/develop/ui/views/touch-and-input/gestures/gesturenav#conflicting-gestures) in your mobile app to provide an\nedge-to-edge UI experience.\n\nYou can use the `setSystemGestureExclusionRects()` API to have the system UI\nrespond to gesture requests differently. For example, the system UI might show\nadditional UI hints, like a horizontal bar, to confirm the user's intent.\n\n### Restrictions to implicit and pending intents\n\nIf you use [tiles](/training/wearables/tiles) in your app, check whether your\nintents are affected by the [restrictions to implicit and pending intents](/about/versions/14/behavior-changes-14#safer-intents).\n\n### Some notifications are still non-dismissible\n\nWhen using the handheld version of your app on a device that runs Android 14\n(API level 34) or higher, [users can dismiss notifications](/about/versions/14/behavior-changes-all#non-dismissable-notifications) that, on\nprevious versions, were non-dismissible.\n\nOn Wear OS 5 and higher, however, these notifications are still non-dismissible.\n\nOther changes from Android 14\n-----------------------------\n\nThe following changes from Android 14 are most likely to affect your Wear OS\napp.\n\n### Android 14 changes that affect all apps\n\n- [Schedule exact alarms are denied by default](/about/versions/14/behavior-changes-all#schedule-exact-alarms)\n- [Context-registered broadcasts are queued while apps are cached](/about/versions/14/behavior-changes-all#pending-broadcasts-queued)\n- [Additional reason an app can be placed in the restricted standby\n bucket](/about/versions/14/behavior-changes-all#triggers-to-restricted-bucket)\n\n### Android 14 changes that affect apps targeting API level 34\n\n- [Foreground service types are required](/about/versions/14/behavior-changes-14#fgs-types)\n- [Non-linear font scaling](/about/versions/14/features#non-linear-font-scaling) (only affects view-based UI elements)\n- [Enforcement of `BLUETOOTH_CONNECT` permission in `BluetoothAdapter`](/about/versions/14/behavior-changes-14#enforce-bluetooth_connect)\n- [`JobScheduler` reinforces callback and network behavior](/about/versions/14/behavior-changes-14#jobscheduler-reinforces-behavior)\n- [Runtime-registered broadcasts receivers must be explicitly exported or not\n exported](/about/versions/14/behavior-changes-14#runtime-receivers-exported)\n- [Safer dynamic code loading](/about/versions/14/behavior-changes-14#safer-dynamic-code-loading)\n- [Additional restrictions on starting activities from the background](/about/versions/14/behavior-changes-14#background-activity-restrictions)\n- [User can grant partial access to photos and videos](/about/versions/14/behavior-changes-14#partial-photo-library-access)\n\nRecommended for you\n-------------------\n\n- Note: link text is displayed when JavaScript is off\n- [Privacy changes in Android 10](/about/versions/10/privacy/changes)\n- [Connect to a GATT server {:#connect}](/develop/connectivity/bluetooth/ble/connect-gatt-server)\n- [Communicate in the background](/develop/connectivity/bluetooth/ble/background)"]]