summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNagendra Prasad Nagarle Basavaraju <nagendranb@google.com>2023-04-04 09:06:37 +0000
committerNagendra Prasad Nagarle Basavaraju <nagendranb@google.com>2023-04-05 07:36:56 +0000
commit0ec6955ec5a701034c1624e2ebf6be1aa08238a1 (patch)
tree7a27759c0e4aa4bfdab835dfebe77a99db8b6de6
parentccc00093b1e6240d47902040328c04205ace9e2d (diff)
downloadTelephony-0ec6955ec5a701034c1624e2ebf6be1aa08238a1.tar.gz
[HysteresisDB] Fix NullPointerException at CellularQualityMonitor
Bug: 276850662 Bug: 274605921 Test: atest QualifiedNetworksServiceTest Change-Id: I9d1d126e0112fe86d6f077ecb325f0f8976953a7
-rw-r--r--services/QualifiedNetworksService/src/com/android/telephony/qns/QnsComponents.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsComponents.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsComponents.java
index 5862bc2..0471ea8 100644
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsComponents.java
+++ b/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsComponents.java
@@ -72,12 +72,6 @@ class QnsComponents {
mCellularNetworkStatusTrackers.put(
slotId,
new CellularNetworkStatusTracker(mQnsTelephonyListeners.get(slotId), slotId));
- mCellularQualityMonitors.put(
- slotId,
- new CellularQualityMonitor(mContext,
- mQnsCarrierConfigManagers.get(slotId),
- mQnsTelephonyListeners.get(slotId),
- slotId));
mQnsProvisioningListeners.put(
slotId, new QnsProvisioningListener(mContext, mQnsImsManagers.get(slotId), slotId));
mQnsEventDispatchers.put(
@@ -90,6 +84,12 @@ class QnsComponents {
mQnsCarrierConfigManagers.put(
slotId,
new QnsCarrierConfigManager(mContext, mQnsEventDispatchers.get(slotId), slotId));
+ mCellularQualityMonitors.put(
+ slotId,
+ new CellularQualityMonitor(mContext,
+ mQnsCarrierConfigManagers.get(slotId),
+ mQnsTelephonyListeners.get(slotId),
+ slotId));
if (mQnsTimer == null) {
mQnsTimer = new QnsTimer(mContext);
}
@@ -266,6 +266,11 @@ class QnsComponents {
mQnsTimer.close();
mQnsTimer = null;
}
+ CellularQualityMonitor cellularQualityMonitor = mCellularQualityMonitors.get(slotId);
+ if (cellularQualityMonitor != null) {
+ mCellularQualityMonitors.remove(slotId);
+ cellularQualityMonitor.close();
+ }
QnsCarrierConfigManager qnsCarrierConfigManager = mQnsCarrierConfigManagers.get(slotId);
if (qnsCarrierConfigManager != null) {
mQnsCarrierConfigManagers.remove(slotId);
@@ -281,11 +286,6 @@ class QnsComponents {
mQnsProvisioningListeners.remove(slotId);
qnsProvisioningListener.close();
}
- CellularQualityMonitor cellularQualityMonitor = mCellularQualityMonitors.get(slotId);
- if (cellularQualityMonitor != null) {
- mCellularQualityMonitors.remove(slotId);
- cellularQualityMonitor.close();
- }
CellularNetworkStatusTracker cellularTracker = mCellularNetworkStatusTrackers.get(slotId);
if (cellularTracker != null) {
mCellularNetworkStatusTrackers.remove(slotId);