Class ShadowNetworkInfo


  • @Implements(android.net.NetworkInfo.class)
    public class ShadowNetworkInfo
    extends java.lang.Object
    • Constructor Detail

      • ShadowNetworkInfo

        public ShadowNetworkInfo()
    • Method Detail

      • __staticInitializer__

        @Implementation
        protected static void __staticInitializer__()
      • newInstance

        public static android.net.NetworkInfo newInstance​(android.net.NetworkInfo.DetailedState detailedState,
                                                          int type,
                                                          int subType,
                                                          boolean isAvailable,
                                                          android.net.NetworkInfo.State state)
        Allows developers to create a NetworkInfo instance for testing.
      • isConnected

        @Implementation
        protected boolean isConnected()
      • isConnectedOrConnecting

        @Implementation
        protected boolean isConnectedOrConnecting()
      • getState

        @Implementation
        protected android.net.NetworkInfo.State getState()
      • getDetailedState

        @Implementation
        protected android.net.NetworkInfo.DetailedState getDetailedState()
      • getType

        @Implementation
        protected int getType()
      • getSubtype

        @Implementation
        protected int getSubtype()
      • isAvailable

        @Implementation
        protected boolean isAvailable()
      • setAvailableStatus

        public void setAvailableStatus​(boolean isAvailable)
        Sets up the return value of isAvailable().
        Parameters:
        isAvailable - the value that isAvailable() will return.
      • setConnectionStatus

        public void setConnectionStatus​(android.net.NetworkInfo.State state)
        Sets up the return value of getState().
        Parameters:
        state - the value that getState() will return.
      • setConnectionType

        public void setConnectionType​(int connectionType)
        Sets up the return value of getType().
        Parameters:
        connectionType - the value that getType() will return.
      • setSubType

        public void setSubType​(int subType)
      • setDetailedState

        public void setDetailedState​(android.net.NetworkInfo.DetailedState detailedState)