Search in sources :

Example 61 with UnsupportedAppUsage

use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.

the class UiccCardApplication method registerForReady.

@UnsupportedAppUsage
public void registerForReady(Handler h, int what, Object obj) {
    synchronized (mLock) {
        Registrant r = new Registrant(h, what, obj);
        mReadyRegistrants.add(r);
        notifyReadyRegistrantsIfNeeded(r);
    }
}
Also used : Registrant(android.os.Registrant) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 62 with UnsupportedAppUsage

use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.

the class AdnRecordCache method updateAdnByIndex.

/**
 * Update an ADN-like record in EF by record index
 *
 * @param efid must be one among EF_ADN, EF_FDN, and EF_SDN
 * @param adn is the new adn to be stored
 * @param recordIndex is the 1-based adn record index
 * @param pin2 is required to update EF_FDN, otherwise must be null
 * @param response message to be posted when done
 *        response.exception hold the exception in error
 */
@UnsupportedAppUsage
public void updateAdnByIndex(int efid, AdnRecord adn, int recordIndex, String pin2, Message response) {
    int extensionEF = extensionEfForEf(efid);
    if (extensionEF < 0) {
        sendErrorResponse(response, "EF is not known ADN-like EF:0x" + Integer.toHexString(efid).toUpperCase());
        return;
    }
    Message pendingResponse = mUserWriteResponse.get(efid);
    if (pendingResponse != null) {
        sendErrorResponse(response, "Have pending update for EF:0x" + Integer.toHexString(efid).toUpperCase());
        return;
    }
    mUserWriteResponse.put(efid, response);
    new AdnRecordLoader(mFh).updateEF(adn, efid, extensionEF, recordIndex, pin2, obtainMessage(EVENT_UPDATE_ADN_DONE, efid, recordIndex, adn));
}
Also used : Message(android.os.Message) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 63 with UnsupportedAppUsage

use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.

the class IccFileHandler method loadEFLinearFixedAll.

/**
 * Load all records from a SIM Linear Fixed EF
 *
 * @param fileid EF id
 * @param path Path of the EF on the card
 * @param onLoaded
 *
 * ((AsyncResult)(onLoaded.obj)).result is an ArrayList<byte[]>
 */
@UnsupportedAppUsage
public void loadEFLinearFixedAll(int fileid, String path, Message onLoaded) {
    String efPath = (path == null) ? getEFPath(fileid) : path;
    Message response = obtainMessage(EVENT_GET_RECORD_SIZE_DONE, new LoadLinearFixedContext(fileid, efPath, onLoaded));
    mCi.iccIOForApp(COMMAND_GET_RESPONSE, fileid, efPath, 0, 0, GET_RESPONSE_EF_SIZE_BYTES, null, null, mAid, response);
}
Also used : Message(android.os.Message) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 64 with UnsupportedAppUsage

use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.

the class SubscriptionInfoUpdater method isAllIccIdQueryDone.

@UnsupportedAppUsage
protected boolean isAllIccIdQueryDone() {
    for (int i = 0; i < TelephonyManager.getDefault().getActiveModemCount(); i++) {
        UiccSlot slot = UiccController.getInstance().getUiccSlotForPhone(i);
        int slotId = UiccController.getInstance().getSlotIdFromPhoneId(i);
        if (sIccId[i] == null || slot == null || !slot.isActive()) {
            if (sIccId[i] == null) {
                logd("Wait for SIM " + i + " Iccid");
            } else {
                logd(String.format("Wait for slot corresponding to phone %d to be active, " + "slotId is %d", i, slotId));
            }
            return false;
        }
    }
    logd("All IccIds query complete");
    return true;
}
Also used : UiccSlot(com.android.internal.telephony.uicc.UiccSlot) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 65 with UnsupportedAppUsage

use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.

the class SubscriptionController method getSubInfoRecord.

/**
 * New SubInfoRecord instance and fill in detail info
 * @param cursor
 * @return the query result of desired SubInfoRecord
 */
