Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a49de31 authored by Jaewoong Jung's avatar Jaewoong Jung
Browse files

Implements additional battery info menu behavior.

This is a manual cherry-pick of commit
6a43a06c.

Bug: 33352540
Test: Updated existing tests.
Change-Id: I990029d2ea9032301362d614959259965b8ecb10
parent bd775165
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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();
}
+5 −0
Original line number Diff line number Diff line
@@ -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);
        }