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

Commit 0e113d98 authored by Jenny Ho's avatar Jenny Ho Committed by Automerger Merge Worker
Browse files

Merge "BatteryManager: update capacity level description" into main am: a591af02

parents 5d992e24 a591af02
Loading
Loading
Loading
Loading
+49 −35
Original line number Diff line number Diff line
@@ -167,75 +167,89 @@ public class BatteryManager {
    public static final String EXTRA_CHARGING_STATUS = "android.os.extra.CHARGING_STATUS";

    /**
     * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}:
     * Int value representing the battery's capacity level. These constants are key indicators of
     * battery status and system capabilities, guiding power management decisions for both the
     * system and apps:
     * {@link #BATTERY_CAPACITY_LEVEL_UNSUPPORTED}: Feature not supported on this device.
     * {@link #BATTERY_CAPACITY_LEVEL_UNKNOWN}: Battery status is unavailable or uninitialized.
     * {@link #BATTERY_CAPACITY_LEVEL_CRITICAL}: Battery is critically low and the Android
     * framework has been notified to schedule a shutdown by this value
     * {@link #BATTERY_CAPACITY_LEVEL_LOW}: Android framework must limit background jobs to
     * avoid impacting charging speed
     * {@link #BATTERY_CAPACITY_LEVEL_NORMAL}: Battery level and charging rates are normal,
     * battery temperature is within normal range and adapter power is enough to charge the
     * battery at an acceptable rate. Android framework can run light background tasks without
     * affecting charging performance severely.
     * {@link #BATTERY_CAPACITY_LEVEL_HIGH}: Battery level is high, battery temperature is
     * within normal range and adapter power is enough to charge the battery at an acceptable
     * rate while running background loads. Android framework can run background tasks without
     * affecting charging or battery performance.
     * {@link #BATTERY_CAPACITY_LEVEL_FULL}: The battery is full, battery temperature is
     * within normal range and adapter power is enough to sustain running background loads.
     * Android framework can run background tasks without affecting the battery level or
     * battery performance.
     */

    @FlaggedApi(FLAG_BATTERY_PART_STATUS_API)
    public static final String EXTRA_CAPACITY_LEVEL = "android.os.extra.CAPACITY_LEVEL";

    /**
     * Battery capacity level is unsupported. @see EXTRA_CAPACITY_LEVEL
     * Battery capacity level is unsupported.
     *
     * @see #EXTRA_CAPACITY_LEVEL
     */
    @FlaggedApi(FLAG_BATTERY_PART_STATUS_API)
    public static final int BATTERY_CAPACITY_LEVEL_UNSUPPORTED = -1;

    /**
     * Battery capacity level is unknown. @see EXTRA_CAPACITY_LEVEL
     * Battery capacity level is unknown.
     *
     * @see #EXTRA_CAPACITY_LEVEL
     */
    @FlaggedApi(FLAG_BATTERY_PART_STATUS_API)
    public static final int BATTERY_CAPACITY_LEVEL_UNKNOWN = 0;

    /**
     * Battery capacity level is critical. @see EXTRA_CAPACITY_LEVEL
     * Battery capacity level is critical. The Android framework has been notified to schedule
     * a shutdown by this value.
     *
     * @see #EXTRA_CAPACITY_LEVEL
     */
    @FlaggedApi(FLAG_BATTERY_PART_STATUS_API)
    public static final int BATTERY_CAPACITY_LEVEL_CRITICAL = 1;

    /**
     * Battery capacity level is low. @see EXTRA_CAPACITY_LEVEL
     * Battery capacity level is low. The Android framework must limit background jobs to avoid
     * impacting charging speed.
     *
     * @see #EXTRA_CAPACITY_LEVEL
     */
    @FlaggedApi(FLAG_BATTERY_PART_STATUS_API)
    public static final int BATTERY_CAPACITY_LEVEL_LOW = 2;

    /**
     * Battery capacity level is normal. @see EXTRA_CAPACITY_LEVEL
     * Battery capacity level is normal. Battery level and charging rates are normal, battery
     * temperature is within the normal range, and adapter power is enough to charge the battery
     * at an acceptable rate. The Android framework can run light background tasks without
     * affecting charging performance severely.
     *
     * @see #EXTRA_CAPACITY_LEVEL
     */
    @FlaggedApi(FLAG_BATTERY_PART_STATUS_API)
    public static final int BATTERY_CAPACITY_LEVEL_NORMAL = 3;

    /**
     * Battery capacity level is high. @see EXTRA_CAPACITY_LEVEL
     * Battery capacity level is high. Battery level is high, battery temperature is within the
     * normal range, and adapter power is enough to charge the battery at an acceptable rate
     * while running background loads. The Android framework can run background tasks without
     * affecting charging or battery performance.
     *
     * @see #EXTRA_CAPACITY_LEVEL
     */
    @FlaggedApi(FLAG_BATTERY_PART_STATUS_API)
    public static final int BATTERY_CAPACITY_LEVEL_HIGH = 4;

    /**
     * Battery capacity level is full. @see EXTRA_CAPACITY_LEVEL
     * Battery capacity level is full. The battery is full, the battery temperature is within the
     * normal range, and adapter power is enough to sustain running background loads. The Android
     * framework can run background tasks without affecting the battery level or battery
     * performance.
     *
     * @see #EXTRA_CAPACITY_LEVEL
     */
    @FlaggedApi(FLAG_BATTERY_PART_STATUS_API)
    public static final int BATTERY_CAPACITY_LEVEL_FULL = 5;

    /**
     * Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}:
     * Int value representing the battery's capacity level. These constants are key indicators of
     * battery status and system capabilities, guiding power management decisions for both the
     * system and apps.
     *
     * @see #BATTERY_CAPACITY_LEVEL_UNSUPPORTED
     * @see #BATTERY_CAPACITY_LEVEL_UNKNOWN
     * @see #BATTERY_CAPACITY_LEVEL_CRITICAL
     * @see #BATTERY_CAPACITY_LEVEL_LOW
     * @see #BATTERY_CAPACITY_LEVEL_NORMAL
     * @see #BATTERY_CAPACITY_LEVEL_HIGH
     * @see #BATTERY_CAPACITY_LEVEL_FULL
     */
    @FlaggedApi(FLAG_BATTERY_PART_STATUS_API)
    public static final String EXTRA_CAPACITY_LEVEL = "android.os.extra.CAPACITY_LEVEL";

    /**
     * Extra for {@link android.content.Intent#ACTION_BATTERY_LEVEL_CHANGED}:
     * Contains list of Bundles representing battery events