paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Transparent Runtime Change Handling for Android Apps

面向 Android 应用的透明运行时变更处理
ASPLOS Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 32023匹配度 1/10 · 该论文研究 Android 运行时配置变更处理与状态迁移,属于移动系统/运行时方向,与用户关注的静态分析、LLM/Agent、浮点程序分析及贝叶斯程序分析等核心方向没有直接关联。引用 1 inbox
Zizhan Chen, Zili Shao
crossref: 2026-09-12

AI 速览

一句话:提出系统级方案 RCHDroid,通过新建 activity 并迁移状态而非重启,让应用无需修改即可透明处理配置变更,处理时间减少 25.46%。

移动设备常发生运行时配置变更(如屏幕旋转、尺寸调整、语言切换)。Android 现有设计采用基于重启的方案加载新配置资源,开发者必须显式处理 activity 重启带来的状态保存与恢复,否则会造成状态丢失甚至应用崩溃。本文提出 RCHDroid——一种 Android 系统层面的透明运行时变更处理方法:配置变更时不重启 activity,而是按新配置创建新 activity,将状态从旧 activity 迁移到新 activity,并让旧 activity 进入非活跃模式;对仍在旧 activity 上运行的异步任务,采用惰性迁移方案,在任务返回时迁移其结果事件。作者在真实硬件上实现了原型并开源,现有应用无需任何修改即可处理运行时变更,处理时间减少 25.46%。

问题
Android 以重启 activity 的方式应对运行时配置变更,迫使开发者手动保存与恢复状态,否则会出现状态丢失乃至应用崩溃。
方法
在 Android 系统层面实现透明的运行时变更处理:变更时新建符合新配置的 activity 并迁移旧 activity 状态,旧 activity 转入非活跃模式,同时用惰性迁移方案处理异步任务返回的结果事件。
评估
在真实硬件上实现 RCHDroid 原型并公开源码,以运行时变更处理时间等指标评估,显示现有应用无需修改即可正确处理变更,处理时间减少 25.46%。
原文摘要(Abstract)

Mobile devices often face runtime configuration changes, such as screen orientation changes, screen resizing, and language switching. The current Android design adopts a restarting-based solution to load the corresponding resources according to the new configuration. Therefore, application developers must explicitly deal with state preservation and restoration brought about by the activity restarting. Otherwise, the runtime change will cause state loss and even app crash issues. To solve the runtime change handling issues, we propose RCHDroid, a transparent runtime change handling approach for apps at the Android system level. When a configuration change occurs, we do not restart the activity, but instead, create a new activity according to the new configuration and migrate states from the old one to the new one, while putting the old activity into an inactive mode. We propose a lazy-migration scheme to handle asynchronous tasks that remain working on the old activity, which migrates the result events when the asynchronous tasks return. We have implemented a prototype of RCHDroid with real hardware and released the source code for public access. Overall, using RCHDroid, existing apps can handle runtime configuration changes without any modifications and save the runtime change handling time by 25.46%.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot10076,
  title = {Transparent Runtime Change Handling for Android Apps},
  author = {Zizhan Chen and Zili Shao},
  booktitle = {ASPLOS},
  year = {2023},
  doi = {10.1145/3582016.3582060}
}