Re: [Tracker] Migrating tracker from HAL to DeviceKit



Hi richard,

ïTracker does indeed use HAL for power management and for detecting
removable storage

As HAL support is optional (not all platforms have HAL like solaris) it
would probably make sense to switch to a raw dbus solution 

the only sang at this stage is which distro's use Device kit? I dont
believe jaunty uses it?

Ergo at this point in time, it might be best to see if device-kit is
activated on dbus and use it if its there else fallback to HAL.

In the long run we can then remove HAL support

martyn, do you agree?

jamie


On Wed, 2009-04-01 at 14:23 +0100, Richard Hughes wrote:
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


_______________________________________________
tracker-list mailing list
tracker-list gnome org
http://mail.gnome.org/mailman/listinfo/tracker-list




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