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;
37     public String mIcbNum;
38 
ImsSsInfo()39     public ImsSsInfo() {
40     }
41 
ImsSsInfo(Parcel in)42     public ImsSsInfo(Parcel in) {
43         readFromParcel(in);
44     }
45 
46     @Override
describeContents()47     public int describeContents() {
48         return 0;
49     }
50 
51     @Override
writeToParcel(Parcel out, int flags)52     public void writeToParcel(Parcel out, int flags) {
53         out.writeInt(mStatus);
54         out.writeString(mIcbNum);
55     }
56 
57     @Override
toString()58     public String toString() {
59         return super.toString() + ", Status: " + ((mStatus == 0) ? "disabled" : "enabled");
60     }
61 
readFromParcel(Parcel in)62     private void readFromParcel(Parcel in) {
63         mStatus = in.readInt();
64         mIcbNum = in.readString();
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 }
80