diff options
author | Dianne Hackborn <hackbod@google.com> | 2014-04-23 17:14:15 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2014-04-24 12:05:51 -0700 |
commit | 0be7598cb8c8cf6808b336204632615c5f26298f (patch) | |
tree | b988c408771c6dc023800e7ec47f94ef1af48cc3 /src/com/android/settings/fuelgauge/BatteryHistoryPreference.java | |
parent | 4f700a3b3cfc66bccff1228e750c880706e647fa (diff) | |
download | packages_apps_Settings-0be7598cb8c8cf6808b336204632615c5f26298f.tar.gz packages_apps_Settings-0be7598cb8c8cf6808b336204632615c5f26298f.tar.bz2 packages_apps_Settings-0be7598cb8c8cf6808b336204632615c5f26298f.zip |
Show time remaining / to charge.
Rework the battery graph to include the time remaining or
time to charge.
Change-Id: Ib26b761cb10e01f5f3aa4189db10d44b8ce62f89
Diffstat (limited to 'src/com/android/settings/fuelgauge/BatteryHistoryPreference.java')
-rw-r--r-- | src/com/android/settings/fuelgauge/BatteryHistoryPreference.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java b/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java index 4579db7d8..bdea852d8 100644 --- a/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java +++ b/src/com/android/settings/fuelgauge/BatteryHistoryPreference.java @@ -17,6 +17,7 @@ package com.android.settings.fuelgauge; import android.content.Context; +import android.content.Intent; import android.graphics.drawable.Drawable; import android.os.BatteryStats; import android.preference.Preference; @@ -33,12 +34,14 @@ import com.android.settings.R; */ public class BatteryHistoryPreference extends Preference { - private BatteryStats mStats; + final private BatteryStats mStats; + final private Intent mBatteryBroadcast; - public BatteryHistoryPreference(Context context, BatteryStats stats) { + public BatteryHistoryPreference(Context context, BatteryStats stats, Intent batteryBroadcast) { super(context); setLayoutResource(R.layout.preference_batteryhistory); mStats = stats; + mBatteryBroadcast = batteryBroadcast; } BatteryStats getStats() { @@ -51,6 +54,6 @@ public class BatteryHistoryPreference extends Preference { BatteryHistoryChart chart = (BatteryHistoryChart)view.findViewById( R.id.battery_history_chart); - chart.setStats(mStats); + chart.setStats(mStats, mBatteryBroadcast); } } |