Search in sources :

Example 46 with UnsupportedAppUsage

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

the class CallManager method unregisterPhone.

/**
 * unregister phone from CallManager
 * @param phone to be unregistered
 */
@UnsupportedAppUsage
public void unregisterPhone(Phone phone) {
    if (phone != null && mPhones.contains(phone)) {
        if (DBG) {
            Rlog.d(LOG_TAG, "unregisterPhone(" + phone.getPhoneName() + " " + phone + ")");
        }
        Phone imsPhone = phone.getImsPhone();
        if (imsPhone != null) {
            unregisterPhone(imsPhone);
        }
        mPhones.remove(phone);
        mRingingCalls.remove(phone.getRingingCall());
        mBackgroundCalls.remove(phone.getBackgroundCall());
        mForegroundCalls.remove(phone.getForegroundCall());
        unregisterForPhoneStates(phone);
        if (phone == mDefaultPhone) {
            if (mPhones.isEmpty()) {
                mDefaultPhone = null;
            } else {
                mDefaultPhone = mPhones.get(0);
            }
        }
    }
}
Also used : SipPhone(com.android.internal.telephony.sip.SipPhone) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 47 with UnsupportedAppUsage

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

the class CallManager method conference.

/**
 * Conferences holding and active. Conference occurs asynchronously
 * and may fail. Final notification occurs via
 * {@link #registerForPreciseCallStateChanged(android.os.Handler, int,
 * java.lang.Object) registerForPreciseCallStateChanged()}.
 *
 * @exception CallStateException if canConference() would return false.
 * In these cases, this operation may not be performed.
 */
@UnsupportedAppUsage
public void conference(Call heldCall) throws CallStateException {
    int subId = heldCall.getPhone().getSubId();
    if (VDBG) {
        Rlog.d(LOG_TAG, "conference(" + heldCall + ")");
        Rlog.d(LOG_TAG, toString());
    }
    Phone fgPhone = getFgPhone(subId);
    if (fgPhone != null) {
        if (fgPhone instanceof SipPhone) {
            ((SipPhone) fgPhone).conference(heldCall);
        } else if (canConference(heldCall)) {
            fgPhone.conference();
        } else {
            throw (new CallStateException("Can't conference foreground and selected background call"));
        }
    } else {
        Rlog.d(LOG_TAG, "conference: fgPhone=null");
    }
    if (VDBG) {
        Rlog.d(LOG_TAG, "End conference(" + heldCall + ")");
        Rlog.d(LOG_TAG, toString());
    }
}
Also used : SipPhone(com.android.internal.telephony.sip.SipPhone) SipPhone(com.android.internal.telephony.sip.SipPhone) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 48 with UnsupportedAppUsage

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

the class GsmCdmaConnection method fetchDtmfToneDelay.

@UnsupportedAppUsage
private void fetchDtmfToneDelay(GsmCdmaPhone phone) {
    CarrierConfigManager configMgr = (CarrierConfigManager) phone.getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);
    PersistableBundle b = configMgr.getConfigForSubId(phone.getSubId());
    if (b != null) {
        mDtmfToneDelay = b.getInt(phone.getDtmfToneDelayKey());
    }
}
Also used : CarrierConfigManager(android.telephony.CarrierConfigManager) PersistableBundle(android.os.PersistableBundle) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 49 with UnsupportedAppUsage

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

the class Phone method getIccFileHandler.

/**
 * Retrieves the IccFileHandler of the Phone instance
 */
@UnsupportedAppUsage
public IccFileHandler getIccFileHandler() {
    UiccCardApplication uiccApplication = mUiccApplication.get();
    IccFileHandler fh;
    if (uiccApplication == null) {
        Rlog.d(LOG_TAG, "getIccFileHandler: uiccApplication == null, return null");
        fh = null;
    } else {
        fh = uiccApplication.getIccFileHandler();
    }
    Rlog.d(LOG_TAG, "getIccFileHandler: fh=" + fh);
    return fh;
}
Also used : IccFileHandler(com.android.internal.telephony.uicc.IccFileHandler) UiccCardApplication(com.android.internal.telephony.uicc.UiccCardApplication) UnsupportedAppUsage(android.compat.annotation.UnsupportedAppUsage)

Example 50 with UnsupportedAppUsage

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

the class Phone method selectNetworkManually.

/**
 * Manually selects a network. <code>response</code> is
 * dispatched when this is complete.  <code>response.obj</code> will be
 * an AsyncResult, and <code>response.obj.exception</code> will be non-null
 * on failure.
 *
 * @see #setNetworkSelectionModeAutomatic(Message)
 */
@UnsupportedAppUsage
public void selectNetworkManually(OperatorInfo network, boolean persistSelection, Message response) {
    // wrap the response message in our own message along with
    // the operator's id.
    NetworkSelectMessage nsm = new NetworkSelectMessage();
    nsm.message = response;
    nsm.operatorNumeric = network.getOperatorNumeric();
    nsm.operatorAlphaLong = network.getOperatorAlphaLong();
    nsm.operatorAlphaShort = network.getOperatorAlphaShort();
    Message msg = obtainMessage(EVENT_SET_NETWORK_MANUAL_COMPLETE, nsm);
    mCi.setNetworkSelectionModeManual(network.getOperatorNumeric(), network.getRan(), msg);
    if (persistSelection) {
        updateSavedNetworkOperator(nsm);
    } else {
        clearSavedNetworkSelection();
        updateManualNetworkSelection(nsm);
    }
}
Also used : Message(android.os.Message) 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