1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
|
/*
* Copyright (c) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.ims.internal.uce.presence;
import android.os.Parcel;
import android.os.Parcelable;
import java.util.Arrays;
/** @hide */
public class PresResInstanceInfo implements Parcelable{
/**
* UCE resource instance state definitions.
* @hide
*/
/** Active state. */
public static final int UCE_PRES_RES_INSTANCE_STATE_ACTIVE = 0;
/** Pending state. */
public static final int UCE_PRES_RES_INSTANCE_STATE_PENDING = 1;
/** Terminated state. */
public static final int UCE_PRES_RES_INSTANCE_STATE_TERMINATED = 2;
/** Unknown state. */
public static final int UCE_PRES_RES_INSTANCE_STATE_UNKNOWN = 3;
/** Unknown instance. */
public static final int UCE_PRES_RES_INSTANCE_UNKNOWN = 4;
private int mResInstanceState;
private String mId = "";
private String mReason = "";
private String mPresentityUri = "";
private PresTupleInfo mTupleInfoArray[];
/**
* Gets the resource instance state.
* @hide
*/
public int getResInstanceState() {
return mResInstanceState;
}
/**
* Sets the resource instance state.
* @hide
*/
public void setResInstanceState(int nResInstanceState) {
this.mResInstanceState = nResInstanceState;
}
/**
* Gets the resource ID.
* @hide
*/
public String getResId() {
return mId;
}
/**
* Sets the resource ID.
* @hide
*/
public void setResId(String resourceId) {
this.mId = resourceId;
}
/**
* Gets the reason phrase associated with the SIP response
* code.
* @hide
*/
public String getReason() {
return mReason;
}
/**
* Sets the reason phrase associated with the SIP response
* code.
* @hide
*/
public void setReason(String reason) {
this.mReason = reason;
}
/**
* Gets the entity URI.
* @hide
*/
public String getPresentityUri() {
return mPresentityUri;
}
/**
* Sets the entity URI.
* @hide
*/
public void setPresentityUri(String presentityUri) {
this.mPresentityUri = presentityUri;
}
/**
* Gets the tuple information.
* @hide
*/
public PresTupleInfo[] getTupleInfo() {
return mTupleInfoArray;
}
/**
* Sets the tuple information.
* @hide
*/
public void setTupleInfo(PresTupleInfo[] tupleInfo) {
this.mTupleInfoArray = new PresTupleInfo[tupleInfo.length];
this.mTupleInfoArray = tupleInfo;
}
/**
* Constructor for the PresResInstanceInfo class.
* @hide
*/
public PresResInstanceInfo(){
};
/** @hide */
public int describeContents() {
return 0;
}
/** @hide */
public void writeToParcel(Parcel dest, int flags) {
dest.writeString(mId);
dest.writeString(mReason);
dest.writeInt(mResInstanceState);
dest.writeString(mPresentityUri);
dest.writeParcelableArray(mTupleInfoArray, flags);
}
/** @hide */
public static final Parcelable.Creator<PresResInstanceInfo> CREATOR =
new Parcelable.Creator<PresResInstanceInfo>() {
public PresResInstanceInfo createFromParcel(Parcel source) {
return new PresResInstanceInfo(source);
}
public PresResInstanceInfo[] newArray(int size) {
return new PresResInstanceInfo[size];
}
};
/** @hide */
private PresResInstanceInfo(Parcel source) {
readFromParcel(source);
}
/** @hide */
public void readFromParcel(Parcel source) {
mId = source.readString();
mReason = source.readString();
mResInstanceState = source.readInt();
mPresentityUri = source.readString();
Parcelable[] tempParcelableArray = source.readParcelableArray(
PresTupleInfo.class.getClassLoader());
mTupleInfoArray = new PresTupleInfo[] {};
if(tempParcelableArray != null) {
mTupleInfoArray = Arrays.copyOf(tempParcelableArray, tempParcelableArray.length,
PresTupleInfo[].class);
}
}
}
|