We'll see | Matt Zimmerman

a potpourri of mirth and madness

Android emancipation

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.


Written by Matt Zimmerman

August 22, 2009 at 20:12

Posted in Uncategorized

Tagged with ,

10 Responses

Subscribe to comments with RSS.

  1. Wow what a coincidence, I just did this as well. I found an app called cm-updater that will act as an update manager to cyanogen builds, very handy.

    I followed these instructions.

    Mine feels snappier, but I made a note to reflash it to the stock ROM first then the cyanogen one so I could refresh my brain on the speed difference. However I have noticed that some apps tend to crash more often (notably Google Voice) but I haven’t spent enough time to really determine if it’s more stable than the stock ROM just yet.

    Cyanogen is on twitter (@cyanogen) and seems very responsive to bug reports from what I can see in the bug tracker and fixes the little annoying things, so I’ll likely keep the ROM but not run the development version.


    August 22, 2009 at 23:44

  2. Perhaps you were experiencing this issue:



    August 23, 2009 at 03:28

  3. I did the same today and everything went very well. Don’t forget to add an ext2 partition to your sd card. There are great tools to help you do it and this build will automatically use the sd for app storage after, leading to more space and a faster system.


    August 23, 2009 at 05:13

  4. The cyanogen images sound interesting but don’t seem to come with any source code and apparently include vendor/operator specific proprietary applications.

    What I’d love to see is a device and operator agnostic Android distribution that comes with complete source code. Are you aware of any such efforts?


    August 23, 2009 at 15:04

  5. I’ve been through a ton of issues, though most recently the way I made my phone go from horribly slow and crashy to nifty fast is by deleting all the apps (there weren’t many) that run in background. Twitdroid was one of them– I’ve found my G1 runs crazy slow unless I have a good amount of memory free for cache, and memory on the device is quite limited. Also ddms is awesome for finding out what is eating up ram.


    August 24, 2009 at 03:54

  6. I just rooted/updated my G1 this weekend as well. Recovery Flasher is an excellent app. It makes the rooting procedure so much easier. I really like the Cyanogen image. that first boot concerned me a lot. after waiting 5 minutes I just put the phone down and browsed the web for a while. when I came back later it was done. I followed it up with an install of bash, the Debian on Android image, and running LXDE over VNC. The Debian install is really just a chrooted Debian environment running under Android so all the Android functionality remains. I found the best terminal emulator is ConnectBot which is an SSH client that supports local connections, but it really handles console use well including some nice keyboard remappings. I’m currently working on getting nano to look better on the screen and create some scripts to reduce manual setup.

    Ted Kotz

    August 24, 2009 at 20:07

  7. Running fix_permissions should help in those cases, either from the recovery console, or in safe mode (never tried that, though, supposed to start when pressing ‘menu’while powering on)

    Bernd Zeimetz

    August 24, 2009 at 23:46

  8. Matt, what do you mean when you say “I copied off the /data directory from the phone”? I used `fastboot erase userdata` but I still get the rebooting error. Can you tell me exactly what commands you used to “wipe” your settings?



    November 16, 2009 at 20:54

    • I meant literally, I copied the directory tree at /data. I don’t recall exactly how I did it; perhaps by copying it to the SD card?

      Matt Zimmerman

      November 29, 2009 at 15:56

Comments are closed.

%d bloggers like this: