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%.
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Google. 2022. Android 10. https://www.android.com/android-10/ Google Scholar
- Google. 2022. Android App Life-Cycle. https://developer.android.com/guide/components/activities/activity-lifecycle Google Scholar
- Google. 2022. Android Profiler. https://developer.android.com/studio /profile/android-profiler Google Scholar
- Google. 2022. Fragments. https://developer.android.com/guide/fragments Google Scholar
- Google. 2022. Google Play. https://play.google.com/ Google Scholar
- Google. 2022. Handle configuration changes. https://developer.android.com/guide/topics/resources/runtime-changes Google Scholar
- 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 Scholar
- 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 ScholarDigital Library
- Jaap C. Haartsen. 2000. The Bluetooth radio system. IEEE Wirel. Commun., 7, 1 (2000), 28–36. https://doi.org/10.1109/98.824570 Google ScholarCross Ref
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- T-Firefly. 2022. Welcome to ROC-RK3399-PC-PLUS Manual. https://wiki.t-firefly.com/en/ROC-RK3399-PC-PLUS/index.html Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- 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 ScholarDigital Library
- 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 ScholarCross Ref
- Zizhan Chen and Zili Shao. 2023. RCHDroid Appendix. https://doi.org/10.5281/zenodo.7594872 Google ScholarCross Ref
- Zizhan Chen and Zili Shao. 2023. RCHDroid Artifact. https://doi.org/10.5281/zenodo.7583154 Google ScholarDigital Library
Index Terms
- Transparent Runtime Change Handling for Android Apps
Recommendations
Do android developers neglect error handling? a maintenance-Centric study on the relationship between android abstractions and uncaught exceptions
Most of the method calls to Android abstractions are not protected.Use of Android abstractions often decreases robustness.Lack of changes to exception handling code leads to uncaught exception.The change scenarios that decrease robustness are described. ...
Exception handling bug hazards in Android
Adequate handling of exceptions has proven difficult for many software engineers. Mobile app developers in particular, have to cope with compatibility, middleware, memory constraints, and battery restrictions. The goal of this paper is to obtain a ...
Comments