1cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor/*
2cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * Copyright (C) 2013 The Android Open Source Project
3cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor *
4cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * Licensed under the Apache License, Version 2.0 (the "License");
5cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * you may not use this file except in compliance with the License.
6cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * You may obtain a copy of the License at
7cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor *
8cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor *      http://www.apache.org/licenses/LICENSE-2.0
9cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor *
10cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * Unless required by applicable law or agreed to in writing, software
11cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * distributed under the License is distributed on an "AS IS" BASIS,
12cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * See the License for the specific language governing permissions and
14cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * limitations under the License.
15cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor */
16cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor
17cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor#include <stdint.h>
18cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor#include <sys/types.h>
19cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor#include <batteryservice/BatteryService.h>
20cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor#include <binder/Parcel.h>
21cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor#include <utils/Errors.h>
22cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor
23cf8087358658d393150c383b01feef9064a4cdfcTodd Poynornamespace android {
24cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor
25cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor/*
26cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * Parcel read/write code must be kept in sync with
27cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor * frameworks/base/core/java/android/os/BatteryProperty.java
28cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor */
29cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor
30cf8087358658d393150c383b01feef9064a4cdfcTodd Poynorstatus_t BatteryProperty::readFromParcel(Parcel* p) {
31a186e65368719a2f47b357be50d4ccf61501fe9bTodd Poynor    valueInt64 = p->readInt64();
32cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor    return OK;
33cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor}
34cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor
35cf8087358658d393150c383b01feef9064a4cdfcTodd Poynorstatus_t BatteryProperty::writeToParcel(Parcel* p) const {
36a186e65368719a2f47b357be50d4ccf61501fe9bTodd Poynor    p->writeInt64(valueInt64);
37cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor    return OK;
38cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor}
39cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor
40cf8087358658d393150c383b01feef9064a4cdfcTodd Poynor}; // namespace android
41