Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 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; |
| 18 | |
| 19 | import android.os.Parcel; |
| 20 | import android.os.Parcelable; |
| 21 | |
| 22 | /** |
| 23 | * Provides the result to the update operation for the supplementary service configuration. |
| 24 | * |
| 25 | * @hide |
| 26 | */ |
| 27 | public class ImsSsInfo implements Parcelable { |
| 28 | /** |
| 29 | * For the status of service registration or activation/deactivation. |
| 30 | */ |
| 31 | public static final int NOT_REGISTERED = (-1); |
| 32 | public static final int DISABLED = 0; |
| 33 | public static final int ENABLED = 1; |
| 34 | |
| 35 | // 0: disabled, 1: enabled |
| 36 | public int mStatus; |
Shriram Ganesh | ddf570e | 2015-05-31 09:18:48 -0700 | [diff] [blame] | 37 | public String mIcbNum; |
Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 38 | |
| 39 | public ImsSsInfo() { |
| 40 | } |
| 41 | |
| 42 | public ImsSsInfo(Parcel in) { |
| 43 | readFromParcel(in); |
| 44 | } |
| 45 | |
| 46 | @Override |
| 47 | public int describeContents() { |
| 48 | return 0; |
| 49 | } |
| 50 | |
| 51 | @Override |
| 52 | public void writeToParcel(Parcel out, int flags) { |
| 53 | out.writeInt(mStatus); |
Shriram Ganesh | ddf570e | 2015-05-31 09:18:48 -0700 | [diff] [blame] | 54 | out.writeString(mIcbNum); |
Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public String toString() { |
| 59 | return super.toString() + ", Status: " + ((mStatus == 0) ? "disabled" : "enabled"); |
| 60 | } |
| 61 | |
| 62 | private void readFromParcel(Parcel in) { |
| 63 | mStatus = in.readInt(); |
Shriram Ganesh | ddf570e | 2015-05-31 09:18:48 -0700 | [diff] [blame] | 64 | mIcbNum = in.readString(); |
Wink Saville | f8458ff | 2014-06-25 16:08:02 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | public static final Creator<ImsSsInfo> CREATOR = |
| 68 | new Creator<ImsSsInfo>() { |
| 69 | @Override |
| 70 | public ImsSsInfo createFromParcel(Parcel in) { |
| 71 | return new ImsSsInfo(in); |
| 72 | } |
| 73 | |
| 74 | @Override |
| 75 | public ImsSsInfo[] newArray(int size) { |
| 76 | return new ImsSsInfo[size]; |
| 77 | } |
| 78 | }; |
| 79 | } |