Home | History | Annotate | Download | only in euicc
      1 /*
      2  * Copyright (C) 2017 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 package android.telephony.euicc;
     17 
     18 import android.annotation.Nullable;
     19 import android.os.Parcel;
     20 import android.os.Parcelable;
     21 
     22 /**
     23  * Information about an eUICC chip/device.
     24  *
     25  * @see EuiccManager#getEuiccInfo
     26  */
     27 // WARNING: Do not add any privacy-sensitive fields to this class (such as an eUICC identifier)!
     28 // This API is accessible to all applications. Privacy-sensitive fields should be returned in their
     29 // own APIs guarded with appropriate permission checks.
     30 public final class EuiccInfo implements Parcelable {
     31 
     32     public static final Creator<EuiccInfo> CREATOR =
     33             new Creator<EuiccInfo>() {
     34                 @Override
     35                 public EuiccInfo createFromParcel(Parcel in) {
     36                     return new EuiccInfo(in);
     37                 }
     38 
     39                 @Override
     40                 public EuiccInfo[] newArray(int size) {
     41                     return new EuiccInfo[size];
     42                 }
     43             };
     44 
     45     @Nullable
     46     private final String osVersion;
     47 
     48     /**
     49      * Gets the version of the operating system running on the eUICC. This field is
     50      * hardware-specific and is not guaranteed to match any particular format.
     51      */
     52     @Nullable
     53     public String getOsVersion() {
     54         return osVersion;
     55     }
     56 
     57     public EuiccInfo(@Nullable String osVersion) {
     58         this.osVersion = osVersion;
     59     }
     60 
     61     private EuiccInfo(Parcel in) {
     62         osVersion = in.readString();
     63     }
     64 
     65     @Override
     66     public void writeToParcel(Parcel dest, int flags) {
     67         dest.writeString(osVersion);
     68     }
     69 
     70     @Override
     71     public int describeContents() {
     72         return 0;
     73     }
     74 }
     75