Loading proto/src/telephony.proto +8 −0 Original line number Diff line number Diff line Loading @@ -1841,6 +1841,14 @@ message ActiveSubscriptionInfo { /** whether subscription is opportunistic (0 - false, 1 - true, -1 - unknown). */ optional int32 is_opportunistic = 3; /** The mccmnc associated with the subscription. Useful for differentiating * between subscriptions with different mccmnc but same carrier_id (eg. Fi * Sprint vs. Fi T-Mobile).*/ optional string sim_mccmnc = 4 /*[ (datapol.semantic_type) = ST_LOCATION, (datapol.location_qualifier) = { precise_location: false } ]*/; }; enum SimState { Loading src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +14 −6 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ public class SubscriptionInfoUpdater extends Handler { @UnsupportedAppUsage protected static String[] sIccId = new String[SUPPORTED_MODEM_COUNT]; private static String[] sInactiveIccIds = new String[SUPPORTED_MODEM_COUNT]; private static int[] sSimCardState = new int[SUPPORTED_MODEM_COUNT]; private static int[] sSimApplicationState = new int[SUPPORTED_MODEM_COUNT]; private static boolean sIsSubInfoInitialized = false; Loading Loading @@ -427,7 +428,12 @@ public class SubscriptionInfoUpdater extends Handler { boolean isFinalState = false; IccCard iccCard = PhoneFactory.getPhone(phoneId).getIccCard(); if (iccCard.isEmptyProfile() || areUiccAppsDisabledOnCard(phoneId)) { boolean uiccAppsDisabled = areUiccAppsDisabledOnCard(phoneId); if (iccCard.isEmptyProfile() || uiccAppsDisabled) { if (uiccAppsDisabled) { UiccSlot slot = UiccController.getInstance().getUiccSlotForPhone(phoneId); sInactiveIccIds[phoneId] = IccUtils.stripTrailingFs(slot.getIccId()); } isFinalState = true; // ICC_NOT_READY is a terminal state for // 1) It's an empty profile as there's no uicc applications. Or Loading Loading @@ -607,9 +613,9 @@ public class SubscriptionInfoUpdater extends Handler { * It could be INVALID if it was already inactive. */ private void handleInactiveSlotIccStateChange(int phoneId, String iccId) { // If phoneId is valid, it means the physical slot was active in that phoneId. In this case, // we clear (mark inactive) the subscription in db on that phone. if (SubscriptionManager.isValidPhoneId(phoneId)) { // If phoneId is valid, it means the physical slot was previously active in that // phoneId. In this case, found the subId and set its phoneId to invalid. if (sIccId[phoneId] != null && !sIccId[phoneId].equals(ICCID_STRING_FOR_NO_SIM)) { logd("Slot of SIM" + (phoneId + 1) + " becomes inactive"); } Loading @@ -628,14 +634,16 @@ public class SubscriptionInfoUpdater extends Handler { private void cleanSubscriptionInPhone(int phoneId) { sIccId[phoneId] = ICCID_STRING_FOR_NO_SIM; int[] subIds = SubscriptionController.getInstance().getSubId(phoneId); if (subIds != null && subIds.length > 0) { if (sInactiveIccIds[phoneId] != null) { // When a SIM is unplugged, mark uicc applications enabled. This is to make sure when // user unplugs and re-inserts the SIM card, we re-enable it. logd("cleanSubscriptionInPhone " + phoneId + " inactive iccid " + sInactiveIccIds[phoneId]); ContentValues value = new ContentValues(1); value.put(SubscriptionManager.UICC_APPLICATIONS_ENABLED, true); sContext.getContentResolver().update(SubscriptionManager.CONTENT_URI, value, SubscriptionController.getSelectionForSubIdList(subIds), null); SubscriptionManager.ICC_ID + "=\'" + sInactiveIccIds[phoneId] + "\'", null); sInactiveIccIds[phoneId] = null; } updateSubscriptionInfoByIccId(phoneId, true /* updateEmbeddedSubs */); } Loading src/java/com/android/internal/telephony/euicc/EuiccController.java +9 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.app.AppOpsManager; import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ComponentInfo; Loading Loading @@ -81,6 +82,11 @@ public class EuiccController extends IEuiccController.Stub { private static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION = EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION; /** Restrictions limiting access to the PendingIntent */ private static final String RESOLUTION_ACTIVITY_PACKAGE_NAME = "com.android.phone"; private static final String RESOLUTION_ACTIVITY_CLASS_NAME = "com.android.phone.euicc.EuiccResolutionUiDispatcherActivity"; private static EuiccController sInstance; private final Context mContext; Loading Loading @@ -1258,6 +1264,9 @@ public class EuiccController extends IEuiccController.Stub { String callingPackage, int resolvableErrors, boolean confirmationCodeRetried, EuiccOperation op, int cardId) { Intent intent = new Intent(EuiccManager.ACTION_RESOLVE_ERROR); intent.setPackage(RESOLUTION_ACTIVITY_PACKAGE_NAME); intent.setComponent(new ComponentName( RESOLUTION_ACTIVITY_PACKAGE_NAME, RESOLUTION_ACTIVITY_CLASS_NAME)); intent.putExtra(EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_RESOLUTION_ACTION, resolutionAction); intent.putExtra(EuiccService.EXTRA_RESOLUTION_CALLING_PACKAGE, callingPackage); Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCall.java +11 −7 Original line number Diff line number Diff line Loading @@ -269,10 +269,14 @@ public class ImsPhoneCall extends Call { return (ImsPhoneConnection) connections.get(0); } /*package*/ void setMute(boolean mute) { ImsCall imsCall = getFirstConnection() == null ? null : getFirstConnection().getImsCall(); /** * Sets the mute state of the call. * @param mute {@code true} if the call could be muted; {@code false} otherwise. */ @VisibleForTesting public void setMute(boolean mute) { ImsPhoneConnection connection = getFirstConnection(); ImsCall imsCall = connection == null ? null : connection.getImsCall(); if (imsCall != null) { try { imsCall.setMute(mute); Loading Loading @@ -317,9 +321,9 @@ public class ImsPhoneCall extends Call { */ @VisibleForTesting @UnsupportedAppUsage public ImsCall getImsCall() { return (getFirstConnection() == null) ? null : getFirstConnection().getImsCall(); public ImsCall getImsCall() { ImsPhoneConnection connection = getFirstConnection(); return (connection == null) ? null : connection.getImsCall(); } /*package*/ static boolean isLocalTone(ImsCall imsCall) { Loading src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java +3 −0 Original line number Diff line number Diff line Loading @@ -806,6 +806,9 @@ public class TelephonyMetrics { activeSubscriptionInfo.slotIndex = phoneId; activeSubscriptionInfo.isOpportunistic = info.isOpportunistic() ? 1 : 0; activeSubscriptionInfo.carrierId = info.getCarrierId(); if (info.getMccString() != null && info.getMncString() != null) { activeSubscriptionInfo.simMccmnc = info.getMccString() + info.getMncString(); } if (!MessageNano.messageNanoEquals( mLastActiveSubscriptionInfos.get(phoneId), activeSubscriptionInfo)) { addTelephonyEvent(new TelephonyEventBuilder(phoneId) Loading Loading
proto/src/telephony.proto +8 −0 Original line number Diff line number Diff line Loading @@ -1841,6 +1841,14 @@ message ActiveSubscriptionInfo { /** whether subscription is opportunistic (0 - false, 1 - true, -1 - unknown). */ optional int32 is_opportunistic = 3; /** The mccmnc associated with the subscription. Useful for differentiating * between subscriptions with different mccmnc but same carrier_id (eg. Fi * Sprint vs. Fi T-Mobile).*/ optional string sim_mccmnc = 4 /*[ (datapol.semantic_type) = ST_LOCATION, (datapol.location_qualifier) = { precise_location: false } ]*/; }; enum SimState { Loading
src/java/com/android/internal/telephony/SubscriptionInfoUpdater.java +14 −6 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ public class SubscriptionInfoUpdater extends Handler { @UnsupportedAppUsage protected static String[] sIccId = new String[SUPPORTED_MODEM_COUNT]; private static String[] sInactiveIccIds = new String[SUPPORTED_MODEM_COUNT]; private static int[] sSimCardState = new int[SUPPORTED_MODEM_COUNT]; private static int[] sSimApplicationState = new int[SUPPORTED_MODEM_COUNT]; private static boolean sIsSubInfoInitialized = false; Loading Loading @@ -427,7 +428,12 @@ public class SubscriptionInfoUpdater extends Handler { boolean isFinalState = false; IccCard iccCard = PhoneFactory.getPhone(phoneId).getIccCard(); if (iccCard.isEmptyProfile() || areUiccAppsDisabledOnCard(phoneId)) { boolean uiccAppsDisabled = areUiccAppsDisabledOnCard(phoneId); if (iccCard.isEmptyProfile() || uiccAppsDisabled) { if (uiccAppsDisabled) { UiccSlot slot = UiccController.getInstance().getUiccSlotForPhone(phoneId); sInactiveIccIds[phoneId] = IccUtils.stripTrailingFs(slot.getIccId()); } isFinalState = true; // ICC_NOT_READY is a terminal state for // 1) It's an empty profile as there's no uicc applications. Or Loading Loading @@ -607,9 +613,9 @@ public class SubscriptionInfoUpdater extends Handler { * It could be INVALID if it was already inactive. */ private void handleInactiveSlotIccStateChange(int phoneId, String iccId) { // If phoneId is valid, it means the physical slot was active in that phoneId. In this case, // we clear (mark inactive) the subscription in db on that phone. if (SubscriptionManager.isValidPhoneId(phoneId)) { // If phoneId is valid, it means the physical slot was previously active in that // phoneId. In this case, found the subId and set its phoneId to invalid. if (sIccId[phoneId] != null && !sIccId[phoneId].equals(ICCID_STRING_FOR_NO_SIM)) { logd("Slot of SIM" + (phoneId + 1) + " becomes inactive"); } Loading @@ -628,14 +634,16 @@ public class SubscriptionInfoUpdater extends Handler { private void cleanSubscriptionInPhone(int phoneId) { sIccId[phoneId] = ICCID_STRING_FOR_NO_SIM; int[] subIds = SubscriptionController.getInstance().getSubId(phoneId); if (subIds != null && subIds.length > 0) { if (sInactiveIccIds[phoneId] != null) { // When a SIM is unplugged, mark uicc applications enabled. This is to make sure when // user unplugs and re-inserts the SIM card, we re-enable it. logd("cleanSubscriptionInPhone " + phoneId + " inactive iccid " + sInactiveIccIds[phoneId]); ContentValues value = new ContentValues(1); value.put(SubscriptionManager.UICC_APPLICATIONS_ENABLED, true); sContext.getContentResolver().update(SubscriptionManager.CONTENT_URI, value, SubscriptionController.getSelectionForSubIdList(subIds), null); SubscriptionManager.ICC_ID + "=\'" + sInactiveIccIds[phoneId] + "\'", null); sInactiveIccIds[phoneId] = null; } updateSubscriptionInfoByIccId(phoneId, true /* updateEmbeddedSubs */); } Loading
src/java/com/android/internal/telephony/euicc/EuiccController.java +9 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.app.AppOpsManager; import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.pm.ComponentInfo; Loading Loading @@ -81,6 +82,11 @@ public class EuiccController extends IEuiccController.Stub { private static final String EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION = EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_DOWNLOADABLE_SUBSCRIPTION; /** Restrictions limiting access to the PendingIntent */ private static final String RESOLUTION_ACTIVITY_PACKAGE_NAME = "com.android.phone"; private static final String RESOLUTION_ACTIVITY_CLASS_NAME = "com.android.phone.euicc.EuiccResolutionUiDispatcherActivity"; private static EuiccController sInstance; private final Context mContext; Loading Loading @@ -1258,6 +1264,9 @@ public class EuiccController extends IEuiccController.Stub { String callingPackage, int resolvableErrors, boolean confirmationCodeRetried, EuiccOperation op, int cardId) { Intent intent = new Intent(EuiccManager.ACTION_RESOLVE_ERROR); intent.setPackage(RESOLUTION_ACTIVITY_PACKAGE_NAME); intent.setComponent(new ComponentName( RESOLUTION_ACTIVITY_PACKAGE_NAME, RESOLUTION_ACTIVITY_CLASS_NAME)); intent.putExtra(EuiccManager.EXTRA_EMBEDDED_SUBSCRIPTION_RESOLUTION_ACTION, resolutionAction); intent.putExtra(EuiccService.EXTRA_RESOLUTION_CALLING_PACKAGE, callingPackage); Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCall.java +11 −7 Original line number Diff line number Diff line Loading @@ -269,10 +269,14 @@ public class ImsPhoneCall extends Call { return (ImsPhoneConnection) connections.get(0); } /*package*/ void setMute(boolean mute) { ImsCall imsCall = getFirstConnection() == null ? null : getFirstConnection().getImsCall(); /** * Sets the mute state of the call. * @param mute {@code true} if the call could be muted; {@code false} otherwise. */ @VisibleForTesting public void setMute(boolean mute) { ImsPhoneConnection connection = getFirstConnection(); ImsCall imsCall = connection == null ? null : connection.getImsCall(); if (imsCall != null) { try { imsCall.setMute(mute); Loading Loading @@ -317,9 +321,9 @@ public class ImsPhoneCall extends Call { */ @VisibleForTesting @UnsupportedAppUsage public ImsCall getImsCall() { return (getFirstConnection() == null) ? null : getFirstConnection().getImsCall(); public ImsCall getImsCall() { ImsPhoneConnection connection = getFirstConnection(); return (connection == null) ? null : connection.getImsCall(); } /*package*/ static boolean isLocalTone(ImsCall imsCall) { Loading
src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java +3 −0 Original line number Diff line number Diff line Loading @@ -806,6 +806,9 @@ public class TelephonyMetrics { activeSubscriptionInfo.slotIndex = phoneId; activeSubscriptionInfo.isOpportunistic = info.isOpportunistic() ? 1 : 0; activeSubscriptionInfo.carrierId = info.getCarrierId(); if (info.getMccString() != null && info.getMncString() != null) { activeSubscriptionInfo.simMccmnc = info.getMccString() + info.getMncString(); } if (!MessageNano.messageNanoEquals( mLastActiveSubscriptionInfos.get(phoneId), activeSubscriptionInfo)) { addTelephonyEvent(new TelephonyEventBuilder(phoneId) Loading