@UnsupportedAppUsage
private SubscriptionInfo getSubInfoRecord(Cursor cursor) {
    int id = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.UNIQUE_KEY_SUBSCRIPTION_ID));
    String iccId = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.ICC_ID));
    int simSlotIndex = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.SIM_SLOT_INDEX));
    String displayName = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.DISPLAY_NAME));
    String carrierName = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.CARRIER_NAME));
    int nameSource = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.NAME_SOURCE));
    int iconTint = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.HUE));
    String number = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.NUMBER));
    int dataRoaming = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.DATA_ROAMING));
    // Get the blank bitmap for this SubInfoRecord
    Bitmap iconBitmap = BitmapFactory.decodeResource(mContext.getResources(), com.android.internal.R.drawable.ic_sim_card_multi_24px_clr);
    String mcc = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.MCC_STRING));
    String mnc = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.MNC_STRING));
    String ehplmnsRaw = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.EHPLMNS));
    String hplmnsRaw = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.HPLMNS));
    String[] ehplmns = ehplmnsRaw == null ? null : ehplmnsRaw.split(",");
    String[] hplmns = hplmnsRaw == null ? null : hplmnsRaw.split(",");
    // cardId is the private ICCID/EID string, also known as the card string
    String cardId = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.CARD_ID));
    String countryIso = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.ISO_COUNTRY_CODE));
    // publicCardId is the publicly exposed int card ID
    int publicCardId = mUiccController.convertToPublicCardId(cardId);
    boolean isEmbedded = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.IS_EMBEDDED)) == 1;
    int carrierId = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.CARRIER_ID));
    UiccAccessRule[] accessRules;
    if (isEmbedded) {
        accessRules = UiccAccessRule.decodeRules(cursor.getBlob(cursor.getColumnIndexOrThrow(SubscriptionManager.ACCESS_RULES)));
    } else {
        accessRules = null;
    }
    UiccAccessRule[] carrierConfigAccessRules = UiccAccessRule.decodeRules(cursor.getBlob(cursor.getColumnIndexOrThrow(SubscriptionManager.ACCESS_RULES_FROM_CARRIER_CONFIGS)));
    boolean isOpportunistic = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.IS_OPPORTUNISTIC)) == 1;
    String groupUUID = cursor.getString(cursor.getColumnIndexOrThrow(SubscriptionManager.GROUP_UUID));
    int profileClass = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.PROFILE_CLASS));
    int subType = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.SUBSCRIPTION_TYPE));
    String groupOwner = getOptionalStringFromCursor(cursor, SubscriptionManager.GROUP_OWNER, /*defaultVal*/
    null);
    boolean areUiccApplicationsEnabled = cursor.getInt(cursor.getColumnIndexOrThrow(SubscriptionManager.UICC_APPLICATIONS_ENABLED)) == 1;
    if (VDBG) {
        String iccIdToPrint = SubscriptionInfo.givePrintableIccid(iccId);
        String cardIdToPrint = SubscriptionInfo.givePrintableIccid(cardId);
        logd("[getSubInfoRecord] id:" + id + " iccid:" + iccIdToPrint + " simSlotIndex:" + simSlotIndex + " carrierid:" + carrierId + " displayName:" + displayName + " nameSource:" + nameSource + " iconTint:" + iconTint + " dataRoaming:" + dataRoaming + " mcc:" + mcc + " mnc:" + mnc + " countIso:" + countryIso + " isEmbedded:" + isEmbedded + " accessRules:" + Arrays.toString(accessRules) + " carrierConfigAccessRules: " + Arrays.toString(carrierConfigAccessRules) + " cardId:" + cardIdToPrint + " publicCardId:" + publicCardId + " isOpportunistic:" + isOpportunistic + " groupUUID:" + groupUUID + " profileClass:" + profileClass + " subscriptionType: " + subType + " carrierConfigAccessRules:" + carrierConfigAccessRules + " areUiccApplicationsEnabled: " + areUiccApplicationsEnabled);
    }
    // If line1number has been set to a different number, use it instead.
    String line1Number = mTelephonyManager.getLine1Number(id);
    if (!TextUtils.isEmpty(line1Number) && !line1Number.equals(number)) {
        number = line1Number;
    }
    SubscriptionInfo info = new SubscriptionInfo(id, iccId, simSlotIndex, displayName, carrierName, nameSource, iconTint, number, dataRoaming, iconBitmap, mcc, mnc, countryIso, isEmbedded, accessRules, cardId, publicCardId, isOpportunistic, groupUUID, false, /* isGroupDisabled */
    carrierId, profileClass, subType, groupOwner, carrierConfigAccessRules, areUiccApplicationsEnabled);
    info.setAssociatedPlmns(ehplmns, hplmns);
    return info;
}
Also used : UiccAccessRule(android.telephony.UiccAccessRule) Bitmap(android.graphics.Bitmap) SubscriptionInfo(android.telephony.SubscriptionInfo) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Aggregations

UnsupportedAppUsage (android.compat.annotation.UnsupportedAppUsage)71 Message (android.os.Message)18 SmsMessage (android.telephony.SmsMessage)9 Intent (android.content.Intent)6 SipPhone (com.android.internal.telephony.sip.SipPhone)6 SmsCbMessage (android.telephony.SmsCbMessage)5 Cursor (android.database.Cursor)4 PendingIntent (android.app.PendingIntent)3 PackageManager (android.content.pm.PackageManager)3 AsyncResult (android.os.AsyncResult)3 PersistableBundle (android.os.PersistableBundle)3 CarrierConfigManager (android.telephony.CarrierConfigManager)3 SubscriptionInfo (android.telephony.SubscriptionInfo)3 SQLException (android.database.SQLException)2 SQLiteException (android.database.sqlite.SQLiteException)2 PowerManager (android.os.PowerManager)2 RadioAccessFamily (android.telephony.RadioAccessFamily)2 ImsException (com.android.ims.ImsException)2 ImsUtInterface (com.android.ims.ImsUtInterface)2 AppState (com.android.internal.telephony.uicc.IccCardApplicationStatus.AppState)2