Google's Android has won partial re-admission to the Linux kernel, but much work lies ahead for a full re-entry.
Code written by Linux kernel maintainer Rafael Wysocki has been adopted in the kernel tree that re-implements Android's wake locks feature — to stop a device from completely shutting down — in what has been called a "socially acceptable way".
Wysocki's was one of three options that kernel maintainers had given Google to get Android's code re-admitted to the kernel tree. It sounds like Google has picked Wysocki's re-implementation of its APIs instead of going with the other two.
Matthew Garrett, a Linux kernel developer at Red Hat and a specialist in power consumption, told attendees of LinuxCon 2010 in Boston, Massachusetts, that Wysocki's implementation of wake locks is "more minimal" than Google's effort.
Apparently Google's wake locks had tried to gather stats from applications running on an Android phone so the device could tell the user precisely what applications were still awake and running when the phone should be asleep — to help conserve battery life.
Wake locks were introduced by Google to the Android Linux code as a way to stop an Android phone from completely shutting down. The idea is that an application on the phone could still run in the background, and that the phone's user could still receive incoming calls.
Garrett pointed out that while this Android feature is now part of the main Linux kernel tree, you still can't run Android using the kernel — although you can run the kernel on an Android.
He warned that full integration between the two is likely someway off.
"I'd love for us to be able to hook Android on the main kernel," he said at LinuxCon.
"I'd like to see us get to a point where, in a worst-case scenario, the Android kernel is in the mainline kernel with some extra bits of code added and we are compatible. But there are far too many people involved, a lot of code that needs to be written, and a lot of discussion that needs to take place."
Garrett also made it clear that Google had fumbled the whole subject of getting wake locks added to the main kernel. Last December, kernel maintainer Greg Kroah-Hartman booted the Android APIs from the main Linux kernel tree arguing that "nobody" cared about the code.
What appears to have transpired, though, is kernel maintainers didn't accept or see the point of wake locks.
While accepting blame on behalf of the kernel maintainer community, Garrett said Google had not clearly explained the reason behind wake locks — or another new feature called early suspend — in their earliest submission, or why they should be merged with the main kernel.
Google didn't "seem interested" in getting code into the mainline while "various people were unhappy with the wake lock design."
Garrett also faulted Google for conflating wake locks and early suspend, while saying that to many of the Linux kernel's maintainers it seemed the kernel already contained the features needed to deal with the problems Google said it was trying to solve in the area of power management.
The upshot was there were a lot of arguments in mail threads and people took defensive positions.
"We ended up with people in entrenched positions because you were rude to their mother — and by mother I mean their preferred power management solution," Garrett said.
One plus from the episode: there have been more discussions about how to solve the problem of poorly behaved applications in Linux — even on some non-Android devices. Garrett said the kernel team had learned from the discussions, but the process could have been quicker. ®