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

Commit 2d968b6d authored by Sarah Chin's avatar Sarah Chin Committed by Android (Google) Code Review
Browse files

Merge "Update internet data state when capabilities change"

parents a70bb332 cb3f3942
Loading
Loading
Loading
Loading
+11 −5
Original line number Original line Diff line number Diff line
@@ -3168,6 +3168,12 @@ public class DataNetworkController extends Handler {
            log("Found more network requests that can be satisfied. " + networkRequestList);
            log("Found more network requests that can be satisfied. " + networkRequestList);
            dataNetwork.attachNetworkRequests(networkRequestList);
            dataNetwork.attachNetworkRequests(networkRequestList);
        }
        }

        if (dataNetwork.getNetworkCapabilities().hasCapability(
                NetworkCapabilities.NET_CAPABILITY_INTERNET)) {
            // Update because DataNetwork#isInternetSupported might have changed with capabilities.
            updateOverallInternetDataState();
        }
    }
    }


    /**
    /**
@@ -3318,9 +3324,9 @@ public class DataNetworkController extends Handler {
    }
    }


    /**
    /**
     * Update the internet data network state. For now only {@link TelephonyManager#DATA_CONNECTED}
     * Update the internet data network state. For now only {@link TelephonyManager#DATA_CONNECTED},
     * , {@link TelephonyManager#DATA_SUSPENDED}, and
     * {@link TelephonyManager#DATA_SUSPENDED}, and {@link TelephonyManager#DATA_DISCONNECTED}
     * {@link TelephonyManager#DATA_DISCONNECTED} are supported.
     * are supported.
     */
     */
    private void updateOverallInternetDataState() {
    private void updateOverallInternetDataState() {
        boolean anyInternetConnected = mDataNetworkList.stream()
        boolean anyInternetConnected = mDataNetworkList.stream()
@@ -3588,8 +3594,8 @@ public class DataNetworkController extends Handler {


    /**
    /**
     * Get the internet data network state. Note that this is the best effort if more than one
     * Get the internet data network state. Note that this is the best effort if more than one
     * data network supports internet. For now only {@link TelephonyManager#DATA_CONNECTED}
     * data network supports internet. For now only {@link TelephonyManager#DATA_CONNECTED},
     * , {@link TelephonyManager#DATA_SUSPENDED}, and {@link TelephonyManager#DATA_DISCONNECTED}
     * {@link TelephonyManager#DATA_SUSPENDED}, and {@link TelephonyManager#DATA_DISCONNECTED}
     * are supported.
     * are supported.
     *
     *
     * @return The data network state.
     * @return The data network state.