1 /* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 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 16 #ifndef BLUETOOTH_PARCEL_A2DP_A2DPCODECSTATUS_H 17 #define BLUETOOTH_PARCEL_A2DP_A2DPCODECSTATUS_H 18 19 #include "a2dp_parcel_codec.h" 20 #include "bluetooth_a2dp_a2dpCodecInfo.h" 21 #include "parcel.h" 22 23 namespace OHOS { 24 namespace Bluetooth { 25 class BluetoothA2dpCodecStatus : public Parcelable, 26 public ::bluetooth::CodecStatus { 27 public: 28 BluetoothA2dpCodecStatus() = default; BluetoothA2dpCodecStatus(const::bluetooth::CodecStatus & other)29 BluetoothA2dpCodecStatus(const ::bluetooth::CodecStatus& other) 30 : ::bluetooth::CodecStatus(other) {} // NOLINT(implicit) BluetoothA2dpCodecStatus(const BluetoothA2dpCodecStatus & other)31 BluetoothA2dpCodecStatus(const BluetoothA2dpCodecStatus& other) 32 : ::bluetooth::CodecStatus(other) {} // NOLINT(implicit) 33 ~BluetoothA2dpCodecStatus() = default; 34 35 bool Marshalling(Parcel &parcel) const override; 36 37 static BluetoothA2dpCodecStatus *Unmarshalling(Parcel &parcel); 38 39 bool WriteToParcel(Parcel &parcel); 40 bool ReadFromParcel(Parcel &parcel); 41 private: 42 bool WriteParcelableCodecVector(const std::vector<BluetoothA2dpCodecInfo> &localCodecInfo, Parcel &parcel) const; 43 bool ReadParcelableVector(const std::vector<BluetoothA2dpCodecInfo> &localCodecInfo, Parcel &parcel) const; 44 }; 45 46 } // namespace bluetooth 47 } // namespace OHOS 48 49 #endif // BLUETOOTH_PARCEL_A2DP_A2DPCODECSTATUS_H