[Tracker] Migrating tracker from HAL to DeviceKit



Hey list,

(some background, I'm a developer for HAL, and the maintainer of
DeviceKit-power, PackageKit and gnome-power-manager)

Some of you may already know, HAL is a dying beast upstream.
Unfortunately, it's a widely used[1] beast, and it's my job to try and
convert applications to DeviceKit-power and DeviceKit-disks so they
continue to work when bits of HAL slowly get switched off.

I've been reviewing the tracker source code, and there appears to be two
main points of HAL integration with tracker, the storage code and the
power management code.

Obviously the former can be migrated to DeviceKit-disks, and the latter
to DeviceKit-power. I'll concentrate on the latter for now.

I notice the code is set up to enumerate batteries and ac_adapters, and
to make a policy decision about whether a computer is on mains power
based on that. Unfortunately, it fails to filter non-primary batteries
and the charged logic seems very fragile. It also exports percentage and
exists data which seems to break pretty hard with multiple batteries, or
where batteries are not present, but exported to the system.

I assume you are making policy decisions based on the percentage and
battery discharging attributes. This is all handled much better in
DeviceKit-power, as it's been designed from the ground up for other
frameworks and applications to use, rather than just a bare device tree
with methods like HAL was.

In the interface spec[2] you can see there are two public properties
exposed over DBus:

'on-battery'     read      'b'
'on-low-battery' read      'b'

This has all the correct logic encoding in DeviceKit-power, so we don't
do things like set on-battery when we're running with a wireless-mouse
connected, or set on-low-battery when we've just inserted a second
battery at 0%.

So, would it be permissible to convert the HAL power management parts in
tracker to use DeviceKit-power? I would be willing to do the work, with
your permission. I can either use the new devkit-power-gobject library,
or just use plain dbus-glib. The advantage of the latter is that it
"just works" if tracker is being used on a system that does have support
for DeviceKit (e.g. < Fedora 10).

Thanks,

Richard Hughes

[1] http://fedoraproject.org/wiki/Features/DeviceKit/HalDependencies
[2] http://hal.freedesktop.org/docs/DeviceKit-power/Power.html





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]