Class NetworkTypeObserver
- java.lang.Object
-
- com.google.android.exoplayer2.util.NetworkTypeObserver
-
@Deprecated public final class NetworkTypeObserver extends Object
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Observer for network type changes.Registered
listeners are informed at registration and whenever the network type changes.The current network type can also be
queried
without registration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
NetworkTypeObserver.Listener
Deprecated.A listener for network type changes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static NetworkTypeObserver
getInstance(Context context)
Deprecated.Returns a network type observer instance.@com.google.android.exoplayer2.C.NetworkType int
getNetworkType()
Deprecated.Returns the current network type.void
register(NetworkTypeObserver.Listener listener)
Deprecated.Registers a listener.static void
resetForTests()
Deprecated.Resets the network type observer for tests.
-
-
-
Method Detail
-
getInstance
public static NetworkTypeObserver getInstance(Context context)
Deprecated.Returns a network type observer instance.- Parameters:
context
- AContext
.
-
resetForTests
public static void resetForTests()
Deprecated.Resets the network type observer for tests.
-
register
public void register(NetworkTypeObserver.Listener listener)
Deprecated.Registers a listener.The current network type will be reported to the listener after registration.
- Parameters:
listener
- TheNetworkTypeObserver.Listener
.
-
getNetworkType
@NetworkType public @com.google.android.exoplayer2.C.NetworkType int getNetworkType()
Deprecated.Returns the current network type.
-
-