use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class GsmCdmaCallTracker method updatePhoneState.
@UnsupportedAppUsage
private void updatePhoneState() {
PhoneConstants.State oldState = mState;
if (mRingingCall.isRinging()) {
mState = PhoneConstants.State.RINGING;
} else if (mPendingMO != null || !(mForegroundCall.isIdle() && mBackgroundCall.isIdle())) {
mState = PhoneConstants.State.OFFHOOK;
} else {
Phone imsPhone = mPhone.getImsPhone();
if (mState == PhoneConstants.State.OFFHOOK && (imsPhone != null)) {
imsPhone.callEndCleanupHandOverCallIfAny();
}
mState = PhoneConstants.State.IDLE;
}
if (mState == PhoneConstants.State.IDLE && oldState != mState) {
mVoiceCallEndedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
} else if (oldState == PhoneConstants.State.IDLE && oldState != mState) {
mVoiceCallStartedRegistrants.notifyRegistrants(new AsyncResult(null, null, null));
}
if (Phone.DEBUG_PHONE) {
log("update phone state, old=" + oldState + " new=" + mState);
}
if (mState != oldState) {
mPhone.notifyPhoneStateChanged();
mMetrics.writePhoneState(mPhone.getPhoneId(), mState);
}
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class GsmCdmaConnection 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 GsmCdmaConnection method disconnectCauseFromCode.
/**
* Maps RIL call disconnect code to {@link DisconnectCause}.
* @param causeCode RIL disconnect code
* @return the corresponding value from {@link DisconnectCause}
*/
@UnsupportedAppUsage
int disconnectCauseFromCode(int causeCode) {
switch(causeCode) {
case CallFailCause.USER_BUSY:
return DisconnectCause.BUSY;
case CallFailCause.NO_CIRCUIT_AVAIL:
case CallFailCause.TEMPORARY_FAILURE:
case CallFailCause.SWITCHING_CONGESTION:
case CallFailCause.CHANNEL_NOT_AVAIL:
case CallFailCause.QOS_NOT_AVAIL:
case CallFailCause.BEARER_NOT_AVAIL:
return DisconnectCause.CONGESTION;
case CallFailCause.EMERGENCY_TEMP_FAILURE:
return DisconnectCause.EMERGENCY_TEMP_FAILURE;
case CallFailCause.EMERGENCY_PERM_FAILURE:
return DisconnectCause.EMERGENCY_PERM_FAILURE;
case CallFailCause.ACM_LIMIT_EXCEEDED:
return DisconnectCause.LIMIT_EXCEEDED;
case CallFailCause.OPERATOR_DETERMINED_BARRING:
case CallFailCause.CALL_BARRED:
return DisconnectCause.CALL_BARRED;
case CallFailCause.FDN_BLOCKED:
return DisconnectCause.FDN_BLOCKED;
case CallFailCause.IMEI_NOT_ACCEPTED:
return DisconnectCause.IMEI_NOT_ACCEPTED;
case CallFailCause.UNOBTAINABLE_NUMBER:
return DisconnectCause.UNOBTAINABLE_NUMBER;
case CallFailCause.DIAL_MODIFIED_TO_USSD:
return DisconnectCause.DIAL_MODIFIED_TO_USSD;
case CallFailCause.DIAL_MODIFIED_TO_SS:
return DisconnectCause.DIAL_MODIFIED_TO_SS;
case CallFailCause.DIAL_MODIFIED_TO_DIAL:
return DisconnectCause.DIAL_MODIFIED_TO_DIAL;
case CallFailCause.CDMA_LOCKED_UNTIL_POWER_CYCLE:
return DisconnectCause.CDMA_LOCKED_UNTIL_POWER_CYCLE;
case CallFailCause.CDMA_DROP:
return DisconnectCause.CDMA_DROP;
case CallFailCause.CDMA_INTERCEPT:
return DisconnectCause.CDMA_INTERCEPT;
case CallFailCause.CDMA_REORDER:
return DisconnectCause.CDMA_REORDER;
case CallFailCause.CDMA_SO_REJECT:
return DisconnectCause.CDMA_SO_REJECT;
case CallFailCause.CDMA_RETRY_ORDER:
return DisconnectCause.CDMA_RETRY_ORDER;
case CallFailCause.CDMA_ACCESS_FAILURE:
return DisconnectCause.CDMA_ACCESS_FAILURE;
case CallFailCause.CDMA_PREEMPTED:
return DisconnectCause.CDMA_PREEMPTED;
case CallFailCause.CDMA_NOT_EMERGENCY:
return DisconnectCause.CDMA_NOT_EMERGENCY;
case CallFailCause.CDMA_ACCESS_BLOCKED:
return DisconnectCause.CDMA_ACCESS_BLOCKED;
case CallFailCause.NORMAL_UNSPECIFIED:
return DisconnectCause.NORMAL_UNSPECIFIED;
case CallFailCause.USER_ALERTING_NO_ANSWER:
return DisconnectCause.TIMED_OUT;
case CallFailCause.ACCESS_CLASS_BLOCKED:
case CallFailCause.ERROR_UNSPECIFIED:
case CallFailCause.NORMAL_CLEARING:
default:
GsmCdmaPhone phone = mOwner.getPhone();
int serviceState = phone.getServiceState().getState();
UiccCardApplication cardApp = phone.getUiccCardApplication();
AppState uiccAppState = (cardApp != null) ? cardApp.getState() : AppState.APPSTATE_UNKNOWN;
if (serviceState == ServiceState.STATE_POWER_OFF) {
return DisconnectCause.POWER_OFF;
}
if (!isEmergencyCall()) {
// an OUT_OF_SERVICE disconnect cause during normal call ending.
if ((serviceState == ServiceState.STATE_OUT_OF_SERVICE || serviceState == ServiceState.STATE_EMERGENCY_ONLY)) {
return DisconnectCause.OUT_OF_SERVICE;
}
// locked the AppState will always not be equal to APPSTATE_READY.
if (uiccAppState != AppState.APPSTATE_READY) {
if (isPhoneTypeGsm()) {
return DisconnectCause.ICC_ERROR;
} else {
// CDMA
if (phone.mCdmaSubscriptionSource == CdmaSubscriptionSourceManager.SUBSCRIPTION_FROM_RUIM) {
return DisconnectCause.ICC_ERROR;
}
}
}
}
if (isPhoneTypeGsm()) {
if (causeCode == CallFailCause.ERROR_UNSPECIFIED || causeCode == CallFailCause.ACCESS_CLASS_BLOCKED) {
if (phone.mSST.mRestrictedState.isCsRestricted()) {
return DisconnectCause.CS_RESTRICTED;
} else if (phone.mSST.mRestrictedState.isCsEmergencyRestricted()) {
return DisconnectCause.CS_RESTRICTED_EMERGENCY;
} else if (phone.mSST.mRestrictedState.isCsNormalRestricted()) {
return DisconnectCause.CS_RESTRICTED_NORMAL;
}
}
}
if (causeCode == CallFailCause.NORMAL_CLEARING) {
return DisconnectCause.NORMAL;
}
// to app, not NORMAL call end.
return DisconnectCause.ERROR_UNSPECIFIED;
}
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class CallManager method getActiveFgCall.
@UnsupportedAppUsage
public Call getActiveFgCall(int subId) {
Call call = getFirstNonIdleCall(mForegroundCalls, subId);
if (call == null) {
Phone phone = getPhone(subId);
call = (phone == null) ? null : phone.getForegroundCall();
}
return call;
}
use of android.compat.annotation.UnsupportedAppUsage in project android_frameworks_opt_telephony by LineageOS.
the class SubscriptionController method notifySubscriptionInfoChanged.
/**
* Notify the changed of subscription info.
*/
@UnsupportedAppUsage
public void notifySubscriptionInfoChanged() {
TelephonyRegistryManager trm = (TelephonyRegistryManager) mContext.getSystemService(Context.TELEPHONY_REGISTRY_SERVICE);
if (DBG)
logd("notifySubscriptionInfoChanged:");
trm.notifySubscriptionInfoChanged();
// FIXME: Remove if listener technique accepted.
broadcastSimInfoContentChanged();
MultiSimSettingController.getInstance().notifySubscriptionInfoChanged();
TelephonyMetrics metrics = TelephonyMetrics.getInstance();
List<SubscriptionInfo> subInfos;
synchronized (mSubInfoListLock) {
subInfos = new ArrayList<>(mCacheActiveSubInfoList);
}
if (mOpptSubInfoListChangedDirtyBit.getAndSet(false)) {
notifyOpportunisticSubscriptionInfoChanged();
}
metrics.updateActiveSubscriptionInfoList(subInfos);
}
Aggregations