diff options
author | Roshan Pius <rpius@google.com> | 2022-05-23 15:42:33 +0000 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2022-05-23 15:42:50 +0000 |
commit | 5ce446c6901eb45b8ef7fd0a9d42b797d33b78d8 (patch) | |
tree | 1aca3efa5e0fc641f18056d9dfdae86afb57a96f | |
parent | 77b7c18509759890d9b506472caa174e91987ea4 (diff) | |
download | Uwb-5ce446c6901eb45b8ef7fd0a9d42b797d33b78d8.tar.gz |
uwb(service): Fix NPE when getAction() == null
Move the error/cb handling to inside the "if (getAction() != null)" block.
Bug: 231593229
Change-Id: I92ccd3b3ac30580e1aa6c0090f3bc7dab57da502
Test: atest ServiceUwbTests
-rw-r--r-- | service/java/com/android/server/uwb/UwbSessionManager.java | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/service/java/com/android/server/uwb/UwbSessionManager.java b/service/java/com/android/server/uwb/UwbSessionManager.java index 29a79fb0..76bae008 100644 --- a/service/java/com/android/server/uwb/UwbSessionManager.java +++ b/service/java/com/android/server/uwb/UwbSessionManager.java @@ -766,27 +766,26 @@ public class UwbSessionManager implements INativeUwbManager.SessionNotification } } } - } - if (status != UwbUciConstants.STATUS_CODE_OK) { + if (status != UwbUciConstants.STATUS_CODE_OK) { + if (rangingReconfigureParams.getAction() + == MULTICAST_LIST_UPDATE_ACTION_ADD) { + mSessionNotificationManager.onControleeAddFailed( + uwbSession, status); + } else if (rangingReconfigureParams.getAction() + == MULTICAST_LIST_UPDATE_ACTION_DELETE) { + mSessionNotificationManager.onControleeRemoveFailed( + uwbSession, status); + } + return status; + } if (rangingReconfigureParams.getAction() == MULTICAST_LIST_UPDATE_ACTION_ADD) { - mSessionNotificationManager.onControleeAddFailed( - uwbSession, status); + mSessionNotificationManager.onControleeAdded(uwbSession); } else if (rangingReconfigureParams.getAction() == MULTICAST_LIST_UPDATE_ACTION_DELETE) { - mSessionNotificationManager.onControleeRemoveFailed( - uwbSession, status); + mSessionNotificationManager.onControleeRemoved(uwbSession); } - return status; } - if (rangingReconfigureParams.getAction() - == MULTICAST_LIST_UPDATE_ACTION_ADD) { - mSessionNotificationManager.onControleeAdded(uwbSession); - } else if (rangingReconfigureParams.getAction() - == MULTICAST_LIST_UPDATE_ACTION_DELETE) { - mSessionNotificationManager.onControleeRemoved(uwbSession); - } - status = mConfigurationManager.setAppConfigurations( uwbSession.getSessionId(), param); Log.d(TAG, "status: " + status); |