ConnectivityManagerCompat

public final class ConnectivityManagerCompat
extends Object

java.lang.Object
   ↳ androidx.core.net.ConnectivityManagerCompat


Helper for accessing features in ConnectivityManager.

Summary

Constants

int RESTRICT_BACKGROUND_STATUS_DISABLED

Device is not restricting metered network activity while application is running on background.

int RESTRICT_BACKGROUND_STATUS_ENABLED

Device is restricting metered network activity while application is running on background.

int RESTRICT_BACKGROUND_STATUS_WHITELISTED

Device is restricting metered network activity while application is running on background, but application is allowed to bypass it.

Public methods

static NetworkInfo getNetworkInfoFromBroadcast(ConnectivityManager cm, Intent intent)

Return the NetworkInfo that caused the given ConnectivityManager.CONNECTIVITY_ACTION broadcast.

static int getRestrictBackgroundStatus(ConnectivityManager cm)

Determines if the calling application is subject to metered network restrictions while running on background.

static boolean isActiveNetworkMetered(ConnectivityManager cm)

Returns if the currently active data network is metered.

Inherited methods

Constants

RESTRICT_BACKGROUND_STATUS_DISABLED