Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Empirical Study of Android Alarm Usage for Application Scheduling

739 views

Published on

We looked at how applications are using/misusing alarms in Androids and discuss the Google actions to minimize their impact on energy consumption.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Empirical Study of Android Alarm Usage for Application Scheduling

  1. 1. An Empirical Study of Android Alarm Usage for Application Scheduling Mario Almeida1 , Muhammad Bilal1 Jeremy Blackburn2 , Konstantina Papagiannaki2 1 Polytechnic University of Catalonia 2 Telefonica Research 1 (4knahs@gmail.com)
  2. 2. Energy: Major Concern for Mobiles ● Main Culprits? ○ Screen ○ Radio ○ CPU ○ Graphics ○ Sensors ● Interactive Use ● Background Use (ACM ID 1855861 USENIXATC'10) 2
  3. 3. How Much Background Use Is There? Online presence apps tend to run in background 70-80% of the time! (Andrius et al CONEXT’13) 3
  4. 4. How Much Background Use Is There? Up to 9 times faster energy drain with 4 popular apps! (Andrius et al CONEXT’13) 4
  5. 5. How To Schedule Background Tasks? Android alarms to the rescue! Time critical (exact) or not (inexact/deferrable) Apps can determine: ● Deferrability ● Trigger time ● Repetition interval of alarms! 5
  6. 6. How To Schedule Background Tasks? From Android Kitkat (19) alarms can be batched! ● Reduced wakeups ● Saves energy (data) 6 Major target of energy saving innovation in last 2 Google IO conferences! Traffic shaping (e.g., batching) cannot ignore app- protocol interaction & OS integration *Vergara et al IWCMC’13
  7. 7. How To Schedule Background Tasks? Android 6 (SDK23 ,Oct 15) -> 3 new APIsJobInfo APIs (21) not adopted by apps 7
  8. 8. How To Schedule Background Tasks? 8 Android Studio Eclipse
  9. 9. How To Schedule Background Tasks? Android 6 (SDK23 ,Oct 15) -> 3 new APIsJobInfo APIs (21) not adopted by apps 9 API Fragmentation leads to unpredictable QoS/performance
  10. 10. Questions ● How outdated are target SDKs? ● How widespread is alarm usage? ● How do apps use alarms? ● How do alarms impact a running device? ● How to improve alarm usage? ? 10
  11. 11. Dataset & Methodology ● Google Play Store Crawler ○ Up to 564 of the most popular free apps for each app category ○ >22K unique apps ● Popular apps ○ + representative apps on user devices ○ + likely -> optimized for energy consumption > 81% of total downloads! 11 May 2015 *Viennot et al SIGMETRICS’14
  12. 12. Dataset & Methodology Static analysis: ○ Alarm API usage ○ Annotations (e.g., TargetApi) ○ Package names ○ Target SDKs 12 Skype
  13. 13. How Outdated Are Target SDKs? Majority (76%) 18 months. (SDK<=19). ~Half lagging by > 21 months! 13
  14. 14. How Widespread Is Alarm Usage? Most Alarms Exact Alarms Widgets (80%) Casino games (37.9%) Wallpapers (63%) Weather (35%) Personalization (60%) Family games (32.5%) Communication(59%) Communication (32.1%) 47% of apps use alarms Apps define up to 70 alarm! 14
  15. 15. Why Are Alarms So Widespread? 10% of ALL alarms are defined in these libraries 22% are exact! 15
  16. 16. How Do Apps Use Alarms? 31.5% of all alarms are repeating! *Note: apps can have both exact and inexact alarms! 16 SDK < 19 Alarm Type Percentage of Apps Inexact Alarms 8.49% Exact Alarm 44.05% Any Alarm 46.06% SDK >= 19 Alarm Type Percentage of Apps Inexact Alarms 52.91% Exact Alarm 2.31% Any Alarm 53.49%
  17. 17. Is It That Many Apps Are Outdated? Even regularly updated apps often do not update their SDK! 17
  18. 18. How Do Alarms Impact A Running Device? Experiment: ● Install dataset apps on freshly flashed device ● Run them once and let them on for 30m ● Reboot, let the phone go idle, wait 30m ● Record alarm definitions/wake ups for 3h We used a device with Android 4.4.4 (SDK 19) with alarm batching capabilities! 18
  19. 19. How Do Alarms Impact A Running Device? Dataset 1: ● 30 most popular apps ○ >1K to >500M downloads Dataset 2: ● 30 apps with most setRepeating alarms and SDK <19 ○ deferred if SDK>= 19 19
  20. 20. How Frequent Are Device Wakeups? Not deferred due to SDK target! High correlation (r=0.86, p<0.01) alarm registered <-> wakeups 20 Dataset 1: ● 261 alarms registered, 20% woke the device Dataset 2: ● 1041 alarms registered, 61% woke device!
  21. 21. Examples Of Careless Alarm Usage ● Norton Security & Antivirus ○ Both SDK 17, 10M-50M downloads, together woke the device 141 times! ● Spoora (instant messaging) ○ SDK 9, 10-50K downloads, woke the device 372 times! ● Facebook app & messenger ○ Do not share communication, both do keep-alives and woke the device 47 times! 21
  22. 22. How To Improve Alarm Usage? ● Improve dev knowledge? ○ What about API fragmentation? ● Make all alarms inexact? ○ Does it break? ● Simply target a newer SDK? ○ Might work for more recent devices ● iOS? ○ Are alarms really needed? 22
  23. 23. Summary ● ~ 50% apps define alarms, from which ~40% have exact alarms. ● Alarms & API fragmentation can greatly affect energy efficiency. ● Most alarms use APIs outdated by >18months. ● Alarms: ○ Present in all categories. ○ Up to 70 alarm definitions per app. ○ At least 10% due to 3rd party libs. ○ Can wake the device very often -> wrong SDK 23
  24. 24. CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME CITE ME Thank You For Your Time! Questions? 24
  25. 25. News prior to study! Doze: ● Android 6 -> SDK 23 (study is <= 22). ● Long period of inactivity -> defer alarms ● setExact() and setWindow() -> deferred ● BUT: ○ 3 new apis (setAndAllowWhileIdle, setExactAndAllowWhileIdle and setAlarmClock) ○ Better name semantics, devs can still misuse! 25
  26. 26. Image rights https://commons.wikimedia.org/wiki/File: Android_sick.svg https://c2.staticflickr. com/6/5306/5642989630_bd05b2544c_b.jpg 26

×