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

Commit 32858e14 authored by Erik Kline's avatar Erik Kline
Browse files

Don't request information on unregistered callbacks

Test: as follows
    - build (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 32163131
Bug: 35608572
Change-Id: I489e510ac131a7a624a652b12165104202a49f85
parent d95aa50b
Loading
Loading
Loading
Loading
+20 −0
Original line number Original line Diff line number Diff line
@@ -183,11 +183,31 @@ public class UpstreamNetworkMonitor {
            case CALLBACK_LISTEN_ALL:
            case CALLBACK_LISTEN_ALL:
                break;
                break;
            case CALLBACK_TRACK_DEFAULT:
            case CALLBACK_TRACK_DEFAULT:
                if (mDefaultNetworkCallback == null) {
                    // The callback was unregistered in the interval between
                    // ConnectivityService calling onAvailable() and our
                    // handling of it here on the mTarget.getHandler() thread.
                    // Clean-up of this network entry is deferred to the
                    // handling of onLost() by other callbacks.
                    // TODO: change to Log.wtf() after oag/331764 is merged.
                    return;
                }

                cm().requestNetworkCapabilities(mDefaultNetworkCallback);
                cm().requestNetworkCapabilities(mDefaultNetworkCallback);
                cm().requestLinkProperties(mDefaultNetworkCallback);
                cm().requestLinkProperties(mDefaultNetworkCallback);
                mCurrentDefault = network;
                mCurrentDefault = network;
                break;
                break;
            case CALLBACK_MOBILE_REQUEST:
            case CALLBACK_MOBILE_REQUEST:
                if (mMobileNetworkCallback == null) {
                    // The callback was unregistered in the interval between
                    // ConnectivityService calling onAvailable() and our
                    // handling of it here on the mTarget.getHandler() thread.
                    // Clean-up of this network entry is deferred to the
                    // handling of onLost() by other callbacks.
                    // TODO: change to Log.wtf() after oag/331764 is merged.
                    return;
                }

                cm().requestNetworkCapabilities(mMobileNetworkCallback);
                cm().requestNetworkCapabilities(mMobileNetworkCallback);
                cm().requestLinkProperties(mMobileNetworkCallback);
                cm().requestLinkProperties(mMobileNetworkCallback);
                break;
                break;