DelayDroid: Reducing Tail-Time Energy by Refactoring
Android Apps
Huaqian Cai
School of Electronics
Engineering and Computer
Science,
Peking University
caihq12@sei.pku.edu.cn
Ying Zhang
School of Electronics
Engineering and Computer
Science,
Peking University
zhangying06@sei.pku.edu.cn
Zhi Jin
School of Electronics
Engineering and Computer
Science,
Peking University
zhijin@sei.pku.edu.cn
Xuanzhe Liu
School of Electronics
Engineering and Computer
Science,
Peking University
zhijin@sei.pku.edu.cn
Gang Huang
School of Electronics
Engineering and Computer
Science,
Peking University
hg@pku.edu.cn
ABSTRACT
Mobile devices with 3G/4G networking often waste energy
in the so-called “tail time” during which the radio is kept on
even though no communication is occurring. Prior work has
proposed policies to reduce this energy waste by batching
network requests. However, this work is challenging to ap-
ply in practice due to a lack of mechanisms. In response, we
have developed DelayDroid, a framework that allows a de-
veloper to add the needed policy to existing, unmodified An-
droid applications (apps) with no human effort. This allows
such prior work (as well as our own policies) to be readily
deployed and evaluated. The DelayDroid compile-time uses
static analysis and bytecode refactoring to identify method
calls that send network requests and modify such calls to de-
tour them to the DelayDroid run-time. The run-time then
applies a policy to batch them, avoiding the tail time energy
waste. DelayDroid also includes a cross-app communication
mechanism that supports policies that optimize across mul-
tiple apps running together, and we propose a policy that
does so. We evaluated the correctness and universality of the
DelayDroid mechanisms on 14 popular Android apps cho-
sen from the Google App Store. To evaluate our proposed
policy, we studied three DelayDroid-enabled apps (weather
forecasting, email client, and news client) running together,
finding that the DelayDroid mechanisms combined with our
policy can reduce 3G/4G tail time energy waste by 36%.
Categories and Subject Descriptors
D.2.7 [Software Engineering]: Distribution, Maintenance,
and Enhancement – Restructuring, reverse engineering, and
reengineering; D.4.4 [Operating Systems] Communica-
tions Management – Network communication;
General Terms
Design, Management, Performance
Keywords
Refactor, Android, Optimization, Energy
1. INTRODUCTION
Smartphone apps typically use mobile networks to carry
data traffic. When data is to be transferred to a base sta-
tion, a phone’s mobile radio (e.g., 3G or 4G radio) operates
in a high power mode. When no data is to be transferred,
the radio will first switch to a so-called tail mode that con-
sumes less energy, and later will switch to an idle mode that
consumes even less energy. The intermediate tail mode is a
compromise between energy consumption and fast response
to new data transfer requests. However, it can still lead to
a waste of energy when no data is transferred while in tail
mode [11].
Reducing such energy consumption can prolong the battery
life of a smartphone. One approach is to batch lower priority
or delay-tolerant network requests sent by apps, reducing the
occurrence of tail mode. Prior research efforts [11, 14, 15,
17] have proposed request delaying or prefetching algorithms
and policies to batch network requests. However, applying
such policies to existing apps, both to deploy the policies
and to evaluate them, is a challenging problem. We describe
the design and implementation of a framework, DelayDroid,
which supports such deployments, and use it to evaluate
our own policy. DelayDroid allows policy deployment on
existing, unmodified apps with no human effort.
DelayDroid is an automatic framework layer approach to
adding request batching to groups of Android apps. Given
a set of apps, DelayDroid first analyzes their bytecode to
find the network-relevant classes, those that make requests.
It then refactors these classes to introduce calls to its run-
time. DelayDroid’s compile-time operations are done with