Example usage for android.net NetworkCapabilities NET_CAPABILITY_VALIDATED

List of usage examples for android.net NetworkCapabilities NET_CAPABILITY_VALIDATED

Introduction

In this page you can find the example usage for android.net NetworkCapabilities NET_CAPABILITY_VALIDATED.

Prototype

int NET_CAPABILITY_VALIDATED

To view the source code for android.net NetworkCapabilities NET_CAPABILITY_VALIDATED.

Click Source Link

Document

Indicates that connectivity on this network was successfully validated.

Usage

From source file:androidx.work.impl.constraints.trackers.NetworkStateTracker.java

private boolean isActiveNetworkValidated() {
    if (Build.VERSION.SDK_INT < 23) {
        return false; // NET_CAPABILITY_VALIDATED not available until API 23. Used on API 26+.
    }//from w  ww .  j av a 2 s. c o m
    Network network = mConnectivityManager.getActiveNetwork();
    NetworkCapabilities capabilities = mConnectivityManager.getNetworkCapabilities(network);
    return capabilities != null && capabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED);
}