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