aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Poynor2013-02-12 22:47:48 -0600
committerArve Hjønnevåg2013-02-19 19:56:22 -0600
commit4686ad1c8f13a7a042783e420f9d5f359f7f4c95 (patch)
treef7e0b97415dbe20ba6e0ee224c844b6f48de6d63
parent25b1c244dedc8cc744fd1186cb8c3cca558a73e8 (diff)
downloadkernel-common-4686ad1c8f13a7a042783e420f9d5f359f7f4c95.tar.gz
kernel-common-4686ad1c8f13a7a042783e420f9d5f359f7f4c95.tar.xz
kernel-common-4686ad1c8f13a7a042783e420f9d5f359f7f4c95.zip
power: android-battery: push uevent whenever charge source changes
Ensure userspace reads an up-to-date value for charging status whenever the charge source is updated. Avoid races where stale charging state may be reflected in userspace until the next battery state poll. Change-Id: Ia744db48584e9e9abf442710c279af9e3a25c079 Signed-off-by: Todd Poynor <toddpoynor@google.com>
-rw-r--r--drivers/power/android_battery.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/power/android_battery.c b/drivers/power/android_battery.c
index 6e8b4054c8d..8d45ff0f367 100644
--- a/drivers/power/android_battery.c
+++ b/drivers/power/android_battery.c
@@ -399,6 +399,7 @@ static void android_bat_charger_work(struct work_struct *work)
399 399
400 mutex_unlock(&android_bat_state_lock); 400 mutex_unlock(&android_bat_state_lock);
401 wake_lock_timeout(&battery->charger_wake_lock, HZ * 2); 401 wake_lock_timeout(&battery->charger_wake_lock, HZ * 2);
402 power_supply_changed(&battery->psy_bat);
402} 403}
403 404
404 405