1 /* 2 * Copyright (C) 2020 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 17 #include "CarPowerPolicyFilter.h" 18 19 #include <binder/Parcel.h> 20 21 namespace android { 22 namespace car { 23 namespace hardware { 24 namespace power { 25 26 using android::Parcel; 27 using android::status_t; 28 CarPowerPolicyFilter(const std::vector<int32_t> & components)29CarPowerPolicyFilter::CarPowerPolicyFilter(const std::vector<int32_t>& components) : 30 mComponents(components) {} 31 writeToParcel(Parcel * parcel) const32status_t CarPowerPolicyFilter::writeToParcel(Parcel* parcel) const { 33 return parcel->writeInt32Vector(mComponents); 34 } 35 readFromParcel(const Parcel * parcel)36status_t CarPowerPolicyFilter::readFromParcel(const Parcel* parcel) { 37 return parcel->readInt32Vector(&mComponents); 38 } 39 40 } // namespace power 41 } // namespace hardware 42 } // namespace car 43 } // namespace android 44