summaryrefslogtreecommitdiff
path: root/services/QualifiedNetworksService/src/com/android
diff options
context:
space:
mode:
authorsangyun <sangyun@google.com>2023-03-29 05:07:32 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-03-29 05:07:32 +0000
commite94d4e0d034b9d46e65e5049e61167e8e4920162 (patch)
tree814edad7bc454c59f8bb24ca5b643004e9cdd143 /services/QualifiedNetworksService/src/com/android
parent510f20e86b3133a98db06c15a7940387e7f6c2b2 (diff)
parentd1f737efc1d6f664f5dbaa36f09774d61d25c7e8 (diff)
downloadTelephony-e94d4e0d034b9d46e65e5049e61167e8e4920162.tar.gz
[QNS] Remove AlternativeEventListener & Provider am: 27d15968aa am: d1f737efc1
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Telephony/+/22215374 Change-Id: I1e66ecc2d6bedd9d16d2fb5fcbd40a5326be3793 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'services/QualifiedNetworksService/src/com/android')
-rw-r--r--services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java3
-rw-r--r--services/QualifiedNetworksService/src/com/android/telephony/qns/AlternativeEventListener.java501
-rw-r--r--services/QualifiedNetworksService/src/com/android/telephony/qns/AlternativeEventProvider.java159
-rw-r--r--services/QualifiedNetworksService/src/com/android/telephony/qns/QnsComponents.java17
4 files changed, 0 insertions, 680 deletions
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java
index e8a742d..098820a 100644
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java
+++ b/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java
@@ -85,7 +85,6 @@ class AccessNetworkEvaluator {
protected IwlanNetworkStatusTracker mIwlanNetworkStatusTracker;
protected DataConnectionStatusTracker mDataConnectionStatusTracker;
protected QnsEventDispatcher mQnsEventDispatcher;
- protected AlternativeEventListener mAltEventListener;
protected QnsCallStatusTracker mCallStatusTracker;
protected QnsProvisioningListener mQnsProvisioningListener;
protected QnsImsManager mQnsImsManager;
@@ -149,7 +148,6 @@ class AccessNetworkEvaluator {
Executor executor = new QnsUtils.QnsExecutor(mHandler);
mConfigManager = mQnsComponents.getQnsCarrierConfigManager(mSlotIndex);
- mAltEventListener = mQnsComponents.getAlternativeEventListener(mSlotIndex);
mCallStatusTracker = mQnsComponents.getQnsCallStatusTracker(mSlotIndex);
mQnsProvisioningListener = mQnsComponents.getQnsProvisioningListener(mSlotIndex);
mIwlanNetworkStatusTracker = mQnsComponents.getIwlanNetworkStatusTracker();
@@ -216,7 +214,6 @@ class AccessNetworkEvaluator {
mIwlanNetworkStatusTracker = mQnsComponents.getIwlanNetworkStatusTracker();
mDataConnectionStatusTracker = dataConnectionStatusTracker;
mQnsEventDispatcher = mQnsComponents.getQnsEventDispatcher(mSlotIndex);
- mAltEventListener = mQnsComponents.getAlternativeEventListener(mSlotIndex);
mCallStatusTracker = mQnsComponents.getQnsCallStatusTracker(mSlotIndex);
mQnsProvisioningListener = mQnsComponents.getQnsProvisioningListener(mSlotIndex);
mQnsImsManager = mQnsComponents.getQnsImsManager(mSlotIndex);
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/AlternativeEventListener.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/AlternativeEventListener.java
deleted file mode 100644
index 36fdaa4..0000000
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/AlternativeEventListener.java
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.telephony.qns;
-
-import static android.telephony.PreciseCallState.PRECISE_CALL_STATE_ACTIVE;
-import static android.telephony.PreciseCallState.PRECISE_CALL_STATE_ALERTING;
-import static android.telephony.PreciseCallState.PRECISE_CALL_STATE_DIALING;
-import static android.telephony.PreciseCallState.PRECISE_CALL_STATE_DISCONNECTED;
-import static android.telephony.PreciseCallState.PRECISE_CALL_STATE_HOLDING;
-import static android.telephony.PreciseCallState.PRECISE_CALL_STATE_IDLE;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.content.Context;
-import android.net.NetworkCapabilities;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-import android.telephony.Annotation;
-import android.telephony.PreciseDataConnectionState;
-import android.telephony.TelephonyManager;
-import android.util.Log;
-import android.util.SparseArray;
-
-import com.android.internal.annotations.VisibleForTesting;
-
-class AlternativeEventListener {
- private static final int EVENT_SRVCC_STATE_CHANGED = 13001;
- private static final SparseArray<AlternativeEventListener> sAlternativeInterfaceManager =
- new SparseArray<>();
- private final String mLogTag;
- private Context mContext;
- private int mSlotIndex;
- private QnsTelephonyListener mQnsTelephonyListener;
- private QnsRegistrant mCallTypeChangedEventListener;
- private QnsRegistrant mEmergencyCallTypeChangedEventListener;
- private QnsRegistrant mEmergencyPreferredTransportTypeChanged;
- private QnsRegistrant mTryWfcConnectionState;
- private QnsRegistrant mLowRtpQuallityListener;
- private QnsRegistrant mEmcLowRtpQuallityListener;
- private AlternativeEventCb mEventCb;
- private AlternativeEventProvider mEventProvider;
- private Handler mHandler;
- private CallInfoManager mCallInfoManager = new CallInfoManager();
-
- class CallInfo {
- int mId;
- int mType;
- int mState;
-
- CallInfo(int id, int type, int state) {
- mId = id;
- mType = type;
- mState = state;
- }
- }
-
- /** Manager of CallInfo list. */
- private class CallInfoManager {
- private SparseArray<CallInfo> mCallInfos = new SparseArray<>();
- QnsCarrierConfigManager.RtpMetricsConfig mRtpMetricsConfig;
- int mEmergencyCallState = PRECISE_CALL_STATE_IDLE;
- int mLastReportedCallType = QnsConstants.CALL_TYPE_IDLE;
-
- CallInfoManager() {
- mRtpMetricsConfig = null;
- }
-
- void updateCallInfo(
- int id,
- @QnsConstants.QnsCallType int type,
- @Annotation.PreciseCallStates int state) {
- if (mRtpMetricsConfig != null && state == PRECISE_CALL_STATE_ACTIVE) {
- requestRtpThreshold(mRtpMetricsConfig);
- }
- if (type == QnsConstants.CALL_TYPE_EMERGENCY) {
- mEmergencyCallState = state;
- return;
- }
- if (type == QnsConstants.CALL_TYPE_VIDEO || type == QnsConstants.CALL_TYPE_VOICE) {
- CallInfo info = mCallInfos.get(id);
- if (info == null) {
- if (state == PRECISE_CALL_STATE_ACTIVE) {
- mCallInfos.put(id, new CallInfo(id, type, state));
- log("add callinfo with id " + id);
- }
- } else {
- if (info.mType != type) {
- log("CallId[" + info.mId + "] type changed " + info.mType + " > " + id);
- info.mType = type;
- }
- if (state == PRECISE_CALL_STATE_HOLDING) {
- log("CallId[" + info.mId + "] changed to HOLDING ");
- info.mState = state;
- } else if (state == PRECISE_CALL_STATE_ACTIVE) {
- log("CallId[" + info.mId + "] changed to ACTIVE ");
- info.mState = state;
- } else if (state == PRECISE_CALL_STATE_DISCONNECTED) {
- log("delete callInfo callId:" + id);
- mCallInfos.remove(id);
- }
- }
- }
- }
-
- boolean isCallIdle() {
- return mCallInfos.size() == 0;
- }
-
- CallInfo getActiveCallInfo() {
- for (int i = 0; i < mCallInfos.size(); i++) {
- int key = mCallInfos.keyAt(i);
- if (mCallInfos.get(key).mState == PRECISE_CALL_STATE_ACTIVE) {
- return mCallInfos.get(key);
- }
- }
- return null;
- }
-
- void clearCallInfo() {
- mCallInfos.clear();
- }
-
- boolean hasVideoCall() {
- for (int i = 0; i < mCallInfos.size(); i++) {
- int key = mCallInfos.keyAt(i);
- if (mCallInfos.get(key).mType == QnsConstants.CALL_TYPE_VIDEO) {
- return true;
- }
- }
- return false;
- }
-
- void requestRtpThreshold(QnsCarrierConfigManager.RtpMetricsConfig config) {
- if (config != null) {
- mRtpMetricsConfig =
- new QnsCarrierConfigManager.RtpMetricsConfig(
- config.mJitter,
- config.mPktLossRate,
- config.mPktLossTime,
- config.mNoRtpInterval);
- }
- CallInfo info = getActiveCallInfo();
- if (mEventProvider != null && info != null) {
- log("requestRtpThreshold callId:" + info.mId + " " + config.toString());
- mEventProvider.requestRtpThreshold(
- info.mId,
- mRtpMetricsConfig.mJitter,
- mRtpMetricsConfig.mPktLossRate,
- mRtpMetricsConfig.mPktLossTime,
- mRtpMetricsConfig.mNoRtpInterval);
- }
- }
- }
-
- class MessageHandler extends Handler {
- MessageHandler(Looper l) {
- super(l);
- }
-
- @Override
- public void handleMessage(Message message) {
- Log.d(mLogTag, "handleMessage msg=" + message.what);
- QnsAsyncResult ar = (QnsAsyncResult) message.obj;
- int state = (int) ar.mResult;
- switch (message.what) {
- case EVENT_SRVCC_STATE_CHANGED:
- onSrvccStateChanged(state);
- break;
- default:
- Log.d(mLogTag, "Unknown message received!");
- break;
- }
- }
- }
-
- /**
- * AlternativeEventListener constructor.
- */
- AlternativeEventListener(
- Context context, QnsTelephonyListener qnsTelephonyListener, int slotId) {
- mSlotIndex = slotId;
- mLogTag =
- QnsConstants.QNS_TAG
- + "_"
- + AlternativeEventListener.class.getSimpleName()
- + "_"
- + mSlotIndex;
- mContext = context;
- mQnsTelephonyListener = qnsTelephonyListener;
- mHandler = new AlternativeEventListener.MessageHandler(mContext.getMainLooper());
- mEventCb = new AlternativeEventCb();
- }
-
- /**
- * register emergency preferred transport type changed event.
- *
- * @param h Handler want to receive event.
- * @param what event Id to receive
- * @param userObj user object
- */
- void registerEmergencyPreferredTransportTypeChanged(
- @NonNull Handler h, int what, Object userObj) {
- mEmergencyPreferredTransportTypeChanged = new QnsRegistrant(h, what, userObj);
- }
-
- /** Unregister emergency preferred transport type changed event. */
- void unregisterEmergencyPreferredTransportTypeChanged() {
- mEmergencyPreferredTransportTypeChanged = null;
- }
-
- /**
- * register try WFC connection state change event.
- *
- * @param h Handler want to receive event
- * @param what event Id to receive
- * @param userObj user object
- */
- void registerTryWfcConnectionStateListener(@NonNull Handler h, int what, Object userObj) {
- mTryWfcConnectionState = new QnsRegistrant(h, what, userObj);
- }
-
- /**
- * Register low RTP quality event.
- *
- * @param netCapability Network Capability
- * @param h Handler want to receive event.
- * @param what event Id to receive
- * @param userObj user object
- */
- void registerLowRtpQualityEvent(
- int netCapability,
- @NonNull Handler h,
- int what,
- Object userObj,
- QnsCarrierConfigManager.RtpMetricsConfig config) {
- if (h != null) {
- QnsRegistrant r = new QnsRegistrant(h, what, userObj);
- if (netCapability == NetworkCapabilities.NET_CAPABILITY_IMS) {
- mLowRtpQuallityListener = r;
- } else if (netCapability == NetworkCapabilities.NET_CAPABILITY_EIMS) {
- mEmcLowRtpQuallityListener = r;
- }
- if (mEventProvider != null) {
- mCallInfoManager.requestRtpThreshold(config);
- }
- }
- }
-
- /**
- * Unregister low RTP quality event.
- *
- * @param netCapability Network Capability
- * @param h Handler want to receive event.
- */
- void unregisterLowRtpQualityEvent(int netCapability, @NonNull Handler h) {
- if (netCapability == NetworkCapabilities.NET_CAPABILITY_IMS) {
- mLowRtpQuallityListener = null;
- } else if (netCapability == NetworkCapabilities.NET_CAPABILITY_EIMS) {
- mEmcLowRtpQuallityListener = null;
- }
- mCallInfoManager.mRtpMetricsConfig = null;
- }
-
- /**
- * register call type changed event.
- *
- * @param netCapability Network Capability of caller
- * @param h Handler want to receive event.
- * @param what event Id to receive
- * @param userObj user object
- */
- void registerCallTypeChangedListener(
- int netCapability, @NonNull Handler h, int what, Object userObj) {
- if (netCapability != NetworkCapabilities.NET_CAPABILITY_IMS
- && netCapability != NetworkCapabilities.NET_CAPABILITY_EIMS) {
- log("registerCallTypeChangedListener : wrong netCapability");
- return;
- }
- if (h != null) {
- QnsRegistrant r = new QnsRegistrant(h, what, userObj);
- if (netCapability == NetworkCapabilities.NET_CAPABILITY_IMS) {
- mCallTypeChangedEventListener = r;
- mQnsTelephonyListener.registerSrvccStateListener(
- mHandler, EVENT_SRVCC_STATE_CHANGED, null);
- } else if (netCapability == NetworkCapabilities.NET_CAPABILITY_EIMS) {
- mEmergencyCallTypeChangedEventListener = r;
- }
- } else {
- log("registerCallTypeChangedListener : Handler is Null");
- }
- }
-
- /**
- * Unregister call type changed event.
- *
- * @param netCapability Network Capability of caller
- * @param h Handler want to receive event.
- */
- void unregisterCallTypeChangedListener(int netCapability, @NonNull Handler h) {
- if (netCapability != NetworkCapabilities.NET_CAPABILITY_IMS
- && netCapability != NetworkCapabilities.NET_CAPABILITY_EIMS) {
- log("unregisterCallTypeChangedListener : wrong netCapability");
- return;
- }
- if (h != null) {
- if (netCapability == NetworkCapabilities.NET_CAPABILITY_IMS) {
- mCallTypeChangedEventListener = null;
- mQnsTelephonyListener.unregisterSrvccStateChanged(mHandler);
- } else if (netCapability == NetworkCapabilities.NET_CAPABILITY_EIMS) {
- mEmergencyCallTypeChangedEventListener = null;
- }
- } else {
- log("unregisterCallTypeChangedListener : Handler is Null");
- }
- }
-
- /**
- * register EventProvider to EventListener
- *
- * @param provider extends of AlternativeEventProvider
- */
- void setEventProvider(AlternativeEventProvider provider) {
- log("setEventProvider provider " + provider);
- mEventProvider = provider;
- provider.registerCallBack(mEventCb);
- }
-
- @VisibleForTesting
- void onSrvccStateChanged(int srvccState) {
- if (srvccState == TelephonyManager.SRVCC_STATE_HANDOVER_COMPLETED) {
- mCallInfoManager.clearCallInfo();
- int callType = QnsConstants.CALL_TYPE_IDLE;
- mCallTypeChangedEventListener.notifyResult(callType);
- }
- }
-
- void clearNormalCallInfo() {
- mCallInfoManager.clearCallInfo();
- mCallInfoManager.mLastReportedCallType = QnsConstants.CALL_TYPE_IDLE;
- unregisterLowRtpQualityEvent(NetworkCapabilities.NET_CAPABILITY_IMS, null);
- }
-
- @VisibleForTesting
- void notifyRtpLowQuality(int callType, int reason) {
- if (callType == QnsConstants.CALL_TYPE_VOICE) {
- if (mLowRtpQuallityListener != null) {
- mLowRtpQuallityListener.notifyResult(reason);
- } else {
- log("notifyRtpLowQuality mLowRtpQuallityListener is null.");
- }
- } else if (callType == QnsConstants.CALL_TYPE_EMERGENCY) {
- if (mEmcLowRtpQuallityListener != null) {
- mEmcLowRtpQuallityListener.notifyResult(reason);
- } else {
- log("notifyRtpLowQuality mEmcLowRtpQuallityListener is null.");
- }
- if (mCallInfoManager.mLastReportedCallType == QnsConstants.CALL_TYPE_EMERGENCY) {
- if (mLowRtpQuallityListener != null) {
- log("notifyRtpLowQuality for emergency call to IMS ANE");
- mLowRtpQuallityListener.notifyResult(reason);
- } else {
- log("notifyRtpLowQuality mLowRtpQuallityListener is null.");
- }
- }
- }
- }
-
- class AlternativeEventCb implements AlternativeEventProvider.EventCallback {
- @Override
- public void onCallInfoChanged(
- int id,
- @QnsConstants.QnsCallType int type,
- @Annotation.PreciseCallStates int state) {
- log("onCallInfoChanged callId" + id + " type" + type + " state" + state);
-
- mCallInfoManager.updateCallInfo(id, type, state);
- if (type == QnsConstants.CALL_TYPE_EMERGENCY) {
- if (mEmergencyCallTypeChangedEventListener != null) {
- if (state == PRECISE_CALL_STATE_DISCONNECTED) {
- mEmergencyCallTypeChangedEventListener.notifyResult(
- QnsConstants.CALL_TYPE_IDLE);
- } else if (state == PRECISE_CALL_STATE_ACTIVE) {
- mEmergencyCallTypeChangedEventListener.notifyResult(
- QnsConstants.CALL_TYPE_EMERGENCY);
- }
- }
- if (mCallTypeChangedEventListener != null) {
- if ((state == PRECISE_CALL_STATE_ACTIVE
- || state == PRECISE_CALL_STATE_DIALING
- || state == PRECISE_CALL_STATE_ALERTING)
- && !isDataNetworkConnected(NetworkCapabilities.NET_CAPABILITY_EIMS)
- && isDataNetworkConnected(NetworkCapabilities.NET_CAPABILITY_IMS)) {
- log("Emergency call is progressing without emergency PDN");
- if (mCallInfoManager.mLastReportedCallType
- != QnsConstants.CALL_TYPE_EMERGENCY) {
- mCallTypeChangedEventListener.notifyResult(
- QnsConstants.CALL_TYPE_EMERGENCY);
- mCallInfoManager.mLastReportedCallType =
- QnsConstants.CALL_TYPE_EMERGENCY;
- }
- } else if (state == PRECISE_CALL_STATE_DISCONNECTED) {
- log("Emergency call disconnected");
- if (mCallInfoManager.mLastReportedCallType
- == QnsConstants.CALL_TYPE_EMERGENCY) {
- mCallTypeChangedEventListener.notifyResult(QnsConstants.CALL_TYPE_IDLE);
- mCallInfoManager.mLastReportedCallType = QnsConstants.CALL_TYPE_IDLE;
- }
- }
- }
- return;
- }
- if (mCallTypeChangedEventListener != null) {
- int callType = QnsConstants.CALL_TYPE_IDLE;
- if (mCallInfoManager.isCallIdle()) {
- callType = QnsConstants.CALL_TYPE_IDLE;
- } else if (mCallInfoManager.hasVideoCall()) {
- callType = QnsConstants.CALL_TYPE_VIDEO;
- } else {
- callType = QnsConstants.CALL_TYPE_VOICE;
- }
- if (mCallTypeChangedEventListener != null
- && mCallInfoManager.mLastReportedCallType != callType) {
- mCallTypeChangedEventListener.notifyResult(callType);
- mCallInfoManager.mLastReportedCallType = callType;
- }
- }
- }
-
- @Override
- public void onVoiceRtpLowQuality(@QnsConstants.RtpLowQualityReason int reason) {
- if (mCallInfoManager.mEmergencyCallState == PRECISE_CALL_STATE_ACTIVE) {
- notifyRtpLowQuality(QnsConstants.CALL_TYPE_EMERGENCY, reason);
- } else if (!mCallInfoManager.isCallIdle() && !mCallInfoManager.hasVideoCall()) {
- notifyRtpLowQuality(QnsConstants.CALL_TYPE_VOICE, reason);
- }
- }
-
- @Override
- public void onEmergencyPreferenceChanged(int preferredTransportType) {
- if (mEmergencyPreferredTransportTypeChanged != null) {
- mEmergencyPreferredTransportTypeChanged.notifyResult(preferredTransportType);
- }
- }
-
- @Override
- public void onTryWfcConnectionStateChanged(boolean isEnabled) {
- mTryWfcConnectionState.notifyResult(isEnabled);
- }
- }
-
- protected boolean isIdleState() {
- return mCallInfoManager.isCallIdle();
- }
-
- protected void setEcnoSignalThreshold(@Nullable int[] threshold) {
- if (mEventProvider != null) {
- mEventProvider.setEcnoSignalThreshold(threshold);
- }
- }
-
- private boolean isDataNetworkConnected(int netCapability) {
- PreciseDataConnectionState preciseDataStatus =
- mQnsTelephonyListener.getLastPreciseDataConnectionState(netCapability);
-
- if (preciseDataStatus == null) return false;
- int state = preciseDataStatus.getState();
- return (state == TelephonyManager.DATA_CONNECTED
- || state == TelephonyManager.DATA_HANDOVER_IN_PROGRESS
- || state == TelephonyManager.DATA_SUSPENDED);
- }
-
- @VisibleForTesting
- protected void close() {
- mCallTypeChangedEventListener = null;
- mEmergencyCallTypeChangedEventListener = null;
- mEmergencyPreferredTransportTypeChanged = null;
- mTryWfcConnectionState = null;
- mLowRtpQuallityListener = null;
- mEmcLowRtpQuallityListener = null;
- sAlternativeInterfaceManager.remove(mSlotIndex);
- }
-
- protected void log(String s) {
- Log.d(mLogTag, s);
- }
-}
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/AlternativeEventProvider.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/AlternativeEventProvider.java
deleted file mode 100644
index b2ef78d..0000000
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/AlternativeEventProvider.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Copyright (C) 2021 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.telephony.qns;
-
-import android.annotation.NonNull;
-import android.annotation.Nullable;
-import android.telephony.AccessNetworkConstants;
-import android.telephony.Annotation;
-import android.util.Log;
-
-/** AlternativeEventProvider class */
-public abstract class AlternativeEventProvider {
- private EventCallback mEventCb;
- private final String mLogTag;
-
- public AlternativeEventProvider(AlternativeEventListener altEventListener, int slotId) {
- mLogTag =
- QnsConstants.QNS_TAG
- + "_"
- + AlternativeEventProvider.class.getSimpleName()
- + "_"
- + slotId;
- altEventListener.setEventProvider(this);
- }
-
- /**
- * Thins is to register RTP threshold.
- *
- * @param callId CallId
- * @param jitter RTP jitter value
- * @param packetLossRate RTP packet loss rate
- * @param packetLossTimeInMilliSec timer for RTP packet loss
- * @param noRtpTimeInMilliSec time for no incoming RTP
- */
- public abstract void requestRtpThreshold(
- int callId,
- int jitter,
- int packetLossRate,
- int packetLossTimeInMilliSec,
- int noRtpTimeInMilliSec);
-
- /**
- * This is to set signal strength threshold.
- *
- * @param threshold signal strength threshold values
- */
- public abstract void setEcnoSignalThreshold(@Nullable int[] threshold);
-
- /**
- * Event provider calls this to notify call info changed.
- *
- * @param id CallId
- * @param type CallType
- * @param state CallState
- */
- public void notifyCallInfo(int id, int type, int state) {
- if (mEventCb != null) {
- mEventCb.onCallInfoChanged(id, type, state);
- }
- }
-
- /**
- * Event provider calls this to notify RTP low quality
- *
- * @param reason RTP low quality reason.
- */
- public void notifyRtpLowQuality(@QnsConstants.RtpLowQualityReason int reason) {
- if (mEventCb != null) {
- mEventCb.onVoiceRtpLowQuality(reason);
- }
- }
-
- /**
- * Event provider needs to call this to notify Emergency preference change
- *
- * @param type Emergency transport type preference for initial data connection.
- */
- public void notifyEmergencyPreferredTransportType(
- @AccessNetworkConstants.TransportType int type) {
- if (mEventCb != null) {
- mEventCb.onEmergencyPreferenceChanged(type);
- }
- }
-
- /**
- * Event provider needs to call this to notify try WFC connection state change
- *
- * @param isEnabled try WFC connection
- */
- public void notifyTryWfcConnectionState(boolean isEnabled) {
- if (mEventCb != null) {
- mEventCb.onTryWfcConnectionStateChanged(isEnabled);
- }
- }
-
- /**
- * Listener need to register CallBack with implements of EventCallback.
- *
- * @param eventCb implements of EventCallback.
- */
- public void registerCallBack(@NonNull EventCallback eventCb) {
- log("registerCallBack" + eventCb);
- mEventCb = eventCb;
- }
-
- /** Event callback for call related item */
- public interface EventCallback {
- /**
- * call type event notification.
- *
- * @param id CallId
- * @param type CallType
- * @param state CallState
- */
- void onCallInfoChanged(
- int id,
- @QnsConstants.QnsCallType int type,
- @Annotation.PreciseCallStates int state);
-
- /**
- * RTP event notification.
- *
- * @param reason reason for RTP low quality
- */
- void onVoiceRtpLowQuality(@QnsConstants.RtpLowQualityReason int reason);
-
- /**
- * Notify Emergency Transport Type Preference for initial connect.
- *
- * @param transport Transport Type
- */
- void onEmergencyPreferenceChanged(@AccessNetworkConstants.TransportType int transport);
-
- /**
- * Try WFC connection state change notification.
- *
- * @param isEnabled flag value for WFC connection state change notification
- */
- void onTryWfcConnectionStateChanged(boolean isEnabled);
- }
-
- protected void log(String s) {
- Log.d(mLogTag, s);
- }
-}
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsComponents.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsComponents.java
index d4bf447..5862bc2 100644
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsComponents.java
+++ b/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsComponents.java
@@ -34,7 +34,6 @@ class QnsComponents {
private final String mLogTag = QnsComponents.class.getSimpleName();
private final Context mContext;
- private final SparseArray<AlternativeEventListener> mAlternativeEventListeners;
private final SparseArray<CellularNetworkStatusTracker> mCellularNetworkStatusTrackers;
private final SparseArray<CellularQualityMonitor> mCellularQualityMonitors;
private final SparseArray<QnsImsManager> mQnsImsManagers;
@@ -53,7 +52,6 @@ class QnsComponents {
/** Constructor to instantiate QnsComponents class. */
QnsComponents(Context context) {
mContext = context;
- mAlternativeEventListeners = new SparseArray<>();
mCellularNetworkStatusTrackers = new SparseArray<>();
mCellularQualityMonitors = new SparseArray<>();
mQnsImsManagers = new SparseArray<>();
@@ -71,9 +69,6 @@ class QnsComponents {
mSlotIds.add(slotId);
mQnsTelephonyListeners.put(slotId, new QnsTelephonyListener(mContext, slotId));
mQnsImsManagers.put(slotId, new QnsImsManager(mContext, slotId));
- mAlternativeEventListeners.put(
- slotId,
- new AlternativeEventListener(mContext, mQnsTelephonyListeners.get(slotId), slotId));
mCellularNetworkStatusTrackers.put(
slotId,
new CellularNetworkStatusTracker(mQnsTelephonyListeners.get(slotId), slotId));
@@ -135,7 +130,6 @@ class QnsComponents {
@VisibleForTesting
QnsComponents(
Context context,
- AlternativeEventListener alternativeEventListener,
CellularNetworkStatusTracker cellularNetworkStatusTracker,
CellularQualityMonitor cellularQualityMonitor,
IwlanNetworkStatusTracker iwlanNetworkStatusTracker,
@@ -154,7 +148,6 @@ class QnsComponents {
mSlotIds.add(slotId);
mQnsTelephonyListeners.put(slotId, qnsTelephonyListener);
mQnsImsManagers.put(slotId, qnsImsManager);
- mAlternativeEventListeners.put(slotId, alternativeEventListener);
mCellularNetworkStatusTrackers.put(slotId, cellularNetworkStatusTracker);
mCellularQualityMonitors.put(slotId, cellularQualityMonitor);
mQnsCallStatusTracker.put(slotId, qnsCallStatusTracker);
@@ -176,11 +169,6 @@ class QnsComponents {
mQnsMetrics = qnsMetrics;
}
- /** Returns instance of AlternativeEventListener for given slotId. */
- AlternativeEventListener getAlternativeEventListener(int slotId) {
- return mAlternativeEventListeners.get(slotId);
- }
-
/** Returns instance of CellularNetworkStatusTracker for given slotId. */
CellularNetworkStatusTracker getCellularNetworkStatusTracker(int slotId) {
return mCellularNetworkStatusTrackers.get(slotId);
@@ -303,11 +291,6 @@ class QnsComponents {
mCellularNetworkStatusTrackers.remove(slotId);
cellularTracker.close();
}
- AlternativeEventListener alternativeEventListener = mAlternativeEventListeners.get(slotId);
- if (alternativeEventListener != null) {
- mAlternativeEventListeners.remove(slotId);
- alternativeEventListener.close();
- }
QnsImsManager qnsImsManager = mQnsImsManagers.get(slotId);
if (qnsImsManager != null) {
mQnsImsManagers.remove(slotId);