Package io.sentry
Interface IConnectionStatusProvider
- All Known Implementing Classes:
NoOpConnectionStatusProvider
@Internal
public interface IConnectionStatusProvider
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
static interface
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addConnectionStatusObserver
(@NotNull IConnectionStatusProvider.IConnectionStatusObserver observer) Adds an observer for listening to connection status changes.Gets the connection status.@Nullable String
Gets the connection type.void
removeConnectionStatusObserver
(@NotNull IConnectionStatusProvider.IConnectionStatusObserver observer) Removes an observer.
-
Method Details
-
getConnectionStatus
Gets the connection status.- Returns:
- the current connection status
-
getConnectionType
Gets the connection type.- Returns:
- the current connection type. E.g. "ethernet", "wifi" or "cellular"
-
addConnectionStatusObserver
boolean addConnectionStatusObserver(@NotNull @NotNull IConnectionStatusProvider.IConnectionStatusObserver observer) Adds an observer for listening to connection status changes.- Parameters:
observer
- the observer to register- Returns:
- true if the observer was sucessfully registered
-
removeConnectionStatusObserver
void removeConnectionStatusObserver(@NotNull @NotNull IConnectionStatusProvider.IConnectionStatusObserver observer) Removes an observer.- Parameters:
observer
- a previously added observer viaaddConnectionStatusObserver(IConnectionStatusObserver)
-