skip to main content
10.1145/3582016.3582060acmconferencesArticle/Chapter ViewAbstractPublication PagesasplosConference Proceedingsconference-collections

Transparent Runtime Change Handling for Android Apps

Published:25 March 2023Publication History

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%.

References

  1. Christoffer Quist Adamsen, Gianluca Mezzetti, and Anders Møller. 2015. Systematic execution of Android test suites in adverse conditions. In Proceedings of the 2015 International Symposium on Software Testing and Analysis, ISSTA 2015, Baltimore, MD, USA, July 12-17, 2015, Michal Young and Tao Xie (Eds.). ACM, 83–93. https://doi.org/10.1145/2771783.2771786 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Domenico Amalfitano, Vincenzo Riccio, Ana C. R. Paiva, and Anna Rita Fasolino. 2018. Why does the orientation change mess up my Android application? From GUI failures to code faults. Softw. Test. Verification Reliab., 28, 1 (2018), https://doi.org/10.1002/stvr.1654 Google ScholarGoogle ScholarCross RefCross Ref
  3. Domenico Amalfitano, Vincenzo Riccio, Porfirio Tramontana, and Anna Rita Fasolino. 2020. Do Memories Haunt You? An Automated Black Box Testing Approach for Detecting Memory Leaks in Android Apps. IEEE Access, 8 (2020), 12217–12231. https://doi.org/10.1109/ACCESS.2020.2966522 Google ScholarGoogle ScholarCross RefCross Ref
  4. Niaz Arijo, Reiko Heckel, Mirco Tribastone, and Stephen Gilmore. 2011. Modular performance modelling for mobile applications. In ICPE’11 - Second Joint WOSP/SIPEW International Conference on Performance Engineering, Karlsruhe, Germany, March 14-16, 2011, Samuel Kounev, Vittorio Cortellessa, Raffaela Mirandola, and David J. Lilja (Eds.). ACM, 329–334. https://doi.org/10.1145/1958746.1958793 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Michael Backes, Sven Bugiel, Erik Derr, Sebastian Gerling, and Christian Hammer. 2016. R-Droid: Leveraging Android App Analysis with Static Slice Optimization. In Proceedings of the 11th ACM on Asia Conference on Computer and Communications Security, AsiaCCS 2016, Xi’an, China, May 30 - June 3, 2016, Xiaofeng Chen, XiaoFeng Wang, and Xinyi Huang (Eds.). ACM, 129–140. https://doi.org/10.1145/2897845.2897927 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Abhijeet Banerjee, Lee Kee Chong, Clément Ballabriga, and Abhik Roychoudhury. 2018. EnergyPatch: Repairing Resource Leaks to Improve Energy-Efficiency of Android Apps. IEEE Trans. Software Eng., 44, 5 (2018), 470–490. https://doi.org/10.1109/TSE.2017.2689012 Google ScholarGoogle ScholarCross RefCross Ref
  7. Luca Berardinelli, Vittorio Cortellessa, and Antinisca Di Marco. 2010. Performance Modeling and Analysis of Context-Aware Mobile Software Systems. In Fundamental Approaches to Software Engineering, 13th International Conference, FASE 2010, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2010, Paphos, Cyprus, March 20-28, 2010. Proceedings, David S. Rosenblum and Gabriele Taentzer (Eds.) (Lecture Notes in Computer Science, Vol. 6013). Springer, 353–367. https://doi.org/10.1007/978-3-642-12029-9_25 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Joel Coburn, Adrian M. Caulfield, Ameen Akel, Laura M. Grupp, Rajesh K. Gupta, Ranjit Jhala, and Steven Swanson. 2011. NV-Heaps: making persistent objects fast and safe with next-generation, non-volatile memories. In Proceedings of the 16th International Conference on Architectural Support for Programming Languages and Operating Systems, ASPLOS 2011, Newport Beach, CA, USA, March 5-11, 2011, Rajiv Gupta and Todd C. Mowry (Eds.). ACM, 105–118. https://doi.org/10.1145/1950365.1950380 Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Umar Farooq and Zhijia Zhao. 2018. RuntimeDroid: Restarting-Free Runtime Change Handling for Android Apps. In Proceedings of the 16th Annual International Conference on Mobile Systems, Applications, and Services, MobiSys 2018, Munich, Germany, June 10-15, 2018, Jörg Ott, Falko Dressler, Stefan Saroiu, and Prabal Dutta (Eds.). ACM, 110–122. https://doi.org/10.1145/3210240.3210327 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Clint Gibler, Jonathan Crussell, Jeremy Erickson, and Hao Chen. 2012. AndroidLeaks: Automatically Detecting Potential Privacy Leaks in Android Applications on a Large Scale. In Trust and Trustworthy Computing - 5th International Conference, TRUST 2012, Vienna, Austria, June 13-15, 2012. Proceedings, Stefan Katzenbeisser, Edgar R. Weippl, L. Jean Camp, Melanie Volkamer, Mike K. Reiter, and Xinwen Zhang (Eds.) (Lecture Notes in Computer Science, Vol. 7344). Springer, 291–307. https://doi.org/10.1007/978-3-642-30921-2_17 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Google. 2022. Android 10. https://www.android.com/android-10/ Google ScholarGoogle Scholar
  12. Google. 2022. Android App Life-Cycle. https://developer.android.com/guide/components/activities/activity-lifecycle Google ScholarGoogle Scholar
  13. Google. 2022. Android Profiler. https://developer.android.com/studio /profile/android-profiler Google ScholarGoogle Scholar
  14. Google. 2022. Fragments. https://developer.android.com/guide/fragments Google ScholarGoogle Scholar
  15. Google. 2022. Google Play. https://play.google.com/ Google ScholarGoogle Scholar
  16. Google. 2022. Handle configuration changes. https://developer.android.com/guide/topics/resources/runtime-changes Google ScholarGoogle Scholar
  17. Haryadi S. Gunawi, Abhishek Rajimwale, Andrea C. Arpaci-Dusseau, and Remzi H. Arpaci-Dusseau. 2008. SQCK: A Declarative File System Checker. In 8th USENIX Symposium on Operating Systems Design and Implementation, OSDI 2008, December 8-10, 2008, San Diego, California, USA, Proceedings, Richard Draves and Robbert van Renesse (Eds.). USENIX Association, 131–146. http://www.usenix.org/events/osdi08/tech/full_papers/gunawi/gunawi.pdf Google ScholarGoogle Scholar
  18. Chaorong Guo, Jian Zhang, Jun Yan, Zhiqiang Zhang, and Yanli Zhang. 2013. Characterizing and detecting resource leaks in Android applications. In 2013 28th IEEE/ACM International Conference on Automated Software Engineering, ASE 2013, Silicon Valley, CA, USA, November 11-15, 2013, Ewen Denney, Tevfik Bultan, and Andreas Zeller (Eds.). IEEE, 389–398. https://doi.org/10.1109/ASE.2013.6693097 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Jaap C. Haartsen. 2000. The Bluetooth radio system. IEEE Wirel. Commun., 7, 1 (2000), 28–36. https://doi.org/10.1109/98.824570 Google ScholarGoogle ScholarCross RefCross Ref
  20. Ernst Haselsteiner and Klemens Breitfuß. 2006. Security in near field communication (NFC). In Workshop on RFID security. 517, 517. https://www.academia.edu/download/27719227/security_in_nfc.pdf Google ScholarGoogle Scholar
  21. Chun-Hung Hsiao, Cristiano Pereira, Jie Yu, Gilles Pokam, Satish Narayanasamy, Peter M. Chen, Ziyun Kong, and Jason Flinn. 2014. Race detection for event-driven mobile applications. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, Edinburgh, United Kingdom - June 09 - 11, 2014, Michael F. P. O’Boyle and Keshav Pingali (Eds.). ACM, 326–336. https://doi.org/10.1145/2594291.2594330 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Cuixiong Hu and Iulian Neamtiu. 2011. Automating GUI testing for Android applications. In Proceedings of the 6th International Workshop on Automation of Software Test, AST 2011, Waikiki, Honolulu, HI, USA, May 23-24, 2011, Antonia Bertolino, Howard Foster, and J. Jenny Li (Eds.). ACM, 77–83. https://doi.org/10.1145/1982595.1982612 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Gang Hu, Xinhao Yuan, Yang Tang, and Junfeng Yang. 2014. Efficiently, effectively detecting mobile app bugs with AppDoctor. In Ninth Eurosys Conference 2014, EuroSys 2014, Amsterdam, The Netherlands, April 13-16, 2014, Dick C. A. Bulterman, Herbert Bos, Antony I. T. Rowstron, and Peter Druschel (Eds.). ACM, 18:1–18:15. https://doi.org/10.1145/2592798.2592813 Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Hao Jiang, Hongli Yang, Shengchao Qin, Zhendong Su, Jian Zhang, and Jun Yan. 2017. Detecting Energy Bugs in Android Apps Using Static Analysis. In Formal Methods and Software Engineering - 19th International Conference on Formal Engineering Methods, ICFEM 2017, Xi’an, China, November 13-17, 2017, Proceedings, Zhenhua Duan and Luke Ong (Eds.) (Lecture Notes in Computer Science, Vol. 10610). Springer, 192–208. https://doi.org/10.1007/978-3-319-68690-5_12 Google ScholarGoogle ScholarCross RefCross Ref
  25. Sungho Lee, Julian Dolby, and Sukyoung Ryu. 2016. HybriDroid: static analysis framework for Android hybrid applications. In Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, ASE 2016, Singapore, September 3-7, 2016, David Lo, Sven Apel, and Sarfraz Khurshid (Eds.). ACM, 250–261. https://doi.org/10.1145/2970276.2970368 Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Chieh-Jan Mike Liang, Nicholas D. Lane, Niels Brouwers, Li Zhang, Börje F. Karlsson, Hao Liu, Yan Liu, Jun Tang, Xiang Shan, Ranveer Chandra, and Feng Zhao. 2014. Caiipa: automated large-scale mobile app testing through contextual fuzzing. In The 20th Annual International Conference on Mobile Computing and Networking, MobiCom’14, Maui, HI, USA, September 7-11, 2014, Sung-Ju Lee, Ashutosh Sabharwal, and Prasun Sinha (Eds.). ACM, 519–530. https://doi.org/10.1145/2639108.2639131 Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Max Lillack, Christian Kästner, and Eric Bodden. 2018. Tracking Load-Time Configuration Options. IEEE Trans. Software Eng., 44, 12 (2018), 1269–1291. https://doi.org/10.1109/TSE.2017.2756048 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Martina Lindorfer, Matthias Neugschwandtner, and Christian Platzer. 2015. MARVIN: Efficient and Comprehensive Mobile App Classification through Static and Dynamic Analysis. In 39th IEEE Annual Computer Software and Applications Conference, COMPSAC 2015, Taichung, Taiwan, July 1-5, 2015. Volume 2, Sheikh Iqbal Ahamed, Carl K. Chang, William C. Chu, Ivica Crnkovic, Pao-Ann Hsiung, Gang Huang, and Jingwei Yang (Eds.). IEEE Computer Society, 422–433. https://doi.org/10.1109/COMPSAC.2015.103 Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Yepang Liu, Chang Xu, and Shing-Chi Cheung. 2014. Characterizing and detecting performance bugs for smartphone applications. In 36th International Conference on Software Engineering, ICSE ’14, Hyderabad, India - May 31 - June 07, 2014, Pankaj Jalote, Lionel C. Briand, and André van der Hoek (Eds.). ACM, 1013–1024. https://doi.org/10.1145/2568225.2568229 Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Aravind Machiry, Rohan Tahiliani, and Mayur Naik. 2013. Dynodroid: an input generation system for Android apps. In Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE’13, Saint Petersburg, Russian Federation, August 18-26, 2013, Bertrand Meyer, Luciano Baresi, and Mira Mezini (Eds.). ACM, 224–234. https://doi.org/10.1145/2491411.2491450 Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Pallavi Maiya, Aditya Kanade, and Rupak Majumdar. 2014. Race detection for Android applications. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’14, Edinburgh, United Kingdom - June 09 - 11, 2014, Michael F. P. O’Boyle and Keshav Pingali (Eds.). ACM, 316–325. https://doi.org/10.1145/2594291.2594311 Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Changwoo Min, Sanidhya Kashyap, Byoungyoung Lee, Chengyu Song, and Taesoo Kim. 2015. Cross-checking semantic correctness: the case of finding file system bugs. In Proceedings of the 25th Symposium on Operating Systems Principles, SOSP 2015, Monterey, CA, USA, October 4-7, 2015, Ethan L. Miller and Steven Hand (Eds.). ACM, 361–377. https://doi.org/10.1145/2815400.2815422 Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Jinglei Ren, Jishen Zhao, Samira Manabi Khan, Jongmoo Choi, Yongwei Wu, and Onur Mutlu. 2015. ThyNVM: enabling software-transparent crash consistency in persistent memory systems. In Proceedings of the 48th International Symposium on Microarchitecture, MICRO 2015, Waikiki, HI, USA, December 5-9, 2015, Milos Prvulovic (Ed.). ACM, 672–685. https://doi.org/10.1145/2830772.2830802 Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Zhiyong Shan, Tanzirul Azim, and Iulian Neamtiu. 2016. Finding resume and restart errors in Android applications. In Proceedings of the 2016 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2016, part of SPLASH 2016, Amsterdam, The Netherlands, October 30 - November 4, 2016, Eelco Visser and Yannis Smaragdakis (Eds.). ACM, 864–880. https://doi.org/10.1145/2983990.2984011 Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Sriram Subramanian, Yupu Zhang, Rajiv Vaidyanathan, Haryadi S. Gunawi, Andrea C. Arpaci-Dusseau, Remzi H. Arpaci-Dusseau, and Jeffrey F. Naughton. 2010. Impact of disk corruption on open-source DBMS. In Proceedings of the 26th International Conference on Data Engineering, ICDE 2010, March 1-6, 2010, Long Beach, California, USA, Feifei Li, Mirella M. Moro, Shahram Ghandeharizadeh, Jayant R. Haritsa, Gerhard Weikum, Michael J. Carey, Fabio Casati, Edward Y. Chang, Ioana Manolescu, Sharad Mehrotra, Umeshwar Dayal, and Vassilis J. Tsotras (Eds.). IEEE Computer Society, 509–520. https://doi.org/10.1109/ICDE.2010.5447821 Google ScholarGoogle ScholarCross RefCross Ref
  36. T-Firefly. 2022. Welcome to ROC-RK3399-PC-PLUS Manual. https://wiki.t-firefly.com/en/ROC-RK3399-PC-PLUS/index.html Google ScholarGoogle Scholar
  37. Mario Linares Vásquez, Gabriele Bavota, Carlos Bernal-Cárdenas, Massimiliano Di Penta, Rocco Oliveto, and Denys Poshyvanyk. 2013. API change and fault proneness: a threat to the success of Android apps. In Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC/FSE’13, Saint Petersburg, Russian Federation, August 18-26, 2013, Bertrand Meyer, Luciano Baresi, and Mira Mezini (Eds.). ACM, 477–487. https://doi.org/10.1145/2491411.2491428 Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Nicolas Viennot, Edward Garcia, and Jason Nieh. 2014. A measurement study of google play. In ACM SIGMETRICS / International Conference on Measurement and Modeling of Computer Systems, SIGMETRICS 2014, Austin, TX, USA, June 16-20, 2014, Sujay Sanghavi, Sanjay Shakkottai, Marc Lelarge, and Bianca Schroeder (Eds.). ACM, 221–233. https://doi.org/10.1145/2591971.2592003 Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Michelle Y. Wong and David Lie. 2016. IntelliDroid: A Targeted Input Generator for the Dynamic Analysis of Android Malware. In 23rd Annual Network and Distributed System Security Symposium, NDSS 2016, San Diego, California, USA, February 21-24, 2016. The Internet Society. http://wp.internetsociety.org/ndss/wp-content/uploads/sites/25/2017/09/intellidroid-targeted-input-generator-dynamic-analysis-android-malware.pdf Google ScholarGoogle Scholar
  40. Dacong Yan, Shengqian Yang, and Atanas Rountev. 2013. Systematic testing for resource leaks in Android applications. In IEEE 24th International Symposium on Software Reliability Engineering, ISSRE 2013, Pasadena, CA, USA, November 4-7, 2013. IEEE Computer Society, 411–420. https://doi.org/10.1109/ISSRE.2013.6698894 Google ScholarGoogle ScholarCross RefCross Ref
  41. Junfeng Yang, Paul Twohey, Dawson R. Engler, and Madanlal Musuvathi. 2006. Using model checking to find serious file system errors. ACM Trans. Comput. Syst., 24, 4 (2006), 393–423. https://doi.org/10.1145/1189256.1189259 Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Shengqian Yang, Dacong Yan, and Atanas Rountev. 2013. Testing for poor responsiveness in android applications. In 2013 1st International Workshop on the Engineering of Mobile-Enabled Systems (MOBS). 1–6. https://doi.org/10.1109/MOBS.2013.6614215 Google ScholarGoogle ScholarCross RefCross Ref
  43. Razieh Nokhbeh Zaeem, Mukul R. Prasad, and Sarfraz Khurshid. 2014. Automated Generation of Oracles for Testing User-Interaction Features of Mobile Apps. In Seventh IEEE International Conference on Software Testing, Verification and Validation, ICST 2014, March 31 2014-April 4, 2014, Cleveland, Ohio, USA. IEEE Computer Society, 183–192. https://doi.org/10.1109/ICST.2014.31 Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Jack Zhang, Ayemi Musa, and Wei Le. 2013. A comparison of energy bugs for smartphone platforms. In 2013 1st International Workshop on the Engineering of Mobile-Enabled Systems (MOBS). 25–30. https://doi.org/10.1109/MOBS.2013.6614219 Google ScholarGoogle ScholarCross RefCross Ref
  45. Zizhan Chen and Zili Shao. 2023. RCHDroid Appendix. https://doi.org/10.5281/zenodo.7594872 Google ScholarGoogle ScholarCross RefCross Ref
  46. Zizhan Chen and Zili Shao. 2023. RCHDroid Artifact. https://doi.org/10.5281/zenodo.7583154 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Transparent Runtime Change Handling for Android Apps

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in
        • Published in

          cover image ACM Conferences
          ASPLOS 2023: Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 3
          March 2023
          820 pages
          ISBN:9781450399180
          DOI:10.1145/3582016

          Copyright © 2023 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 25 March 2023

          Permissions

          Request permissions about this article.

          Request Permissions

          Check for updates

          Qualifiers

          • research-article

          Acceptance Rates

          Overall Acceptance Rate535of2,713submissions,20%
        • Article Metrics

          • Downloads (Last 12 months)207
          • Downloads (Last 6 weeks)31

          Other Metrics

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader