1 /*
2  * Copyright (C) 2011 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.internal.telephony.uicc;
18 
19 import android.compat.annotation.UnsupportedAppUsage;
20 import android.os.Build;
21 
22 
23 /**
24  * Wrapper class for the USIM Service Table EF.
25  * See 3GPP TS 31.102 Release 10 section 4.2.8
26  */
27 public final class UsimServiceTable extends IccServiceTable {
28     public enum UsimService {
29         PHONEBOOK,
30         @UnsupportedAppUsage
31         FDN,                                // Fixed Dialing Numbers
32         FDN_EXTENSION,                      // FDN extension data in EF_EXT2
33         @UnsupportedAppUsage
34         SDN,                                // Service Dialing Numbers
35         SDN_EXTENSION,                      // SDN extension data in EF_EXT3
36         BDN,                                // Barred Dialing Numbers
37         BDN_EXTENSION,                      // BDN extension data in EF_EXT4
38         OUTGOING_CALL_INFO,
39         INCOMING_CALL_INFO,
40         @UnsupportedAppUsage
41         SM_STORAGE,
42         SM_STATUS_REPORTS,
43         @UnsupportedAppUsage
44         SM_SERVICE_PARAMS,
45         ADVICE_OF_CHARGE,
46         CAP_CONFIG_PARAMS_2,
47         CB_MESSAGE_ID,
48         CB_MESSAGE_ID_RANGES,
49         GROUP_ID_LEVEL_1,
50         GROUP_ID_LEVEL_2,
51         @UnsupportedAppUsage
52         SPN,                                // Service Provider Name
53         USER_PLMN_SELECT,
54         @UnsupportedAppUsage
55         MSISDN,
56         IMAGE,
57         LOCALISED_SERVICE_AREAS,
58         EMLPP,                              // Enhanced Multi-Level Precedence and Preemption
59         EMLPP_AUTO_ANSWER,
60         RFU,
61         GSM_ACCESS,
62         DATA_DL_VIA_SMS_PP,
63         DATA_DL_VIA_SMS_CB,
64         CALL_CONTROL_BY_USIM,
65         MO_SMS_CONTROL_BY_USIM,
66         RUN_AT_COMMAND,
67         IGNORED_1,
68         ENABLED_SERVICES_TABLE,
69         APN_CONTROL_LIST,
70         DEPERSONALISATION_CONTROL_KEYS,
71         COOPERATIVE_NETWORK_LIST,
72         GSM_SECURITY_CONTEXT,
73         CPBCCH_INFO,
74         INVESTIGATION_SCAN,
75         MEXE,
76         OPERATOR_PLMN_SELECT,
77         HPLMN_SELECT,
78         EXTENSION_5,                        // Extension data for ICI, OCI, MSISDN in EF_EXT5
79         @UnsupportedAppUsage
80         PLMN_NETWORK_NAME,
81         @UnsupportedAppUsage
82         OPERATOR_PLMN_LIST,
83         @UnsupportedAppUsage
84         MBDN,                               // Mailbox Dialing Numbers
85         @UnsupportedAppUsage
86         MWI_STATUS,                         // Message Waiting Indication status
87         @UnsupportedAppUsage
88         CFI_STATUS,                         // Call Forwarding Indication status
89         IGNORED_2,
90         SERVICE_PROVIDER_DISPLAY_INFO,
91         MMS_NOTIFICATION,
92         MMS_NOTIFICATION_EXTENSION,         // MMS Notification extension data in EF_EXT8
93         GPRS_CALL_CONTROL_BY_USIM,
94         MMS_CONNECTIVITY_PARAMS,
95         NETWORK_INDICATION_OF_ALERTING,
96         VGCS_GROUP_ID_LIST,
97         VBS_GROUP_ID_LIST,
98         PSEUDONYM,
99         IWLAN_USER_PLMN_SELECT,
100         IWLAN_OPERATOR_PLMN_SELECT,
101         USER_WSID_LIST,
102         OPERATOR_WSID_LIST,
103         VGCS_SECURITY,
104         VBS_SECURITY,
105         WLAN_REAUTH_IDENTITY,
106         MM_STORAGE,
107         GBA,                                // Generic Bootstrapping Architecture
108         MBMS_SECURITY,
109         DATA_DL_VIA_USSD,
110         EQUIVALENT_HPLMN,
111         TERMINAL_PROFILE_AFTER_UICC_ACTIVATION,
112         EQUIVALENT_HPLMN_PRESENTATION,
113         LAST_RPLMN_SELECTION_INDICATION,
114         OMA_BCAST_PROFILE,
115         GBA_LOCAL_KEY_ESTABLISHMENT,
116         TERMINAL_APPLICATIONS,
117         SPN_ICON,
118         PLMN_NETWORK_NAME_ICON,
119         USIM_IP_CONNECTION_PARAMS,
120         IWLAN_HOME_ID_LIST,
121         IWLAN_EQUIVALENT_HPLMN_PRESENTATION,
122         IWLAN_HPLMN_PRIORITY_INDICATION,
123         IWLAN_LAST_REGISTERED_PLMN,
124         EPS_MOBILITY_MANAGEMENT_INFO,
125         @UnsupportedAppUsage
126         ALLOWED_CSG_LISTS_AND_INDICATIONS,
127         CALL_CONTROL_ON_EPS_PDN_CONNECTION_BY_USIM,
128         HPLMN_DIRECT_ACCESS,
129         ECALL_DATA,
130         @UnsupportedAppUsage
131         OPERATOR_CSG_LISTS_AND_INDICATIONS,
132         @UnsupportedAppUsage
133         SM_OVER_IP,
134         @UnsupportedAppUsage
135         CSG_DISPLAY_CONTROL,
136         IMS_COMMUNICATION_CONTROL_BY_USIM,
137         EXTENDED_TERMINAL_APPLICATIONS,
138         UICC_ACCESS_TO_IMS,
139         NAS_CONFIG_BY_USIM
140     }
141 
UsimServiceTable(byte[] table)142     public UsimServiceTable(byte[] table) {
143         super(table);
144     }
145 
146     @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
isAvailable(UsimService service)147     public boolean isAvailable(UsimService service) {
148         return super.isAvailable(service.ordinal());
149     }
150 
151     @Override
getTag()152     protected String getTag() {
153         return "UsimServiceTable";
154     }
155 
156     @Override
getValues()157     protected Object[] getValues() {
158         return UsimService.values();
159     }
160 
getUSIMServiceTable()161     public byte[] getUSIMServiceTable() {
162         return mServiceTable;
163     }
164 }
165