Since getting Donut, I've noticed that my phone takes a whopping 3 to 4 minutes to finish booting and loading its apps. On Cupcake it took a minute or so. I rarely reboot so it didn't bother me that much.
Anyway, I've finally got around to finding out why... I figured I'd post the details here in case the issue affects anyone else.
So, the symptoms are as follows:
I start the phone as normal. The T-Mobile G1 logo stays on for the usual time (30 seconds maybe?), and then the Android logo does its animation for about another 30 seconds. Then the Android logo animation freezes for maybe 20 seconds. Then the screen goes black for about a minute or more, which feels like an hour. Finally, it seems to snap out of it and all is fine eventually.
The log (obtained by connecting the phone to my PC, and running logcat while it was booting) showed this happening just as the screen was black:
Android then automatically tries to load again, which results in the exact same system crash. Hence the long delay with a black screen.11-14 08:18:34.705 V/WifiStateTracker( 78): IP configuration: ipaddr 192.168.0.90 gateway 192.168.0.1 netmask 255.255.255.0 dns1 192.168.0.1 dns2 208.67.222.220 DHCP server 0.0.0.0 lease 0 seconds
11-14 08:18:34.945 E/ActivityManager( 78): Attempt to launch receivers of broadcast intent Intent { act=android.net.conn.CONNECTIVITY_CHANGE (has extras) } before boot completion
11-14 08:18:34.965 W/dalvikvm( 78): threadid=39: thread exiting with uncaught exception (group=0x4001da28)
11-14 08:18:34.975 E/AndroidRuntime( 78): Uncaught handler: thread ConnectivityThread exiting due to uncaught exception
11-14 08:18:34.975 E/AndroidRuntime( 78): *** EXCEPTION IN SYSTEM PROCESS. System will crash.
Android tries a third time to start, and for some reason it always works the third time, and that's why it finally snaps out of it and you see the standby screen as normal.
So, what is the problem? Well, I suspected a dodgy update, apps, demons, gremlins, etc. But it turns out it's actually a bug in Android itself (which I have since officially logged with Google). If you notice the error is occurring because the phone connects very quickly to my WiFi access point (this is made so fast by having a damn good access point, using a static IP, and fast pre-amble, if you're interested) - so quickly in fact that when the WiFi manager decides to announce the fact that it's connected to WiFi to the rest of the system by broadcasting the CONNECTIVITY_CHANGE intent the system isn't ready to receive any intents yet as it hasn't finished booting. Hence, it throws an exception, which (and this is bad programming to be fair) isn't caught or handled, and hence the system crashes. When it crashes, the screen goes black, and it stays black while it tries to restart a 2nd time, and crashes again, and then finally succeeds the third time and all is well and your desktop appears.
So, how to fix it? Easy - turn off WiFi before you turn the phone off. When I do this (and I've repeated the process many times to quadruple check this fact) it boots absolutely fine in about a minute.
A point to note is that this is not caused by any apps. This all happens way before Android even gets to loading all of the startup apps and the Home process.
Bookmarks