OptionsCmdStatus.java revision cfedd20d54687449bb6a6982085003cbf9a22bcb
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
17package com.android.ims.internal.uce.options;
18
19import com.android.ims.internal.uce.common.StatusCode;
20import com.android.ims.internal.uce.common.CapInfo;
21
22import android.os.Parcel;
23import android.os.Parcelable;
24
25/** @hide  */
26public class OptionsCmdStatus implements Parcelable {
27
28    private OptionsCmdId mCmdId;
29    private StatusCode mStatus;
30    private int mUserData;
31    private CapInfo mCapInfo;
32
33    /**
34     * Gets the UCE command ID.
35     * @hide
36     */
37    public OptionsCmdId getCmdId() {
38        return mCmdId;
39    }
40    /**
41     * Sets the command ID.
42     * @hide
43     */
44    public void setCmdId(OptionsCmdId cmdId) {
45        this.mCmdId = cmdId;
46    }
47
48    /**
49     * Gets the user data.
50     * @hide
51     */
52    public int getUserData() {
53        return mUserData;
54    }
55
56    /**
57       Sets the user data.
58       @hide  */
59    public void setUserData(int userData) {
60        this.mUserData = userData;
61    }
62
63    /**
64     * Gets the status code.
65     * @hide
66     */
67    public StatusCode getStatus() {
68        return mStatus;
69    }
70
71    /**
72     * Sets the status code.
73     * @hide
74     */
75    public void setStatus(StatusCode status) {
76        this.mStatus = status;
77    }
78
79    /**
80     * Constructor for the OptionsCmdStatus class.
81     * @hide
82     */
83    public OptionsCmdStatus() {
84        mStatus = new StatusCode();
85        mCapInfo = new CapInfo();
86        mCmdId = new OptionsCmdId();
87        mUserData = 0;
88    };
89
90    /** @hide */
91    public CapInfo getCapInfo() {
92        return mCapInfo;
93    }
94
95    /**
96     * Sets the CapInfo
97     * @hide
98     */
99    public void setCapInfo(CapInfo capInfo) {
100        this.mCapInfo = capInfo;
101    }
102
103    /**
104     * Gets the instance of the OptionsCmdStatus class.
105     * @hide
106     */
107    public static OptionsCmdStatus getOptionsCmdStatusInstance() {
108        return new OptionsCmdStatus();
109    }
110
111    /** @hide */
112    public int describeContents() {
113        return 0;
114    }
115
116    /** @hide */
117    public void writeToParcel(Parcel dest, int flags) {
118        dest.writeInt(mUserData);
119        dest.writeParcelable(mCmdId, flags);
120        dest.writeParcelable(mStatus, flags);
121        dest.writeParcelable(mCapInfo, flags);
122    }
123
124    /** @hide */
125    public static final Parcelable.Creator<OptionsCmdStatus> CREATOR =
126                   new Parcelable.Creator<OptionsCmdStatus>() {
127        public OptionsCmdStatus createFromParcel(Parcel source) {
128            return new OptionsCmdStatus(source);
129        }
130        public OptionsCmdStatus[] newArray(int size) {
131            return new OptionsCmdStatus[size];
132        }
133    };
134
135    /** @hide */
136    private OptionsCmdStatus(Parcel source) {
137        readFromParcel(source);
138    }
139
140    /** @hide */
141    public void readFromParcel(Parcel source) {
142        mUserData = source.readInt();
143        mCmdId = source.readParcelable(OptionsCmdId.class.getClassLoader());
144        mStatus = source.readParcelable(StatusCode.class.getClassLoader());
145        mCapInfo = source.readParcelable(CapInfo.class.getClassLoader());
146    }
147}