Android device sometimes reboots

We are testing our Android application on real devices and notice that some of them periodically reboot after 2-3 hours of application operation. The application consists of one service with three streams (with GPS and network) and two actions, one of which is resource-intensive (displays a map).

Logcat did not help, since we did not see any important messages until the device was rebooted. Sometimes the device does not even start, only battery recovery helps to start it again.

The devices are based on different hardware manufactured in different countries (mainly in PRC, hehe) and use different versions of Android.

What are the most common problems that can lead to a reboot of the device and how to debug it?

+6
source share
4 answers

This is most likely a problem with overheating when the GPS receiver is turned on. Turning off GPS and receiving locations from the cellular network, the application runs smoothly for several hours.

Thanks to everyone for the answers and ideas!

0
source

There are two types of reboots in Android:

  • System server error. In this case, the reboot fails, but Zygote restarts. Common reasons:

    • Watchdog killed the system_server process due to a deadlock in running services.
    • A fatal error has occurred in one of the system services. However, the actual cause can sometimes be a hardware problem. For example, in some cases, after factory reset ext2 partitions are not formatted as follows. This leads to errors, and the /data/ section is mounted as read-only, which creates many errors.
    • In rare cases, the watchdog timer may be disabled due to high memory and processor load.

    Both are quite rare and can be reproduced mainly in monkey tests, and not in real situations. You can see an example of logcat output by killing the service_manager process with adb shell .

  • Panic at the core. In this case, the device really reboots. Since kernel panic occurs on the Android Android layer, it will not produce any logcat output. Instead, it will write the stack trace to the console. You can read it from /dev/kmsg or from the ADB shell: adb shell dmesg .

    Unfortunately, it is difficult to read them, as on most devices the console output is disabled, and with each buffer reload kmsg will be kmsg .

PS Also rebooting can be caused by hardware problems. In this case, he is unlikely to find any traces, but, hopefully, this should be reproduced only on certain devices.

+3
source

I had a similar problem (also gps and network). I forgot to set the network update timer for production (15 minutes), so that the device is updated every 15 seconds in any way when the device overheats an audio signal or later (htc desire)
Try to minimize CPU usage (profiling) or provide proper cooling mechanism.

+1
source

From the information you provided, it looks like you're most likely Thread . You can use DDMS to analyze usage flow in your application. Another possibility is that you simply have a shortage of memory ... you can also use DDMS to help you with this.

0
source

Source: https://habr.com/ru/post/919355/


All Articles