OSDN Git Service

Play the low-battery sound only at certain discharge events.
authorDaniel Sandler <dsandler@google.com>
Tue, 26 Jul 2011 17:06:49 +0000 (13:06 -0400)
committerDaniel Sandler <dsandler@google.com>
Tue, 26 Jul 2011 17:06:49 +0000 (13:06 -0400)
commit7198662bb3c81a761fdfa3038d90df68d22c0b97
treee9e36d14655f3a2b79bec4c856fd2595b4f62be9
parentae65c17959042edd5f1b44e7653d1a775bbfceec
Play the low-battery sound only at certain discharge events.

That is, only play it when the device is running on battery
and the remaining charge level descends into a new
low-battery regime:

* when the device hits the first threshold, for example 15%
  (the dialog is first shown at this time)
* when the device hits the second threshold, e.g. 4% (the
  dialog will be redisplayed if necessary)
* when the device has been charging but AC power is removed,
  returning the device to a low-battery regime (the dialog
  will be redisplayed if necessary)

The sound will no longer be replayed as the battery level
descends within these regimes (say, 4% --> 3%).

Bug: 4981280
Change-Id: I049d60f39ae556241a23f8664e61be3d70d937e5
packages/SystemUI/src/com/android/systemui/power/PowerUI.java