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.presence; 18 19import android.os.Parcel; 20import android.os.Parcelable; 21 22/** @hide */ 23public class PresSubscriptionState implements Parcelable { 24 25 /** 26 * Subscription states. 27 * @hide 28 */ 29 30 /** Active state. */ 31 public static final int UCE_PRES_SUBSCRIPTION_STATE_ACTIVE = 0; 32 /** Pending state. */ 33 public static final int UCE_PRES_SUBSCRIPTION_STATE_PENDING = 1; 34 /** Terminated state. */ 35 public static final int UCE_PRES_SUBSCRIPTION_STATE_TERMINATED = 2; 36 /** Unknown state. */ 37 public static final int UCE_PRES_SUBSCRIPTION_STATE_UNKNOWN = 3; 38 39 40 private int mPresSubscriptionState = UCE_PRES_SUBSCRIPTION_STATE_UNKNOWN; 41 42 43 /** @hide */ 44 public int describeContents() { 45 return 0; 46 } 47 48 /** @hide */ 49 public void writeToParcel(Parcel dest, int flags) { 50 dest.writeInt(mPresSubscriptionState); 51 } 52 53 /** @hide */ 54 public static final Parcelable.Creator<PresSubscriptionState> CREATOR = 55 new Parcelable.Creator<PresSubscriptionState>() { 56 57 public PresSubscriptionState createFromParcel(Parcel source) { 58 return new PresSubscriptionState(source); 59 } 60 61 public PresSubscriptionState[] newArray(int size) { 62 return new PresSubscriptionState[size]; 63 } 64 }; 65 66 /** @hide */ 67 private PresSubscriptionState(Parcel source) { 68 readFromParcel(source); 69 } 70 71 /** @hide */ 72 public void readFromParcel(Parcel source) { 73 mPresSubscriptionState = source.readInt(); 74 } 75 76 /** 77 * Constructor for the PresSubscriptionState class. 78 * @hide 79 */ 80 public PresSubscriptionState() { }; 81 82 /** 83 * Gets the Presence subscription state. 84 * @hide 85 */ 86 public int getPresSubscriptionStateValue() { 87 return mPresSubscriptionState; 88 } 89 90 91 /** 92 * Sets the Presence subscription state. 93 * @hide 94 */ 95 public void setPresSubscriptionState(int nPresSubscriptionState) { 96 this.mPresSubscriptionState = nPresSubscriptionState; 97 } 98}