Implements additional battery info menu behavior.
am: 8a49de31ab
Change-Id: I29a2a6032b02309ae9e966f517774f5ce1451c3b
This commit is contained in:
@@ -16,10 +16,20 @@
|
||||
|
||||
package com.android.settings.fuelgauge;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
/**
|
||||
* Feature Provider used in power usage
|
||||
*/
|
||||
public interface PowerUsageFeatureProvider {
|
||||
|
||||
/**
|
||||
* Check whether additional battery info feature is enabled.
|
||||
*/
|
||||
boolean isAdditionalBatteryInfoEnabled();
|
||||
|
||||
/**
|
||||
* Gets an {@link Intent} to show additional battery info.
|
||||
*/
|
||||
Intent getAdditionalBatteryInfoIntent();
|
||||
}
|
||||
|
@@ -175,6 +175,11 @@ public class PowerUsageSummary extends PowerUsageBase {
|
||||
sa.startPreferencePanel(ManageApplications.class.getName(), args,
|
||||
R.string.high_power_apps, null, null, 0);
|
||||
return true;
|
||||
case MENU_ADDITIONAL_BATTERY_INFO:
|
||||
startActivity(FeatureFactory.getFactory(getContext())
|
||||
.getPowerUsageFeatureProvider(getContext())
|
||||
.getAdditionalBatteryInfoIntent());
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
Reference in New Issue
Block a user