blob: 346f5de733a5489aa067747b04181f18682db6a4 [file] [log] [blame]
Todd Poynord7b34772013-08-14 20:42:44 -07001/* Copyright 2013, The Android Open Source Project
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14*/
15
16package android.os;
17
18import android.os.Parcel;
19import android.os.Parcelable;
20
21/**
22 * {@hide}
23 */
24public class BatteryProperty implements Parcelable {
25 /*
26 * Battery property identifiers. These must match the values in
27 * frameworks/native/include/batteryservice/BatteryService.h
28 */
29 public static final int BATTERY_PROP_CHARGE_COUNTER = 1;
30 public static final int BATTERY_PROP_CURRENT_NOW = 2;
Todd Poynorbe7d9e32013-08-27 18:10:45 -070031 public static final int BATTERY_PROP_CURRENT_AVG = 3;
Todd Poynord7b34772013-08-14 20:42:44 -070032
33 public int valueInt;
34
35 public BatteryProperty() {
36 valueInt = Integer.MIN_VALUE;
37 }
38
39 /*
40 * Parcel read/write code must be kept in sync with
41 * frameworks/native/services/batteryservice/BatteryProperty.cpp
42 */
43
44 private BatteryProperty(Parcel p) {
45 readFromParcel(p);
46 }
47
48 public void readFromParcel(Parcel p) {
49 valueInt = p.readInt();
50 }
51
52 public void writeToParcel(Parcel p, int flags) {
53 p.writeInt(valueInt);
54 }
55
56 public static final Parcelable.Creator<BatteryProperty> CREATOR
57 = new Parcelable.Creator<BatteryProperty>() {
58 public BatteryProperty createFromParcel(Parcel p) {
59 return new BatteryProperty(p);
60 }
61
62 public BatteryProperty[] newArray(int size) {
63 return new BatteryProperty[size];
64 }
65 };
66
67 public int describeContents() {
68 return 0;
69 }
70}