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

Commit 1abf6ff5 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[AWARE][RTT] Check for null callback registration"

parents 26f27074 b7abd810
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -269,6 +269,10 @@ public class WifiAwareManager {
                    + identityChangedListener);
        }

        if (attachCallback == null) {
            throw new IllegalArgumentException("Null callback provided");
        }

        synchronized (mLock) {
            Looper looper = (handler == null) ? Looper.getMainLooper() : handler.getLooper();

@@ -300,6 +304,10 @@ public class WifiAwareManager {
            DiscoverySessionCallback callback) {
        if (VDBG) Log.v(TAG, "publish(): clientId=" + clientId + ", config=" + publishConfig);

        if (callback == null) {
            throw new IllegalArgumentException("Null callback provided");
        }

        try {
            mService.publish(mContext.getOpPackageName(), clientId, publishConfig,
                    new WifiAwareDiscoverySessionCallbackProxy(this, looper, true, callback,
@@ -333,6 +341,10 @@ public class WifiAwareManager {
            }
        }

        if (callback == null) {
            throw new IllegalArgumentException("Null callback provided");
        }

        try {
            mService.subscribe(mContext.getOpPackageName(), clientId, subscribeConfig,
                    new WifiAwareDiscoverySessionCallbackProxy(this, looper, false, callback,
+4 −0
Original line number Diff line number Diff line
@@ -123,6 +123,10 @@ public class WifiRttManager {
                    + ", callback=" + callback + ", handler=" + handler);
        }

        if (callback == null) {
            throw new IllegalArgumentException("Null callback provided");
        }

        Looper looper = (handler == null) ? Looper.getMainLooper() : handler.getLooper();
        Binder binder = new Binder();
        try {