diff options
| author | 2022-08-25 02:10:35 +0000 | |
|---|---|---|
| committer | 2022-08-25 02:10:35 +0000 | |
| commit | 1431a34c9293b31dae3eebddb1db4dcea98cd17c (patch) | |
| tree | 552607824adcbfd02ebf84f0bc1721d6650cf51e | |
| parent | 8031738eb32203adf59a6d9d81545351b94f5871 (diff) | |
| parent | 6a9fa605e180d027c67c3c9a3f6000540e4373c9 (diff) | |
Merge "Ensure that onCellInfo is always NonNull" am: b4be2f450b am: c6111dff5b am: 6a9fa605e1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2190535
Change-Id: Id66d739808e1c6243bb7516dcab7b9c52842e012
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | services/core/java/com/android/server/TelephonyRegistry.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 2fedc99a400c..c5c45534d338 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -339,7 +339,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { private int[] mDataConnectionNetworkType; - private ArrayList<List<CellInfo>> mCellInfo = null; + private ArrayList<List<CellInfo>> mCellInfo; private Map<Integer, List<EmergencyNumber>> mEmergencyNumberList; @@ -725,7 +725,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { mMessageWaiting[i] = false; mCallForwarding[i] = false; mCellIdentity[i] = null; - mCellInfo.add(i, null); + mCellInfo.add(i, Collections.EMPTY_LIST); mImsReasonInfo.add(i, null); mSrvccState[i] = TelephonyManager.SRVCC_STATE_HANDOVER_NONE; mCallDisconnectCause[i] = DisconnectCause.NOT_VALID; @@ -802,7 +802,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { mCallNetworkType = new int[numPhones]; mCallAttributes = new CallAttributes[numPhones]; mPreciseDataConnectionStates = new ArrayList<>(); - mCellInfo = new ArrayList<>(); + mCellInfo = new ArrayList<>(numPhones); mImsReasonInfo = new ArrayList<>(); mEmergencyNumberList = new HashMap<>(); mOutgoingCallEmergencyNumber = new EmergencyNumber[numPhones]; @@ -832,7 +832,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { mMessageWaiting[i] = false; mCallForwarding[i] = false; mCellIdentity[i] = null; - mCellInfo.add(i, null); + mCellInfo.add(i, Collections.EMPTY_LIST); mImsReasonInfo.add(i, null); mSrvccState[i] = TelephonyManager.SRVCC_STATE_HANDOVER_NONE; mCallDisconnectCause[i] = DisconnectCause.NOT_VALID; @@ -1794,10 +1794,17 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { if (!checkNotifyPermission("notifyCellInfoForSubscriber()")) { return; } + if (VDBG) { log("notifyCellInfoForSubscriber: subId=" + subId + " cellInfo=" + cellInfo); } + + if (cellInfo == null) { + loge("notifyCellInfoForSubscriber() received a null list"); + cellInfo = Collections.EMPTY_LIST; + } + int phoneId = getPhoneIdFromSubId(subId); synchronized (mRecords) { if (validatePhoneId(phoneId)) { |