自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
崩溃恢复
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
崩溃恢复模块是在 Android 16 中引入的。该模块由 PackageWatchdog
、其观察者 RescueParty
和 RollbackPackageHealthObserver
,以及 ExplicitHealthCheckService
和相关辅助程序类组成。
崩溃恢复模块的主要目的是提供:
- 更快地迭代恢复基础架构代码。可以将 bug 修复和改进部署到整个生态中,从而通过更可靠、更快速的更新来提升用户体验。
- 在所有设备上实现一致的恢复基础架构,可以更好地洞察问题并为所有用户提供更高的可靠性。
- 在整个生态中保持统一行为,使问题排查和恢复更加简便,减少发生中断时需要的整体修复时间。
模块边界
该模块与 Android 平台的其余部分之间具有明确定义的接口,如图 1 所示:

图 1. 模块边界。
崩溃恢复模块使用 APEX 格式。
依赖项
此模块中包含的类对 Android 平台的现有依赖项保持不变。没有新增的依赖项。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):2025-07-27。"],[],[],null,["# Crash Recovery\n\nThe Crash Recovery module was introduced in Android 16. The module consists of\n[`PackageWatchdog`](https://cs.android.com/android/platform/superproject/+/android16-release:packages/modules/CrashRecovery/service/java/com/android/server/PackageWatchdog.java), its observers [`RescueParty`](https://cs.android.com/android/platform/superproject/+/android16-release:packages/modules/CrashRecovery/service/java/com/android/server/RescueParty.java) and\n[`RollbackPackageHealthObserver`](https://cs.android.com/android/platform/superproject/+/android16-release:packages/modules/CrashRecovery/service/java/com/android/server/rollback/RollbackPackageHealthObserver.java), and [`ExplicitHealthCheckService`](https://cs.android.com/android/platform/superproject/+/android16-release:packages/modules/CrashRecovery/framework/java/android/service/watchdog/ExplicitHealthCheckService.java), and\nrelated helper classes.\n\nThe primary motivation for the Crash Recovery module is to provide:\n\n- Quicker iteration of recovery infrastructure code. Bug fixes and improvements can be deployed across the ecosystem, improving the user experience with more reliable and faster updates.\n- Consistent implementation of recovery infrastructure across all devices gives better insights into issues and improves reliability for everyone.\n- Uniform behavior across ecosystems makes troubleshooting and recovery easier during outages and reduces overall mitigation time.\n\nModule boundary\n---------------\n\nThis module has a well-defined interface to and from the remainder of the\nAndroid platform, as shown in Figure 1:\n\n**Figure 1.** Module boundary.\n\nPackage format\n--------------\n\nThe Crash Recovery module uses the [APEX format](/docs/core/ota/apex).\n\nDependencies\n------------\n\nExisting dependencies of the classes included in this module on the Android\nplatform remain the same. There are no new dependencies."]]