Home | History | Annotate | Download | only in telephony
      1 package android.telephony;
      2 
      3 import android.os.Parcel;
      4 import android.os.Parcelable;
      5 
      6 import java.util.Objects;
      7 
      8 
      9 /**
     10  * Class that stores information specific to voice network registration.
     11  * @hide
     12  */
     13 public class VoiceSpecificRegistrationStates implements Parcelable{
     14     /**
     15      * oncurrent services support indicator. if
     16      * registered on a CDMA system.
     17      * false - Concurrent services not supported,
     18      * true - Concurrent services supported
     19      */
     20      public final boolean cssSupported;
     21 
     22     /**
     23      * TSB-58 Roaming Indicator if registered
     24      * on a CDMA or EVDO system or -1 if not.
     25      * Valid values are 0-255.
     26      */
     27     public final int roamingIndicator;
     28 
     29     /**
     30      * indicates whether the current system is in the
     31      * PRL if registered on a CDMA or EVDO system or -1 if
     32      * not. 0=not in the PRL, 1=in the PRL
     33      */
     34     public final int systemIsInPrl;
     35 
     36     /**
     37      * default Roaming Indicator from the PRL,
     38      * if registered on a CDMA or EVDO system or -1 if not.
     39      * Valid values are 0-255.
     40      */
     41     public final int defaultRoamingIndicator;
     42 
     43     VoiceSpecificRegistrationStates(boolean cssSupported, int roamingIndicator, int systemIsInPrl,
     44             int defaultRoamingIndicator) {
     45         this.cssSupported = cssSupported;
     46         this.roamingIndicator = roamingIndicator;
     47         this.systemIsInPrl = systemIsInPrl;
     48         this.defaultRoamingIndicator = defaultRoamingIndicator;
     49     }
     50 
     51     private VoiceSpecificRegistrationStates(Parcel source) {
     52         this.cssSupported = source.readBoolean();
     53         this.roamingIndicator = source.readInt();
     54         this.systemIsInPrl = source.readInt();
     55         this.defaultRoamingIndicator = source.readInt();
     56     }
     57 
     58     @Override
     59     public void writeToParcel(Parcel dest, int flags) {
     60         dest.writeBoolean(cssSupported);
     61         dest.writeInt(roamingIndicator);
     62         dest.writeInt(systemIsInPrl);
     63         dest.writeInt(defaultRoamingIndicator);
     64     }
     65 
     66     @Override
     67     public int describeContents() {
     68         return 0;
     69     }
     70 
     71     @Override
     72     public String toString() {
     73         return "VoiceSpecificRegistrationStates {"
     74                 + " mCssSupported=" + cssSupported
     75                 + " mRoamingIndicator=" + roamingIndicator
     76                 + " mSystemIsInPrl=" + systemIsInPrl
     77                 + " mDefaultRoamingIndicator=" + defaultRoamingIndicator + "}";
     78     }
     79 
     80     @Override
     81     public int hashCode() {
     82         return Objects.hash(cssSupported, roamingIndicator, systemIsInPrl,
     83                 defaultRoamingIndicator);
     84     }
     85 
     86     @Override
     87     public boolean equals(Object o) {
     88         if (this == o) return true;
     89 
     90         if (o == null || !(o instanceof VoiceSpecificRegistrationStates)) {
     91             return false;
     92         }
     93 
     94         VoiceSpecificRegistrationStates other = (VoiceSpecificRegistrationStates) o;
     95         return this.cssSupported == other.cssSupported
     96                 && this.roamingIndicator == other.roamingIndicator
     97                 && this.systemIsInPrl == other.systemIsInPrl
     98                 && this.defaultRoamingIndicator == other.defaultRoamingIndicator;
     99     }
    100 
    101 
    102     public static final Parcelable.Creator<VoiceSpecificRegistrationStates> CREATOR =
    103             new Parcelable.Creator<VoiceSpecificRegistrationStates>() {
    104                 @Override
    105                 public VoiceSpecificRegistrationStates createFromParcel(Parcel source) {
    106                     return new VoiceSpecificRegistrationStates(source);
    107                 }
    108 
    109                 @Override
    110                 public VoiceSpecificRegistrationStates[] newArray(int size) {
    111                     return new VoiceSpecificRegistrationStates[size];
    112                 }
    113             };
    114 }