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 android.os.Parcel;
     20 import android.os.Parcelable;
     21 
     22 /** @hide  */
     23 public class PresServiceInfo implements Parcelable {
     24 
     25     /** Presence Service Information
     26      *  @hide
     27      */
     28 
     29     /** No media capability. */
     30     public static final int UCE_PRES_MEDIA_CAP_NONE = 0;
     31     /** Full duplex audio only. */
     32     public static final int UCE_PRES_MEDIA_CAP_FULL_AUDIO_ONLY = 1;
     33     /** Full duplex audio and video. */
     34     public static final int UCE_PRES_MEDIA_CAP_FULL_AUDIO_AND_VIDEO = 2;
     35     /** Media cap is unknown. */
     36     public static final int UCE_PRES_MEDIA_CAP_UNKNOWN = 3;
     37 
     38 
     39     private int mMediaCap = UCE_PRES_MEDIA_CAP_NONE;
     40     private String mServiceID = "";
     41     private String mServiceDesc = "";
     42     private String mServiceVer = "";
     43 
     44     /**
     45      * Gets the media type.
     46      * @hide
     47      */
     48     public int getMediaType() {
     49         return mMediaCap;
     50     }
     51 
     52     /**
     53      * Sets the media type.
     54      * @hide
     55      */
     56     public void setMediaType(int nMediaCap) {
     57         this.mMediaCap = nMediaCap;
     58     }
     59 
     60     /**
     61      * Gets the service ID.
     62      * @hide
     63      */
     64     public String getServiceId() {
     65         return mServiceID;
     66     }
     67 
     68     /**
     69      * Sets the service ID.
     70      * @hide
     71      */
     72     public void setServiceId(String serviceID) {
     73         this.mServiceID = serviceID;
     74     }
     75     /**
     76      * Gets the service description.
     77      * @hide
     78      */
     79     public String getServiceDesc() {
     80         return mServiceDesc;
     81     }
     82 
     83     /**
     84      * Sets the service description.
     85      * @hide
     86      */
     87     public void setServiceDesc(String serviceDesc) {
     88         this.mServiceDesc = serviceDesc;
     89     }
     90 
     91     /**
     92      * Gets the service version.
     93      * @hide
     94      */
     95     public String getServiceVer() {
     96         return mServiceVer;
     97     }
     98 
     99     /**
    100      * Sets the service version.
    101      * @hide
    102      */
    103     public void setServiceVer(String serviceVer) {
    104         this.mServiceVer = serviceVer;
    105     }
    106 
    107     /**
    108      * Constructor for the PresServiceInfo class.
    109      * @hide
    110      */
    111     public PresServiceInfo() {};
    112 
    113 
    114     /** @hide */
    115     public int describeContents() {
    116         return 0;
    117     }
    118 
    119     /** @hide */
    120     public void writeToParcel(Parcel dest, int flags) {
    121         dest.writeString(mServiceID);
    122         dest.writeString(mServiceDesc);
    123         dest.writeString(mServiceVer);
    124         dest.writeInt(mMediaCap);
    125     }
    126 
    127     /** @hide */
    128     public static final Parcelable.Creator<PresServiceInfo> CREATOR =
    129                                 new Parcelable.Creator<PresServiceInfo>() {
    130 
    131         public PresServiceInfo createFromParcel(Parcel source) {
    132             return new PresServiceInfo(source);
    133         }
    134 
    135         public PresServiceInfo[] newArray(int size) {
    136             return new PresServiceInfo[size];
    137         }
    138     };
    139 
    140     /** @hide */
    141     private PresServiceInfo(Parcel source) {
    142         readFromParcel(source);
    143     }
    144 
    145     /** @hide */
    146     public void readFromParcel(Parcel source) {
    147         mServiceID = source.readString();
    148         mServiceDesc = source.readString();
    149         mServiceVer = source.readString();
    150         mMediaCap = source.readInt();
    151     }
    152 }