use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhoneConnection method createWakeLock.
@UnsupportedAppUsage
private void createWakeLock(Context context) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
mPartialWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOG_TAG);
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class GsmSMSDispatcher method sendSms.
/**
* {@inheritDoc}
*/
@UnsupportedAppUsage
@Override
protected void sendSms(SmsTracker tracker) {
int ss = mPhone.getServiceState().getState();
Rlog.d(TAG, "sendSms: " + " isIms()=" + isIms() + " mRetryCount=" + tracker.mRetryCount + " mImsRetry=" + tracker.mImsRetry + " mMessageRef=" + tracker.mMessageRef + " mUsesImsServiceForIms=" + tracker.mUsesImsServiceForIms + " SS=" + ss + " id=" + tracker.mMessageId);
// if sms over IMS is not supported on data and voice is not available...
if (!isIms() && ss != ServiceState.STATE_IN_SERVICE) {
// In 5G case only Data Rat is reported.
if (mPhone.getServiceState().getRilDataRadioTechnology() != ServiceState.RIL_RADIO_TECHNOLOGY_NR) {
tracker.onFailed(mContext, getNotInServiceError(ss), NO_ERROR_CODE);
return;
}
}
Message reply = obtainMessage(EVENT_SEND_SMS_COMPLETE, tracker);
HashMap<String, Object> map = tracker.getData();
byte[] pdu = (byte[]) map.get("pdu");
byte[] smsc = (byte[]) map.get("smsc");
if (tracker.mRetryCount > 0) {
// and TP-MR is set to previously failed sms TP-MR
if (((0x01 & pdu[0]) == 0x01)) {
// TP-RD
pdu[0] |= 0x04;
// TP-MR
pdu[1] = (byte) tracker.mMessageRef;
}
}
// fall back to sending over CS.
if (0 == tracker.mImsRetry && !isIms() || tracker.mUsesImsServiceForIms) {
if (tracker.mRetryCount == 0 && tracker.mExpectMore) {
mCi.sendSMSExpectMore(IccUtils.bytesToHexString(smsc), IccUtils.bytesToHexString(pdu), reply);
} else {
mCi.sendSMS(IccUtils.bytesToHexString(smsc), IccUtils.bytesToHexString(pdu), reply);
}
} else {
mCi.sendImsGsmSms(IccUtils.bytesToHexString(smsc), IccUtils.bytesToHexString(pdu), tracker.mImsRetry, tracker.mMessageRef, reply);
// increment it here, so in case of SMS_FAIL_RETRY over IMS
// next retry will be sent using IMS request again.
tracker.mImsRetry++;
}
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhone method setCallWaiting.
@UnsupportedAppUsage
@Override
public void setCallWaiting(boolean enable, Message onComplete) {
int serviceClass = CommandsInterface.SERVICE_CLASS_VOICE;
CarrierConfigManager configManager = (CarrierConfigManager) getContext().getSystemService(Context.CARRIER_CONFIG_SERVICE);
PersistableBundle b = configManager.getConfigForSubId(getSubId());
if (b != null) {
serviceClass = b.getInt(CarrierConfigManager.KEY_CALL_WAITING_SERVICE_CLASS_INT, CommandsInterface.SERVICE_CLASS_VOICE);
}
setCallWaiting(enable, serviceClass, onComplete);
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhone method onMMIDone.
/**
* Removes the given MMI from the pending list and notifies
* registrants that it is complete.
* @param mmi MMI that is done
*/
@UnsupportedAppUsage
public void onMMIDone(ImsPhoneMmiCode mmi) {
/* Only notify complete if it's on the pending list.
* Otherwise, it's already been handled (eg, previously canceled).
* The exception is cancellation of an incoming USSD-REQUEST, which is
* not on the list.
*/
logd("onMMIDone: mmi=" + mmi);
if (mPendingMMIs.remove(mmi) || mmi.isUssdRequest() || mmi.isSsInfo()) {
ResultReceiver receiverCallback = mmi.getUssdCallbackReceiver();
if (receiverCallback != null) {
int returnCode = (mmi.getState() == MmiCode.State.COMPLETE) ? TelephonyManager.USSD_RETURN_SUCCESS : TelephonyManager.USSD_RETURN_FAILURE;
sendUssdResponse(mmi.getDialString(), mmi.getMessage(), returnCode, receiverCallback);
} else {
logv("onMMIDone: notifyRegistrants");
mMmiCompleteRegistrants.notifyRegistrants(new AsyncResult(null, mmi, null));
}
}
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class ImsPhoneCall method onHangupLocal.
// ***** Called from ImsPhoneCallTracker
/**
* Called when this Call is being hung up locally (eg, user pressed "end")
*/
@UnsupportedAppUsage
@VisibleForTesting
public void onHangupLocal() {
ArrayList<Connection> connections = getConnections();
for (Connection conn : connections) {
ImsPhoneConnection imsConn = (ImsPhoneConnection) conn;
imsConn.onHangupLocal();
}
synchronized (this) {
if (mState.isAlive()) {
mState = State.DISCONNECTING;
}
}
if (VDBG) {
Rlog.v(LOG_TAG, "onHangupLocal : " + mCallContext + " state = " + mState);
}
}
Aggregations