Status Update
Comments
ra...@google.com <ra...@google.com> #2
Steps to reproduce
What steps are needed to reproduce this issue?
Android build
Which Android build are you using? (e.g. UQ1A.240205.002)
Device used
Which device did you use to reproduce this issue?
Please provide sample project or apk to reproduce the issue. Also mention the steps to be followed for reproducing the issue with the given sample project or apk.
Android bug report (to be captured after reproducing the issue)
For steps to capture a bug report, please refer:
Alternate method
Navigate to “Developer options”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Note: Please upload the bug report to google drive and share the folder to android-bugreport@google.com, then share the link here.
qu...@gmail.com <qu...@gmail.com> #3
Thank you for your response. We have identified two scenarios where the issue can be reproduced, and I would like to share the details:
Scenario 1: Install via Magisk Module, Open App & Restart Device (With Simple "hello android" app) The app is installed using a Magisk module. After the installation, the app is opened. Then, the device is restarted. Once the device boots up again, the app is opened again. The last exit description is = App Exit Description: ScreenOffCPUCheckKill over +10m0s191ms used +1m5s156ms (10.855878%) threshold 2.0
Scenario 2: Continuous Load on the App Without restarting the device, we simulate a load on the app by continuously sending or printing messages with ~50ms intervals. After some time, once the screen turns off, the system automatically kills the app. The last exit description is = App Exit Description: ScreenOffCPUCheckKill over +10m0s191ms used +1m5s156ms (10.855878%) threshold 2.0
Device Information: Device: POCO X5 5G MIUI Version: 14.0.3 Android Version: 13 (TKQ1.221114.001) I hope this provides the necessary information to help further investigate the issue. If you need any more details, please let me know.
Looking forward to your assistance.
ra...@google.com <ra...@google.com> #4
Thanks for the information. Please provide the bugreport as requested in
Description
I am encountering an issue where my app is being terminated by the Android system. even though I have implemented various optimizations for background processes and CPU consumption. This issue has not been explicitly documented or addressed in the official Android documentation, and I would appreciate your guidance on how to resolve it.
Log Message: The following message from the system log indicates that my app is being killed due to CPU usage exceeding the threshold: App Exit Description: ScreenOffCPUCheckKill over +10m0s191ms used +1m5s156ms (10.855878%) threshold 2.0.
I would appreciate clarification on the exact CPU usage thresholds during screen-off conditions, and if there are any additional limits I should be aware of. and Any further recommendations or best practices for ensuring that background tasks do not lead to app termination would be extremely helpful. If there are any other strategies I can use to ensure that my app runs smoothly without exceeding system limits, I would be grateful for further insights.
This issue has been difficult to resolve, and I am seeking further assistance to understand the cause of the problem and explore possible solutions. Your help in addressing this issue would be greatly appreciated.