1 /* 2 * Copyright (c) 2016 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.ims.internal.uce.options; 18 19 import android.os.Parcel; 20 import android.os.Parcelable; 21 22 23 /** @hide */ 24 public class OptionsSipResponse implements Parcelable { 25 26 private OptionsCmdId mCmdId; 27 private int mRequestId = 0; 28 private int mSipResponseCode = 0; 29 private int mRetryAfter = 0; 30 private String mReasonPhrase = ""; 31 32 /** 33 * Gets the Options command ID. 34 * @hide 35 */ 36 public OptionsCmdId getCmdId() { 37 return mCmdId; 38 } 39 40 /** 41 * Sets the Options command ID. 42 * @hide 43 */ 44 public void setCmdId(OptionsCmdId cmdId) { 45 this.mCmdId = cmdId; 46 } 47 48 /** 49 * Gets the request ID 50 * @hide 51 */ 52 public int getRequestId() { 53 return mRequestId; 54 } 55 56 /** 57 * Sets the request ID 58 * @hide 59 */ 60 public void setRequestId(int requestId) { 61 this.mRequestId = requestId; 62 } 63 64 /** 65 * Gets the SIP response code. 66 * @hide 67 */ 68 public int getSipResponseCode() { 69 return mSipResponseCode; 70 } 71 72 /** 73 * Sets the SIP response code. 74 * @hide 75 */ 76 public void setSipResponseCode(int sipResponseCode) { 77 this.mSipResponseCode = sipResponseCode; 78 } 79 80 /** 81 * Gets the reason phrase associated with the SIP responce code. 82 * @hide 83 */ 84 public String getReasonPhrase() { 85 return mReasonPhrase; 86 } 87 88 /** 89 * Sets the SIP response code reason phrase. 90 * @hide 91 */ 92 public void setReasonPhrase(String reasonPhrase) { 93 this.mReasonPhrase = reasonPhrase; 94 } 95 96 /** 97 * Gets the SIP retryAfter sec value . 98 * @hide 99 */ 100 public int getRetryAfter() { 101 return mRetryAfter; 102 } 103 104 /** 105 * Sets the SIP retryAfter sec value 106 * @hide 107 */ 108 public void setRetryAfter(int retryAfter) { 109 this.mRetryAfter = retryAfter; 110 } 111 112 /** 113 * Constructor for the OptionsSipResponse class. 114 * @hide 115 */ 116 public OptionsSipResponse() { 117 mCmdId = new OptionsCmdId(); 118 }; 119 120 /** @hide */ 121 public int describeContents() { 122 return 0; 123 } 124 125 /** @hide */ 126 public void writeToParcel(Parcel dest, int flags) { 127 128 dest.writeInt(mRequestId); 129 dest.writeInt(mSipResponseCode); 130 dest.writeString(mReasonPhrase); 131 dest.writeParcelable(mCmdId, flags); 132 dest.writeInt(mRetryAfter); 133 } 134 135 /** @hide */ 136 public static final Parcelable.Creator<OptionsSipResponse> CREATOR = 137 new Parcelable.Creator<OptionsSipResponse>() { 138 public OptionsSipResponse createFromParcel(Parcel source) { 139 return new OptionsSipResponse(source); 140 } 141 142 public OptionsSipResponse[] newArray(int size) { 143 return new OptionsSipResponse[size]; 144 } 145 }; 146 147 /** @hide */ 148 private OptionsSipResponse(Parcel source) { 149 readFromParcel(source); 150 } 151 152 /** @hide */ 153 public void readFromParcel(Parcel source) { 154 mRequestId = source.readInt(); 155 mSipResponseCode = source.readInt(); 156 mReasonPhrase = source.readString(); 157 mCmdId = source.readParcelable(OptionsCmdId.class.getClassLoader()); 158 mRetryAfter = source.readInt(); 159 } 160 } 161