Home | History | Annotate | Download | only in ims
      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 call forward information for the supplementary service configuration.
     24  *
     25  * @hide
     26  */
     27 public class ImsCallForwardInfo implements Parcelable {
     28     // Refer to ImsUtInterface#CDIV_CF_XXX
     29     public int mCondition;
     30     // 0: disabled, 1: enabled
     31     public int mStatus;
     32     // 0x91: International, 0x81: Unknown
     33     public int mToA;
     34     // Number (it will not include the "sip" or "tel" URI scheme)
     35     public String mNumber;
     36     // No reply timer for CF
     37     public int mTimeSeconds;
     38 
     39     public ImsCallForwardInfo() {
     40     }
     41 
     42     public ImsCallForwardInfo(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(mCondition);
     54         out.writeInt(mStatus);
     55         out.writeInt(mToA);
     56         out.writeString(mNumber);
     57         out.writeInt(mTimeSeconds);
     58     }
     59 
     60     @Override
     61     public String toString() {
     62         return super.toString() + ", Condition: " + mCondition
     63             + ", Status: " + ((mStatus == 0) ? "disabled" : "enabled")
     64             + ", ToA: " + mToA + ", Number=" + mNumber
     65             + ", Time (seconds): " + mTimeSeconds;
     66     }
     67 
     68     private void readFromParcel(Parcel in) {
     69         mCondition = in.readInt();
     70         mStatus = in.readInt();
     71         mToA = in.readInt();
     72         mNumber = in.readString();
     73         mTimeSeconds = in.readInt();
     74     }
     75 
     76     public static final Creator<ImsCallForwardInfo> CREATOR =
     77             new Creator<ImsCallForwardInfo>() {
     78         @Override
     79         public ImsCallForwardInfo createFromParcel(Parcel in) {
     80             return new ImsCallForwardInfo(in);
     81         }
     82 
     83         @Override
     84         public ImsCallForwardInfo[] newArray(int size) {
     85             return new ImsCallForwardInfo[size];
     86         }
     87     };
     88 }
     89