版本
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
每次 Android 版本发布时,API 和行为变更都会影响应用在 Android Auto 和 Android Automotive OS 上的运行方式。本页详细介绍了其中许多影响,并提供了有关如何更新应用以支持新版 Android 的信息。
Android 16
Android 15
- 由于面向 Android 15 或更高版本的应用的窗口边衬区发生了变化,您应测试分发到 Android Automotive OS 的应用,以验证应用实现的 activity 是否按预期呈现。如需详细了解 Android Automotive OS 特有的注意事项,请参阅处理窗口边衬区和刘海屏。
Android 14
Android 13
- 对于使用 Android for Cars 应用库构建的应用,由
CarContext
提供的 Configuration
的语言区域反映的是宿主应用的应用级语言偏好设置,而不是您应用的语言区域。
Android 12
- 在搭载 Android 12 或更高版本的设备上,Android Auto 在运行时不会更改设备的 界面模式。请参阅如何检测 Android Auto 是否正在运行?。
- 由于以 Android 12 或更高版本为目标平台的应用需要更安全的组件导出,因此您必须在
<service>
元素上为 MediaBrowserService
和 CarAppService
服务明确声明 android:exported
属性。
- 由于以 Android 12 或更高版本为目标平台的应用有待处理 intent 可变性要求,您必须明确指定应用创建的任何待处理 intent 的可变性。例如,这包括消息传递应用用于处理回复消息或将消息标记为已读的待处理 intent。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-28。
[null,null,["最后更新时间 (UTC):2025-08-28。"],[],[],null,["# Releases\n\nWith each [Android release](/about/versions), API and behavior changes impact how apps work on\nAndroid Auto and Android Automotive OS. This page details many of these impacts\nand provides information on how to update your app to support new versions of\nAndroid.\n\nAndroid 16\n----------\n\n- Android Auto makes uses of [virtual device owner overrides](/about/versions/16/behavior-changes-all#virtual-device-owner-overrides) to ignore orientation, aspect ratio, and resizability restrictions when running [parked\n apps](/training/cars/platforms/android-auto#parked-apps)\n\nAndroid 15\n----------\n\n- Because of the [window inset changes](/about/versions/15/behavior-changes-15#window-insets) for apps targeting Android 15 or higher, you should test apps distributed to Android Automotive OS to verify that activities implemented by your app render as intended. See [Work with window\n insets and display cutouts](/training/cars/parked/automotive-os#insets-and-cutouts) for more details on the considerations unique to Android Automotive OS.\n\nAndroid 14\n----------\n\n- Because of the requirement for apps targeting Android 14 or higher that [foreground service types are required](/about/versions/14/behavior-changes-14#fgs-types), check that you specify a foreground service type for any foreground services your app has, such as those for navigation and media playback.\n- Because of the requirement for apps targeting Android 14 or higher that [runtime-registered broadcast receivers must specify export behavior](/about/versions/14/behavior-changes-14#runtime-receivers-exported), apps that use the `CarConnection` API should update to `androidx.car.app:app:1.3.0-beta01` or later. See [Connection API](/training/cars/apps#car-connection).\n- Because of changes in Android Auto when running on Android 14 and higher devices, launching activities on the phone screen from the Android Auto app requires providing an [`ActivityOptions`](/reference/android/app/ActivityOptions) with the display ID set to that of the phone display ([`DEFAULT_DISPLAY`](/reference/android/view/Display#DEFAULT_DISPLAY)) when calling [`startActivity()`](/reference/android/content/Context#startActivity(android.content.Intent,%20android.os.Bundle)).\n - Apps that use the [`CarContext.requestPermissions()`](/reference/androidx/car/app/CarContext#requestPermissions(java.util.List%3Cjava.lang.String%3E,androidx.car.app.OnRequestPermissionsListener)) method should update to `androidx.car.app:app:1.7.0-alpha01` or later, which includes this fix.\n\nAndroid 13\n----------\n\n\u003cbr /\u003e\n\n- For apps built using the Android for Cars App Library, the locale of the `Configuration` provided by the `CarContext` reflects the [Per-application\n language preferences](/guide/topics/resources/app-languages) for the host app, not that of your app.\n\nAndroid 12\n----------\n\n- On devices running Android 12 or higher, Android Auto doesn't change the [UI mode](/reference/android/content/res/Configuration#uiMode) of the device when running. See [How can I detect if Android Auto\n is running?](/training/cars/platforms/android-auto#detect-connection).\n- Because of the [safer component exporting](/about/versions/12/behavior-changes-12#exported) requirements for apps targeting Android 12 or higher, you must explicitly declare the `android:exported` attribute on the `\u003cservice\u003e` element for `MediaBrowserService` and `CarAppService` services.\n- Because of the [pending intents mutability](/about/versions/12/behavior-changes-12#pending-intent-mutability) requirements for apps targeting Android 12 or higher, you must explicitly specify the mutability of any pending intent created by your app. For example, this includes the pending intents messaging apps use to handle replying to messages or marking them as read."]]