1 /*
2  * Copyright (C) 2023 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 com.android.settings.connecteddevice.audiosharing;
18 
19 import android.os.Parcel;
20 import android.os.Parcelable;
21 
22 public final class AudioSharingDeviceItem implements Parcelable {
23     private final String mName;
24     private final int mGroupId;
25     private final boolean mIsActive;
26 
AudioSharingDeviceItem(String name, int groupId, boolean isActive)27     public AudioSharingDeviceItem(String name, int groupId, boolean isActive) {
28         mName = name;
29         mGroupId = groupId;
30         mIsActive = isActive;
31     }
32 
getName()33     public String getName() {
34         return mName;
35     }
36 
getGroupId()37     public int getGroupId() {
38         return mGroupId;
39     }
40 
isActive()41     public boolean isActive() {
42         return mIsActive;
43     }
44 
AudioSharingDeviceItem(Parcel in)45     public AudioSharingDeviceItem(Parcel in) {
46         mName = in.readString();
47         mGroupId = in.readInt();
48         mIsActive = in.readBoolean();
49     }
50 
51     @Override
writeToParcel(Parcel dest, int flags)52     public void writeToParcel(Parcel dest, int flags) {
53         dest.writeString(mName);
54         dest.writeInt(mGroupId);
55         dest.writeBoolean(mIsActive);
56     }
57 
58     @Override
describeContents()59     public int describeContents() {
60         return 0;
61     }
62 
63     public static final Creator<AudioSharingDeviceItem> CREATOR =
64             new Creator<AudioSharingDeviceItem>() {
65                 @Override
66                 public AudioSharingDeviceItem createFromParcel(Parcel in) {
67                     return new AudioSharingDeviceItem(in);
68                 }
69 
70                 @Override
71                 public AudioSharingDeviceItem[] newArray(int size) {
72                     return new AudioSharingDeviceItem[size];
73                 }
74             };
75 }
76