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 PresResInfo implements Parcelable { 24 25 private String mResUri = ""; 26 private String mDisplayName = ""; 27 private PresResInstanceInfo mInstanceInfo; 28 29 /** 30 * Gets the Presence service resource instance information. 31 * @hide 32 */ 33 public PresResInstanceInfo getInstanceInfo() { 34 return mInstanceInfo; 35 } 36 37 /** 38 * Sets the Presence service resource instance information. 39 * @hide 40 */ 41 public void setInstanceInfo(PresResInstanceInfo instanceInfo) { 42 this.mInstanceInfo = instanceInfo; 43 } 44 45 /** 46 * Gets the resource URI. 47 * @hide 48 */ 49 public String getResUri() { 50 return mResUri; 51 } 52 53 /** 54 * Sets the resource URI. 55 * @hide 56 */ 57 public void setResUri(String resUri) { 58 this.mResUri = resUri; 59 } 60 61 /** 62 * Gets the display name. 63 * @hide 64 */ 65 public String getDisplayName() { 66 return mDisplayName; 67 } 68 69 /** 70 * Sets the display name. 71 * @hide 72 */ 73 public void setDisplayName(String displayName) { 74 this.mDisplayName = displayName; 75 } 76 77 78 /** 79 * Constructor for the PresResInstanceInfo class. 80 * @hide 81 */ 82 public PresResInfo() { 83 mInstanceInfo = new PresResInstanceInfo(); 84 }; 85 86 /** @hide */ 87 public int describeContents() { 88 return 0; 89 } 90 91 /** @hide */ 92 public void writeToParcel(Parcel dest, int flags) { 93 dest.writeString(mResUri); 94 dest.writeString(mDisplayName); 95 dest.writeParcelable(mInstanceInfo, flags); 96 } 97 98 /** @hide */ 99 public static final Parcelable.Creator<PresResInfo> CREATOR = 100 new Parcelable.Creator<PresResInfo>() { 101 public PresResInfo createFromParcel(Parcel source) { 102 return new PresResInfo(source); 103 } 104 105 public PresResInfo[] newArray(int size) { 106 return new PresResInfo[size]; 107 } 108 }; 109 110 /** @hide */ 111 private PresResInfo(Parcel source) { 112 readFromParcel(source); 113 } 114 115 /** @hide */ 116 public void readFromParcel(Parcel source) { 117 mResUri = source.readString(); 118 mDisplayName = source.readString(); 119 mInstanceInfo = source.readParcelable(PresResInstanceInfo.class.getClassLoader()); 120 } 121 }