✓ Artifact evaluated by FSE Understanding and Detecting Wake Lock Misuses for Android Applications Yepang Liux Chang Xu‡ Shing-Chi Cheungx Valerio Terragnix xDept. of Comp. Science and Engineering, The Hong Kong Univ. of Science and Technology, Hong Kong, China ‡State Key Lab for Novel Software Tech. and Dept. of Comp. Sci. and Tech., Nanjing University, Nanjing, China x{andrewust, scc*, vterragni}@cse.ust.hk, ‡
[email protected]* ABSTRACT over slow network connections, it may take a while for the transaction to complete. If the user's smartphone falls asleep Wake locks are widely used in Android apps to protect crit- while waiting for server messages and does not respond in ical computations from being disrupted by device sleeping. time, the transaction will fail, causing poor user experience. Inappropriate use of wake locks often seriously impacts user To address this problem, modern smartphone platforms al- experience. However, little is known on how wake locks are low apps to explicitly control when to keep certain hardware used in real-world Android apps and the impact of their mis- awake for continuous computation. On Android platforms, uses. To bridge the gap, we conducted a large-scale empiri- wake locks are designed for this purpose. Specifically, to keep cal study on 44,736 commercial and 31 open-source Android certain hardware awake for computation, an app needs to ac- apps. By automated program analysis and manual investi- quire a corresponding type of wake lock from the Android gation, we observed (1) common program points where wake OS (see Section 2.2). When the computation completes, the locks are acquired and released, (2) 13 types of critical com- app should release the acquired wake locks properly.