Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 275f323e authored by Etan Cohen's avatar Etan Cohen
Browse files

[AWARE] Minor hardening of manager.

Callbacks are possible even if no listener was defined.
Perform a check and print error (as opposed to crashing).

Bug: 32315992
Test: unit-tests + integration tests passing
Change-Id: Ia5eb81448ace6b88abcd448e4f378da6530ac630
parent 06aed695
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -706,7 +706,11 @@ public class WifiAwareManager {
                            attachCallback.onAttachFailed();
                            break;
                        case CALLBACK_IDENTITY_CHANGED:
                            if (identityChangedListener == null) {
                                Log.e(TAG, "CALLBACK_IDENTITY_CHANGED: null listener.");
                            } else {
                                identityChangedListener.onIdentityChanged((byte[]) msg.obj);
                            }
                            break;
                        case CALLBACK_RANGING_SUCCESS: {
                            RttManager.RttListener listener = getAndRemoveRangingListener(msg.arg1);