BatteryManager.java revision f013e1afd1e68af5e3b868c26a653bbfb39538f8
1/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.os;
18
19/**
20 * The BatteryManager class contains strings and constants used for values
21 * in the ACTION_BATTERY_CHANGED Intent.
22 */
23public class BatteryManager {
24
25    // values for "status" field in the ACTION_BATTERY_CHANGED Intent
26    public static final int BATTERY_STATUS_UNKNOWN = 1;
27    public static final int BATTERY_STATUS_CHARGING = 2;
28    public static final int BATTERY_STATUS_DISCHARGING = 3;
29    public static final int BATTERY_STATUS_NOT_CHARGING = 4;
30    public static final int BATTERY_STATUS_FULL = 5;
31
32    // values for "health" field in the ACTION_BATTERY_CHANGED Intent
33    public static final int BATTERY_HEALTH_UNKNOWN = 1;
34    public static final int BATTERY_HEALTH_GOOD = 2;
35    public static final int BATTERY_HEALTH_OVERHEAT = 3;
36    public static final int BATTERY_HEALTH_DEAD = 4;
37    public static final int BATTERY_HEALTH_OVER_VOLTAGE = 5;
38    public static final int BATTERY_HEALTH_UNSPECIFIED_FAILURE = 6;
39
40    // values of the "plugged" field in the ACTION_BATTERY_CHANGED intent.
41    // These must be powers of 2.
42    /** Power source is an AC charger. */
43    public static final int BATTERY_PLUGGED_AC = 1;
44    /** Power source is a USB port. */
45    public static final int BATTERY_PLUGGED_USB = 2;
46}
47