This afternoon, I decided to take the plunge and replace the OS on my G1. I had been having problems with the factory software for a while (including extreme slowness and a recurring crash in the calendar sync code) which finally outweighed the risk and inconvenience of flashing it. It looked like I was going to have to wipe it, and if I have to suffer that inconvenience anyway, I might as well go for broke.
“Rooting” the phone to enable the use of an alternative OS was very easy, thanks to the excellent Recovery Flasher application. I installed it by pointing the phone’s browser at the .apk download, though in retrospect it should be even easier to use adb. Recovery Flasher installs an alternative system recovery application, used when you hold down the magic buttons while the phone is starting up. The one which comes with the phone only allowed me to perform a few simple operations, while Recovery Flasher offers more features and doesn’t limit me to OS images blessed by Google.
Next, I downloaded the latest version of the highly recommended Cyanogen build. Thanks to Recovery Flasher, I didn’t even need to rename the file, as it lets me select any .zip file from the SD card to install. This is particularly convenient when experimenting with multiple OS images. On the first try, it failed to verify the .zip, so I copied it again, and it worked. I think the microSD card which was included with the phone is a bit flaky.
I decided to try without wiping my settings, to see if I could preserve them. The Cyanogen installation instructions warned that the first boot would take a long time, but after several minutes, I started to worry. adb logcat gave me some bad news:
I/SystemServer( 631): Starting Content Manager. I/SystemServer( 631): Starting System Content Providers. I/SystemServer( 631): Starting Battery Service. I/SystemServer( 631): Starting Hardware Service. W/HAL ( 631): load: module=/system/lib/hw/lights.trout.so error=Cannot find library W/HAL ( 631): load: module=/system/lib/hw/lights.trout.so error=Cannot find library E/ActivityThread( 631): Failed to find provider info for settings W/dalvikvm( 631): threadid=31: thread exiting with uncaught exception (group=0x40019a68) E/AndroidRuntime( 631): Uncaught handler: thread PowerManagerService exiting due to uncaught exception E/AndroidRuntime( 631): *** EXCEPTION IN SYSTEM PROCESS. System will crash. E/AndroidRuntime( 631): java.lang.NullPointerException E/AndroidRuntime( 631): at android.content.ContentQueryMap.(ContentQueryMap.java:65) E/AndroidRuntime( 631): at com.android.server.PowerManagerService.initInThread(PowerManagerService.java:414) E/AndroidRuntime( 631): at com.android.server.PowerManagerService$1.onLooperPrepared(PowerManagerService.java:374) E/AndroidRuntime( 631): at android.os.HandlerThread.run(HandlerThread.java:59) E/AndroidRuntime( 631): Crash logging skipped, no checkin service I/Process ( 631): Sending signal. PID: 631 SIG: 9
It was stuck in an infinite loop due to this crash. I searched Google for the error and found no help, and after some experimentation (including clearing out the dalvik-cache directory), I resigned myself to wiping my settings. I copied off the /data directory from the phone and rebooted, and the crash disappeared. Since I have a copy, I can restore the settings individually as I need them (and may be able to identify which one triggered the crash).
adb push makes it easy to copy files back onto the device from a backup. It was easy to restore my list of WiFi networks and keys: just restore /data/misc/wifi/wpa_supplicant.conf. It looks like Bluetooth pairings are stored in /data/misc/hcid, and I’ve copied that as well, though I haven’t tested whether it worked.
Restoring applications was also straightforward: adb push some.app.apk /data/app
I didn’t bother trying to figure out how to restore my Google account settings, Twidroid settings or Twitta settings. I just re-entered my account details. Twitta doesn’t seem to be working, though. It gets a timeout trying to contact Twitter and verify my credentials (but I can ping twitter.com fine).
The phone is much snappier now, though whether it’s due to the fresh start or the Cyanogen build, I’m not sure.