public class NetworkTypePlatform

  1. Object
  2. NetworkTypePlatform

Platform-supplied implementation of the network-type tracking API. NetworkManager.getCurrentNetworkType(), NetworkManager.addNetworkTypeListener(...) and the matching remover all dispatch through this.

Part of the framework’s service-provider interface, not intended for application use.

Constructors

public NetworkTypePlatform()

Methods

public int getCurrentNetworkType()One of the NetworkManager.NETWORK_TYPE_* constants.
public void install(NetworkManager target)Subscribe to platform network transitions.
public void uninstall(NetworkManager target)Tear down the watcher installed by install.

Inherited methods

Constructor details

NetworkTypePlatform

public NetworkTypePlatform()

Method details

getCurrentNetworkType

public int getCurrentNetworkType()
One of the NetworkManager.NETWORK_TYPE_* constants. Default returns NETWORK_TYPE_OTHER when an access point is configured so stub platforms still indicate “some connectivity present”.

install

public void install(NetworkManager target)
Subscribe to platform network transitions. The platform must call target.fireNetworkTypeChange(newType, vpnActive) whenever the active network changes. Default is a no-op for platforms that can’t observe transitions.

uninstall

public void uninstall(NetworkManager target)
Tear down the watcher installed by install. Default no-op.