Search in sources :

Example 11 with UiccCard

use of com.android.internal.telephony.uicc.UiccCard in project android_frameworks_opt_telephony by LineageOS.

the class SubscriptionController method insertEmptySubInfoRecord.

Uri insertEmptySubInfoRecord(String uniqueId, String displayName, int slotIndex, int subscriptionType) {
    ContentResolver resolver = mContext.getContentResolver();
    ContentValues value = new ContentValues();
    value.put(SubscriptionManager.ICC_ID, uniqueId);
    int color = getUnusedColor(mContext.getOpPackageName(), mContext.getAttributionTag());
    // default SIM color differs between slots
    value.put(SubscriptionManager.HUE, color);
    value.put(SubscriptionManager.SIM_SLOT_INDEX, slotIndex);
    value.put(SubscriptionManager.CARRIER_NAME, "");
    value.put(SubscriptionManager.CARD_ID, uniqueId);
    value.put(SubscriptionManager.SUBSCRIPTION_TYPE, subscriptionType);
    if (!TextUtils.isEmpty(displayName)) {
        value.put(SubscriptionManager.DISPLAY_NAME, displayName);
    }
    if (!isSubscriptionForRemoteSim(subscriptionType)) {
        UiccCard card = mUiccController.getUiccCardForPhone(slotIndex);
        if (card != null) {
            String cardId = card.getCardId();
            if (cardId != null) {
                value.put(SubscriptionManager.CARD_ID, cardId);
            }
        }
    }
    Uri uri = resolver.insert(SubscriptionManager.CONTENT_URI, value);
    // Refresh the Cache of Active Subscription Info List
    refreshCachedActiveSubscriptionInfoList();
    return uri;
}
Also used : ContentValues(android.content.ContentValues) UiccCard(com.android.internal.telephony.uicc.UiccCard) Uri(android.net.Uri) ContentResolver(android.content.ContentResolver)

Example 12 with UiccCard

use of com.android.internal.telephony.uicc.UiccCard in project android_frameworks_opt_telephony by LineageOS.

the class ServiceStateTracker method getOperatorBrandOverride.

private String getOperatorBrandOverride() {
    UiccCard card = mPhone.getUiccCard();
    if (card == null)
        return null;
    UiccProfile profile = card.getUiccProfile();
    if (profile == null)
        return null;
    return profile.getOperatorBrandOverride();
}
Also used : UiccCard(com.android.internal.telephony.uicc.UiccCard) UiccProfile(com.android.internal.telephony.uicc.UiccProfile)

Aggregations

UiccCard (com.android.internal.telephony.uicc.UiccCard)12 ContentResolver (android.content.ContentResolver)2 ContentValues (android.content.ContentValues)2 Intent (android.content.Intent)2 Uri (android.net.Uri)2 UiccController (com.android.internal.telephony.uicc.UiccController)2 PendingIntent (android.app.PendingIntent)1 UnsupportedAppUsage (android.compat.annotation.UnsupportedAppUsage)1 Cursor (android.database.Cursor)1 Message (android.os.Message)1 DataEnabledOverride (com.android.internal.telephony.dataconnection.DataEnabledOverride)1 CardState (com.android.internal.telephony.uicc.IccCardStatus.CardState)1 UiccCardApplication (com.android.internal.telephony.uicc.UiccCardApplication)1 UiccProfile (com.android.internal.telephony.uicc.UiccProfile)1 UiccSlot (com.android.internal.telephony.uicc.UiccSlot)1