Loading res/xml/power_usage_summary.xml +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ <com.android.settings.applications.LayoutPreference android:key="battery_header" android:selectable="true" android:selectable="false" android:layout="@layout/battery_header"/> <PreferenceCategory Loading src/com/android/settings/fuelgauge/PowerUsageSummary.java +2 −36 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ import java.util.List; * consumed since the last time it was unplugged. */ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickListener, OnClickListener, BatteryTipPreferenceController.BatteryTipListener { BatteryTipPreferenceController.BatteryTipListener { static final String TAG = "PowerUsageSummary"; Loading @@ -80,7 +80,6 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList private static final String KEY_APP_LIST = "app_list"; private static final String KEY_BATTERY_HEADER = "battery_header"; private static final String KEY_BATTERY_TIP = "battery_tip"; private static final String KEY_SHOW_ALL_APPS = "show_all_apps"; private static final String KEY_SCREEN_USAGE = "screen_usage"; private static final String KEY_TIME_SINCE_LAST_FULL_CHARGE = "last_full_charge"; Loading Loading @@ -224,15 +223,6 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList return MetricsEvent.FUELGAUGE_POWER_USAGE_SUMMARY_V2; } @Override public boolean onPreferenceTreeClick(Preference preference) { if (KEY_BATTERY_HEADER.equals(preference.getKey())) { performBatteryHeaderClick(); return true; } return super.onPreferenceTreeClick(preference); } @Override protected String getLogTag() { return TAG; Loading Loading @@ -311,22 +301,6 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList } } private void performBatteryHeaderClick() { if (mPowerFeatureProvider.isAdvancedUiEnabled()) { Utils.startWithFragment(getContext(), PowerUsageAdvanced.class.getName(), null, null, 0, R.string.advanced_battery_title, null, getMetricsCategory()); } else { mStatsHelper.storeStatsHistoryInFile(BatteryHistoryDetail.BATTERY_HISTORY_FILE); Bundle args = new Bundle(2); args.putString(BatteryHistoryDetail.EXTRA_STATS, BatteryHistoryDetail.BATTERY_HISTORY_FILE); args.putParcelable(BatteryHistoryDetail.EXTRA_BROADCAST, mStatsHelper.getBatteryBroadcast()); Utils.startWithFragment(getContext(), BatteryHistoryDetail.class.getName(), args, null, 0, R.string.history_details_title, null, getMetricsCategory()); } } protected void refreshUi() { final Context context = getContext(); if (context == null) { Loading Loading @@ -405,12 +379,9 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList getLoaderManager().restartLoader(BATTERY_INFO_LOADER, Bundle.EMPTY, mBatteryInfoLoaderCallbacks); if (mPowerFeatureProvider.isEstimateDebugEnabled()) { // Unfortunately setting a long click listener on a view means it will no // longer pass the regular click event to the parent, so we have to register // a regular click listener as well. // Set long click action for summary to show debug info View header = mBatteryLayoutPref.findViewById(R.id.summary1); header.setOnLongClickListener(this); header.setOnClickListener(this); } } Loading @@ -421,11 +392,6 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList return true; } @Override public void onClick(View view) { performBatteryHeaderClick(); } @Override protected void restartBatteryStatsLoader() { restartBatteryStatsLoader(true /* clearHeader */); Loading Loading
res/xml/power_usage_summary.xml +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ <com.android.settings.applications.LayoutPreference android:key="battery_header" android:selectable="true" android:selectable="false" android:layout="@layout/battery_header"/> <PreferenceCategory Loading
src/com/android/settings/fuelgauge/PowerUsageSummary.java +2 −36 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ import java.util.List; * consumed since the last time it was unplugged. */ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickListener, OnClickListener, BatteryTipPreferenceController.BatteryTipListener { BatteryTipPreferenceController.BatteryTipListener { static final String TAG = "PowerUsageSummary"; Loading @@ -80,7 +80,6 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList private static final String KEY_APP_LIST = "app_list"; private static final String KEY_BATTERY_HEADER = "battery_header"; private static final String KEY_BATTERY_TIP = "battery_tip"; private static final String KEY_SHOW_ALL_APPS = "show_all_apps"; private static final String KEY_SCREEN_USAGE = "screen_usage"; private static final String KEY_TIME_SINCE_LAST_FULL_CHARGE = "last_full_charge"; Loading Loading @@ -224,15 +223,6 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList return MetricsEvent.FUELGAUGE_POWER_USAGE_SUMMARY_V2; } @Override public boolean onPreferenceTreeClick(Preference preference) { if (KEY_BATTERY_HEADER.equals(preference.getKey())) { performBatteryHeaderClick(); return true; } return super.onPreferenceTreeClick(preference); } @Override protected String getLogTag() { return TAG; Loading Loading @@ -311,22 +301,6 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList } } private void performBatteryHeaderClick() { if (mPowerFeatureProvider.isAdvancedUiEnabled()) { Utils.startWithFragment(getContext(), PowerUsageAdvanced.class.getName(), null, null, 0, R.string.advanced_battery_title, null, getMetricsCategory()); } else { mStatsHelper.storeStatsHistoryInFile(BatteryHistoryDetail.BATTERY_HISTORY_FILE); Bundle args = new Bundle(2); args.putString(BatteryHistoryDetail.EXTRA_STATS, BatteryHistoryDetail.BATTERY_HISTORY_FILE); args.putParcelable(BatteryHistoryDetail.EXTRA_BROADCAST, mStatsHelper.getBatteryBroadcast()); Utils.startWithFragment(getContext(), BatteryHistoryDetail.class.getName(), args, null, 0, R.string.history_details_title, null, getMetricsCategory()); } } protected void refreshUi() { final Context context = getContext(); if (context == null) { Loading Loading @@ -405,12 +379,9 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList getLoaderManager().restartLoader(BATTERY_INFO_LOADER, Bundle.EMPTY, mBatteryInfoLoaderCallbacks); if (mPowerFeatureProvider.isEstimateDebugEnabled()) { // Unfortunately setting a long click listener on a view means it will no // longer pass the regular click event to the parent, so we have to register // a regular click listener as well. // Set long click action for summary to show debug info View header = mBatteryLayoutPref.findViewById(R.id.summary1); header.setOnLongClickListener(this); header.setOnClickListener(this); } } Loading @@ -421,11 +392,6 @@ public class PowerUsageSummary extends PowerUsageBase implements OnLongClickList return true; } @Override public void onClick(View view) { performBatteryHeaderClick(); } @Override protected void restartBatteryStatsLoader() { restartBatteryStatsLoader(true /* clearHeader */); Loading