Home | History | Annotate | Download | only in vms
      1 /*
      2  * Copyright (C) 2017 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 package android.car.vms;
     18 
     19 import android.car.annotation.FutureFeature;
     20 import android.os.Parcel;
     21 import android.os.Parcelable;
     22 import java.util.ArrayList;
     23 import java.util.Collections;
     24 import java.util.List;
     25 
     26 /**
     27  * The state of dependencies for a single publisher.
     28  *
     29  * @hide
     30  */
     31 @FutureFeature
     32 public final class VmsLayersOffering implements Parcelable {
     33 
     34     private final List<VmsLayerDependency> mDependencies;
     35 
     36     public VmsLayersOffering(List<VmsLayerDependency> dependencies) {
     37         mDependencies = Collections.unmodifiableList(dependencies);
     38     }
     39 
     40     /**
     41      * Returns the dependencies.
     42      */
     43     public List<VmsLayerDependency> getDependencies() {
     44         return mDependencies;
     45     }
     46 
     47     public static final Parcelable.Creator<VmsLayersOffering> CREATOR = new
     48         Parcelable.Creator<VmsLayersOffering>() {
     49             public VmsLayersOffering createFromParcel(Parcel in) {
     50                 return new VmsLayersOffering(in);
     51             }
     52             public VmsLayersOffering[] newArray(int size) {
     53                 return new VmsLayersOffering[size];
     54             }
     55         };
     56 
     57     @Override
     58     public void writeToParcel(Parcel out, int flags) {
     59         out.writeParcelableList(mDependencies, flags);
     60     }
     61 
     62     @Override
     63     public int describeContents() {
     64         return 0;
     65     }
     66 
     67     private VmsLayersOffering(Parcel in) {
     68         List<VmsLayerDependency> dependencies = new ArrayList<>();
     69         in.readParcelableList(dependencies, VmsLayerDependency.class.getClassLoader());
     70         mDependencies = Collections.unmodifiableList(dependencies);
     71     }
     72 }