Loading src/java/com/android/internal/telephony/PhoneSubInfoController.java +24 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.telephony.TelephonyFrameworkInitializer; import android.util.EventLog; import com.android.internal.telephony.uicc.IsimRecords; import com.android.internal.telephony.uicc.SIMRecords; import com.android.internal.telephony.uicc.UiccCardApplication; import com.android.internal.telephony.uicc.UiccPort; import com.android.telephony.Rlog; Loading Loading @@ -418,6 +419,29 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub { }); } /** * Returns the USIM service table that fetched from EFUST elementary field that are loaded * based on the appType. */ public String getSimServiceTable(int subId, int appType) throws RemoteException { return callPhoneMethodForSubIdWithPrivilegedCheck(subId, "getSimServiceTable", (phone) -> { UiccPort uiccPort = phone.getUiccPort(); if (uiccPort == null || uiccPort.getUiccProfile() == null) { loge("getSimServiceTable(): uiccPort or uiccProfile is null"); return null; } UiccCardApplication uiccApp = uiccPort.getUiccProfile().getApplicationByType( appType); if (uiccApp == null) { loge("getSimServiceTable(): no app with specified apptype=" + appType); return null; } return ((SIMRecords)uiccApp.getIccRecords()).getSimServiceTable(); }); } @Override public String getIccSimChallengeResponse(int subId, int appType, int authType, String data, String callingPackage, String callingFeatureId) throws RemoteException { Loading src/java/com/android/internal/telephony/uicc/IsimServiceTable.java 0 → 100644 +56 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.telephony.uicc; public final class IsimServiceTable extends IccServiceTable { private static final String TAG = "IsimServiceTable"; public enum IsimService { PCSCF_ADDRESS, GBA, // Generic Bootstrapping Architecture (GBA) HTTP_DIGEST, GBA_LOCALKEY_ESTABLISHMENT, // GBA-based Local Key Establishment Mechanism PCSCF_DISCOVERY_FOR_IMS, // Support of P-CSCF discovery for IMS Local Break Out SMS, SMSR, // Short Message Status Reports SM_OVERIP_AND_DATA_DL_VIA_SMS_PP, // Support for SM-over-IP including data download via // SMS-PP COMMUNICATION_CONTROL_FOR_IMS_BY_ISIM, UICC_ACCESS_TO_IMS } public IsimServiceTable(byte[] table) { super(table); } public boolean isAvailable(IsimService service) { return super.isAvailable(service.ordinal()); } @Override protected String getTag() { return TAG; } @Override protected Object[] getValues() { return IsimService.values(); } public byte[] getISIMServiceTable() { return mServiceTable; } } src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java +14 −1 Original line number Diff line number Diff line Loading @@ -225,6 +225,11 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { } } @VisibleForTesting public EfIsimIstLoaded getIsimIstObject() { return new EfIsimIstLoaded(); } private class EfIsimSmssLoaded implements IccRecords.IccRecordLoaded { @Override Loading Loading @@ -484,11 +489,11 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { pw.println("IsimRecords: " + this); pw.println(" extends:"); super.dump(fd, pw, args); pw.println(" mIsimServiceTable=" + getIsimServiceTable()); if (DUMP_RECORDS) { pw.println(" mIsimImpi=" + mIsimImpi); pw.println(" mIsimDomain=" + mIsimDomain); pw.println(" mIsimImpu[]=" + Arrays.toString(mIsimImpu)); pw.println(" mIsimIst" + mIsimIst); pw.println(" mIsimPcscf" + mIsimPcscf); pw.println(" mPsismsc=" + mPsiSmsc); pw.println(" mSmss TPMR=" + getSmssTpmrValue()); Loading @@ -496,6 +501,14 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { pw.flush(); } // Just to return the Enums of service table to print in DUMP private IsimServiceTable getIsimServiceTable() { if (mIsimIst != null) { byte[] istTable = IccUtils.hexStringToBytes(mIsimIst); return new IsimServiceTable(istTable); } return null; } @Override public int getVoiceMessageCount() { return 0; // Not applicable to Isim Loading src/java/com/android/internal/telephony/uicc/SIMRecords.java +13 −1 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ public class SIMRecords extends IccRecords { private static final int EVENT_UPDATE_DONE = 14 + SIM_RECORD_EVENT_BASE; protected static final int EVENT_GET_PNN_DONE = 15 + SIM_RECORD_EVENT_BASE; protected static final int EVENT_GET_OPL_DONE = 16 + SIM_RECORD_EVENT_BASE; private static final int EVENT_GET_SST_DONE = 17 + SIM_RECORD_EVENT_BASE; protected static final int EVENT_GET_SST_DONE = 17 + SIM_RECORD_EVENT_BASE; private static final int EVENT_GET_ALL_SMS_DONE = 18 + SIM_RECORD_EVENT_BASE; private static final int EVENT_MARK_SMS_READ_DONE = 19 + SIM_RECORD_EVENT_BASE; private static final int EVENT_SET_MBDN_DONE = 20 + SIM_RECORD_EVENT_BASE; Loading Loading @@ -279,6 +279,18 @@ public class SIMRecords extends IccRecords { return mUsimServiceTable; } /** * Fetches the USIM service table from UsimServiceTable * * @return HexString representation of USIM service table */ public String getSimServiceTable() { if (mUsimServiceTable != null) { return IccUtils.bytesToHexString(mUsimServiceTable.getUSIMServiceTable()); } return null; } @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) private int getExtFromEf(int ef) { int ext; Loading src/java/com/android/internal/telephony/uicc/UsimServiceTable.java +4 −0 Original line number Diff line number Diff line Loading @@ -157,4 +157,8 @@ public final class UsimServiceTable extends IccServiceTable { protected Object[] getValues() { return UsimService.values(); } public byte[] getUSIMServiceTable() { return mServiceTable; } } Loading
src/java/com/android/internal/telephony/PhoneSubInfoController.java +24 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.telephony.TelephonyFrameworkInitializer; import android.util.EventLog; import com.android.internal.telephony.uicc.IsimRecords; import com.android.internal.telephony.uicc.SIMRecords; import com.android.internal.telephony.uicc.UiccCardApplication; import com.android.internal.telephony.uicc.UiccPort; import com.android.telephony.Rlog; Loading Loading @@ -418,6 +419,29 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub { }); } /** * Returns the USIM service table that fetched from EFUST elementary field that are loaded * based on the appType. */ public String getSimServiceTable(int subId, int appType) throws RemoteException { return callPhoneMethodForSubIdWithPrivilegedCheck(subId, "getSimServiceTable", (phone) -> { UiccPort uiccPort = phone.getUiccPort(); if (uiccPort == null || uiccPort.getUiccProfile() == null) { loge("getSimServiceTable(): uiccPort or uiccProfile is null"); return null; } UiccCardApplication uiccApp = uiccPort.getUiccProfile().getApplicationByType( appType); if (uiccApp == null) { loge("getSimServiceTable(): no app with specified apptype=" + appType); return null; } return ((SIMRecords)uiccApp.getIccRecords()).getSimServiceTable(); }); } @Override public String getIccSimChallengeResponse(int subId, int appType, int authType, String data, String callingPackage, String callingFeatureId) throws RemoteException { Loading
src/java/com/android/internal/telephony/uicc/IsimServiceTable.java 0 → 100644 +56 −0 Original line number Diff line number Diff line /* * Copyright (C) 2022 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.internal.telephony.uicc; public final class IsimServiceTable extends IccServiceTable { private static final String TAG = "IsimServiceTable"; public enum IsimService { PCSCF_ADDRESS, GBA, // Generic Bootstrapping Architecture (GBA) HTTP_DIGEST, GBA_LOCALKEY_ESTABLISHMENT, // GBA-based Local Key Establishment Mechanism PCSCF_DISCOVERY_FOR_IMS, // Support of P-CSCF discovery for IMS Local Break Out SMS, SMSR, // Short Message Status Reports SM_OVERIP_AND_DATA_DL_VIA_SMS_PP, // Support for SM-over-IP including data download via // SMS-PP COMMUNICATION_CONTROL_FOR_IMS_BY_ISIM, UICC_ACCESS_TO_IMS } public IsimServiceTable(byte[] table) { super(table); } public boolean isAvailable(IsimService service) { return super.isAvailable(service.ordinal()); } @Override protected String getTag() { return TAG; } @Override protected Object[] getValues() { return IsimService.values(); } public byte[] getISIMServiceTable() { return mServiceTable; } }
src/java/com/android/internal/telephony/uicc/IsimUiccRecords.java +14 −1 Original line number Diff line number Diff line Loading @@ -225,6 +225,11 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { } } @VisibleForTesting public EfIsimIstLoaded getIsimIstObject() { return new EfIsimIstLoaded(); } private class EfIsimSmssLoaded implements IccRecords.IccRecordLoaded { @Override Loading Loading @@ -484,11 +489,11 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { pw.println("IsimRecords: " + this); pw.println(" extends:"); super.dump(fd, pw, args); pw.println(" mIsimServiceTable=" + getIsimServiceTable()); if (DUMP_RECORDS) { pw.println(" mIsimImpi=" + mIsimImpi); pw.println(" mIsimDomain=" + mIsimDomain); pw.println(" mIsimImpu[]=" + Arrays.toString(mIsimImpu)); pw.println(" mIsimIst" + mIsimIst); pw.println(" mIsimPcscf" + mIsimPcscf); pw.println(" mPsismsc=" + mPsiSmsc); pw.println(" mSmss TPMR=" + getSmssTpmrValue()); Loading @@ -496,6 +501,14 @@ public class IsimUiccRecords extends IccRecords implements IsimRecords { pw.flush(); } // Just to return the Enums of service table to print in DUMP private IsimServiceTable getIsimServiceTable() { if (mIsimIst != null) { byte[] istTable = IccUtils.hexStringToBytes(mIsimIst); return new IsimServiceTable(istTable); } return null; } @Override public int getVoiceMessageCount() { return 0; // Not applicable to Isim Loading
src/java/com/android/internal/telephony/uicc/SIMRecords.java +13 −1 Original line number Diff line number Diff line Loading @@ -167,7 +167,7 @@ public class SIMRecords extends IccRecords { private static final int EVENT_UPDATE_DONE = 14 + SIM_RECORD_EVENT_BASE; protected static final int EVENT_GET_PNN_DONE = 15 + SIM_RECORD_EVENT_BASE; protected static final int EVENT_GET_OPL_DONE = 16 + SIM_RECORD_EVENT_BASE; private static final int EVENT_GET_SST_DONE = 17 + SIM_RECORD_EVENT_BASE; protected static final int EVENT_GET_SST_DONE = 17 + SIM_RECORD_EVENT_BASE; private static final int EVENT_GET_ALL_SMS_DONE = 18 + SIM_RECORD_EVENT_BASE; private static final int EVENT_MARK_SMS_READ_DONE = 19 + SIM_RECORD_EVENT_BASE; private static final int EVENT_SET_MBDN_DONE = 20 + SIM_RECORD_EVENT_BASE; Loading Loading @@ -279,6 +279,18 @@ public class SIMRecords extends IccRecords { return mUsimServiceTable; } /** * Fetches the USIM service table from UsimServiceTable * * @return HexString representation of USIM service table */ public String getSimServiceTable() { if (mUsimServiceTable != null) { return IccUtils.bytesToHexString(mUsimServiceTable.getUSIMServiceTable()); } return null; } @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) private int getExtFromEf(int ef) { int ext; Loading
src/java/com/android/internal/telephony/uicc/UsimServiceTable.java +4 −0 Original line number Diff line number Diff line Loading @@ -157,4 +157,8 @@ public final class UsimServiceTable extends IccServiceTable { protected Object[] getValues() { return UsimService.values(); } public byte[] getUSIMServiceTable() { return mServiceTable; } }