2 * Copyright (c) 2015, The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package android.service.carrier;
19 import android.os.Parcel;
20 import android.os.Parcelable;
23 * Used to pass info to CarrierConfigService implementations so they can decide what values to
26 public class CarrierIdentifier implements Parcelable {
28 /** Used to create a {@link CarrierIdentifier} from a {@link Parcel}. */
29 public static final Creator<CarrierIdentifier> CREATOR = new Creator<CarrierIdentifier>() {
31 public CarrierIdentifier createFromParcel(Parcel parcel) {
32 return new CarrierIdentifier(parcel);
36 public CarrierIdentifier[] newArray(int i) {
37 return new CarrierIdentifier[i];
48 public CarrierIdentifier(String mcc, String mnc, String spn, String imsi, String gid1,
59 public CarrierIdentifier(Parcel parcel) {
60 readFromParcel(parcel);
63 /** Get the mobile country code. */
64 public String getMcc() {
68 /** Get the mobile network code. */
69 public String getMnc() {
73 /** Get the service provider name. */
74 public String getSpn() {
78 /** Get the international mobile subscriber identity. */
79 public String getImsi() {
83 /** Get the group identifier level 1. */
84 public String getGid1() {
88 /** Get the group identifier level 2. */
89 public String getGid2() {
94 public int describeContents() {
99 public void writeToParcel(Parcel out, int flags) {
100 out.writeString(mMcc);
101 out.writeString(mMnc);
102 out.writeString(mSpn);
103 out.writeString(mImsi);
104 out.writeString(mGid1);
105 out.writeString(mGid2);
109 public String toString() {
110 return "CarrierIdentifier{"
121 public void readFromParcel(Parcel in) {
122 mMcc = in.readString();
123 mMnc = in.readString();
124 mSpn = in.readString();
125 mImsi = in.readString();
126 mGid1 = in.readString();
127 mGid2 = in.readString();