• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 //  Copyright (C) 2017 Google, Inc.
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 
17 #include "android/bluetooth/bluetooth_avrcp_int_value.h"
18 
19 #include <utils/String16.h>
20 #include <utils/String8.h>
21 
22 using android::OK;
23 using android::String16;
24 using android::String8;
25 
26 namespace android {
27 namespace bluetooth {
28 
writeToParcel(Parcel * parcel) const29 status_t BluetoothAvrcpIntValue::writeToParcel(Parcel* parcel) const {
30   status_t status = parcel->writeInt32(id_);
31   if (status != OK) return status;
32 
33   status = parcel->writeInt32(value_);
34   if (status != OK) return status;
35 
36   return status;
37 }
38 
readFromParcel(const Parcel * parcel)39 status_t BluetoothAvrcpIntValue::readFromParcel(const Parcel* parcel) {
40   int32_t tmp;
41   status_t status = parcel->readInt32(&tmp);
42   if (status != OK) return status;
43   id_ = tmp;
44 
45   status = parcel->readInt32(&tmp);
46   if (status != OK) return status;
47   value_ = tmp;
48 
49   return status;
50 }
51 
52 }  // namespace bluetooth
53 }  // namespace android
54