Speedify SDK for Android  14.7.0
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
com.speedify.speedifysdk.SpeedifyHandler Class Reference

Detailed Description

Default ISpeedifyHandler Implementation.

Extend from this.

Inheritance diagram for com.speedify.speedifysdk.SpeedifyHandler:
com.speedify.speedifysdk.ISpeedifyHandler com.speedify.speedifysdk.receivers.ISdkStateReceiver com.speedify.speedifysdk.receivers.IForegroundServiceReceiver com.speedify.speedifysdk.receivers.IWebsocketIPCReceiver com.speedify.speedifysdk.receivers.INetworkSharingReceiver com.speedify.speedifysdk.receivers.IForegroundServiceStateReceiver com.speedify.speedifysdk.receivers.IForegroundNotificationReceiver

Public Member Functions

void OnServiceCreate (@NonNull Service service)
 Callback for vpn service OnCreate. More...
 
void OnServiceDestroy (@NonNull Service service)
 Callback for vpn service OnDestroy. More...
 
void OnServiceRemoved (@NonNull Service service)
 Callback for vpn service OnRemoved. More...
 
void OnServiceCreate ()
 Callback for vpn service OnCreate. More...
 
void OnServiceDestroy ()
 Callback for vpn service OnDestroy. More...
 
void OnServiceRemoved ()
 Callback for vpn service OnRemoved. More...
 
void UpdateForegroundNotification (@NonNull Service service, @NonNull IForegroundNotificationReceiver.ServiceData serviceData)
 
final void setServiceNotificationLaunchIntent (@Nullable Intent intent)
 Sets the Intent used when use clicks the service foreground notification. More...
 
final void setServiceNotificationIcon (int drawableId)
 Sets the icon used by the service foreground notification. More...
 
final void setServiceNotificationKillswitchVibeEnabled (boolean enabled)
 Sets whether a vibration is triggered when entering killswitch mode. More...
 
void HideForegroundNotification (@NonNull Service service)
 Callback when vpn service task is removed. More...
 
void OnServiceRestart (State lastState, RestartReason reason)
 Callback when vpn service restarts after a crash, an application update, or any other unclean shutdown. More...
 
void OnNewAdapter (@NonNull String adapterID, NetworkType type)
 Notification for the first time seeing a new adapter. More...
 
void OnAdapterOverlimit (@NonNull String adapterID, NetworkType type, @NonNull AdapterUsageData usageData)
 Notification when an adapter is near its daily or monthly data usage limit. More...
 
void OnLockedSetting (@NonNull String settingAction, SettingsLockReason lockReason)
 Called in response to attempt to change a setting that is locked by the server. More...
 
void OnSettingError (@NonNull String settingAction, ErrorType errorType, @Nullable String message)
 Called in response to an error changing a setting. More...
 
void OnConnectedServer (ServerInformationDetailed serverInfo)
 Connected update received. More...
 
void OnConnectedServer (ServerInformation serverInfo)
 
- Public Member Functions inherited from com.speedify.speedifysdk.receivers.ISdkStateReceiver
default void OnLoginError (ErrorType errorType, @Nullable String message)
 Error when logging in. More...
 
default void OnActivationCode (ErrorType errorType, @Nullable String message, @NonNull String activationCode, @NonNull String activationUrl)
 Activation code result. More...
 
default void OnConnectError (ErrorType errorType, @Nullable String message)
 Error when connecting to a server. More...
 
default void OnState (State state)
 State update received. More...
 
default void OnConnectedServer (@Nullable ServerInformation serverInfo)
 Connected update received. More...
 
default void OnAdaptersList (@NonNull List< AdapterData > adapters)
 Network adapters list update received. More...
 
default void OnDirectory (@NonNull List< ServerInformation > servers)
 Directory update received This list can be refreshed with refreshDirectory. More...
 
default void OnConnectionStats (@NonNull ConnectionStatsGroup tunnelStats)
 Latest tunnel stats update. More...
 
default void OnConnectionStats (@NonNull List< ConnectionStatsGroup > tunnelStats)
 Historic tunnel stats update. More...
 
default void OnSessionStats (@NonNull SessionStatPeriods stats)
 Session stats update. More...
 
default void OnStreamingStats (StreamingStats stats)
 Streaming stats update. More...
 
default void OnSettings (@NonNull Settings settings)
 Notification on settings change. More...
 
default void OnAccountingData (@NonNull AccountingData accounting)
 Accounting data update This can be refreshed with refreshAccounting. More...
 
default void OnPrivacySettings (@NonNull PrivacySettings privacy)
 Privacy settings update This can be refreshed with refreshPrivacy. More...
 
default void OnDirectorySettings (@NonNull DirectorySettings directorySettings)
 Directory settings update This can be refreshed with refreshDirectorySettings. More...
 
default void OnAccountCheckResult (ErrorType errorType, @Nullable String errorMessage, boolean accountExists)
 Account check result. More...
 
default void OnAccountCreateResult (ErrorType errorType, @Nullable String errorMessage)
 Account create result. More...
 
default void OnPasswordChangeResult (ErrorType errorType, @Nullable String errorMessage)
 Password change result. More...
 
default void OnTorrentDetection (boolean willDisconnect)
 A torrent use was detected. More...
 
default void OnNonVPNApplications (@NonNull List< String > nonVpnApps)
 List of apps configured to go around the VPN. More...
 
default void OnLocalVendorSettings (@Nullable JSONObject settings)
 Local vendor settings update. More...
 
default void OnRemoteVendorSettings (@Nullable JSONObject settings)
 Remote vendor settings update. More...
 
default void OnVendorUserData (@Nullable String userData)
 Vendor user data update. More...
 
default void OnLocalProxySettings (@NonNull LocalProxySettings settings)
 Local proxy settings update. More...
 
default void OnFirewallSettings (@NonNull FirewallSettings settings)
 Firewall settings update. More...
 
default void OnStreamingSettings (@NonNull StreamingSettings settings)
 Streaming settings update. More...
 
default void OnLocalProxyDomainWatchlistHit (@Nullable String title)
 Called when a domain from a disabled localproxy domainwatchlist is detected. More...
 
default void OnCaptivePortals (@NonNull List< String > networks)
 Called when captive portals are detected. More...
 
default void OnServerSettings (@NonNull ServerSettings settings)
 Server settings update. More...
 
default void OnVPNPermissionResult (boolean hasPermission)
 Result of request for VPN permission. More...
 
default void OnLastDisconnectEvent (@NonNull DisconnectEvent lastDisconnectEvent)
 Result of request for the last disconnect event. More...
 
default void OnLogSettings (@NonNull DaemonLogSettings daemon)
 Log settings result. More...
 
default void OnSpeedTestResults (@NonNull List< SpeedTestResultData > results)
 Speed test result data. More...
 
- Public Member Functions inherited from com.speedify.speedifysdk.receivers.INetworkSharingReceiver
default void OnNetworkSharingSettings (NetworkSharing.Settings settings)
 Network sharing settings. More...
 
default void OnNetworkSharingDiscovery (boolean discoveryActive)
 Network sharing discovery state. More...
 
default void OnNetworkSharesAvailable (List< NetworkSharing.Peer > availableShares)
 Available network shares. More...
 
default void OnNetworkSharingPeerStatusChange (NetworkSharing.PeerRole role, NetworkSharing.PeerUuid uuid, NetworkSharing.PeerStatus peerStatus, NetworkSharing.TunnelStatus tunnelStatus, ErrorType errorType, String errorMessage)
 state changes and connection errors with peers More...
 
default void OnNetworkSharingPairRequest (NetworkSharing.PeerUuid uuid, String displayName)
 Event when a peer requests a pairing. More...
 
default void OnNetworkSharingNewPeerAvailable (NetworkSharing.PeerUuid uuid, String displayName)
 Event when a new peer is available. More...
 
- Public Member Functions inherited from com.speedify.speedifysdk.receivers.IForegroundServiceStateReceiver
default boolean OnServiceStartError ()
 Error starting the vpn service. More...
 
default boolean OnServiceInterruptedError ()
 Error when another VPN starts, interrupting Speedify. More...
 
- Public Member Functions inherited from com.speedify.speedifysdk.receivers.IForegroundNotificationReceiver
void UpdateForegroundNotification (@NonNull Service service, @NonNull ServiceData serviceData)
 Callback to show a notification of the service state. More...
 
- Public Member Functions inherited from com.speedify.speedifysdk.receivers.IWebsocketIPCReceiver
default void OnWebsocketCreate ()
 Callback on websocket service's OnCreate. More...
 

Static Public Attributes

static final int SPEEDIFY_FOREGROUND_NOTIFICATION_ID = 55501
 
static final String SPEEDIFY_FOREGROUND_CHANNEL_ID = "VPN"
 

Protected Attributes

Intent serviceNotificationLaunchIntent = null
 
int serviceNotificationIcon = R.drawable.speedify_notification_icon
 
boolean serviceNotificaitonVibeOnKillswitch = true
 

Member Function Documentation

◆ HideForegroundNotification()

void com.speedify.speedifysdk.SpeedifyHandler.HideForegroundNotification ( @NonNull Service  service)

Callback when vpn service task is removed.

If overriding UpdateForegroundNotification, use this to hide your notification. Called from secondary (:vpnservice) process.

Parameters
serviceReference to the vpn service
Since
5.6

Implements com.speedify.speedifysdk.receivers.IForegroundNotificationReceiver.

◆ OnAdapterOverlimit()

void com.speedify.speedifysdk.SpeedifyHandler.OnAdapterOverlimit ( @NonNull String  adapterID,
NetworkType  type,
@NonNull AdapterUsageData  usageData 
)

Notification when an adapter is near its daily or monthly data usage limit.

This is called at 75% and 100% usage. You must call handleAdapterOverlimit on SpeedifySDK to clear this message. SpeedifyHandler's default implemenation does this automatically.

Parameters
adapterIDID of the adapter
typetype of the adapter
usageDatainformation on current usage of the adapter
Since
5.8

Implements com.speedify.speedifysdk.receivers.ISdkStateReceiver.

◆ OnConnectedServer() [1/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnConnectedServer ( ServerInformationDetailed  serverInfo)

Connected update received.

Send on start of connection attempt and connection completion.

Parameters
serverInfocurrently connected server
Deprecated:
As of 14.0. Use OnConnectedServer(ServerInformation)

◆ OnConnectedServer() [2/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnConnectedServer ( ServerInformation  serverInfo)

◆ OnLockedSetting()

void com.speedify.speedifysdk.SpeedifyHandler.OnLockedSetting ( @NonNull String  settingAction,
SettingsLockReason  lockReason 
)

Called in response to attempt to change a setting that is locked by the server.

Parameters
settingActionstring identifying the setting that is locked
lockReasonthe reason for the lock
Deprecated:
As of 14.0. Use OnSettingError(String,ErrorType,String)

◆ OnNewAdapter()

void com.speedify.speedifysdk.SpeedifyHandler.OnNewAdapter ( @NonNull String  adapterID,
NetworkType  type 
)

Notification for the first time seeing a new adapter.

You must call handleNewAdapter on SpeedifySDK to clear this message. SpeedifyHandler's default implemenation does this automatically.

Parameters
adapterIDID of the adapter
typetype of the adapter
Since
7.3

Implements com.speedify.speedifysdk.receivers.ISdkStateReceiver.

◆ OnServiceCreate() [1/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnServiceCreate ( @NonNull Service  service)

Callback for vpn service OnCreate.

Called from secondary (:vpnservice) process.

Since
14.0

Implements com.speedify.speedifysdk.receivers.IForegroundServiceStateReceiver.

◆ OnServiceCreate() [2/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnServiceCreate ( )

Callback for vpn service OnCreate.

Called from secondary (:vpnservice) process.

Since
5.6
Deprecated:
as of 14.0. use OnServiceCreate(Service) instead

◆ OnServiceDestroy() [1/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnServiceDestroy ( @NonNull Service  service)

Callback for vpn service OnDestroy.

Called from secondary (:vpnservice) process.

Since
14.0

Implements com.speedify.speedifysdk.receivers.IForegroundServiceStateReceiver.

◆ OnServiceDestroy() [2/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnServiceDestroy ( )

Callback for vpn service OnDestroy.

Called from secondary (:vpnservice) process.

Since
5.6
Deprecated:
as of 14.0. use OnServiceDestroy(Service) instead

◆ OnServiceRemoved() [1/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnServiceRemoved ( @NonNull Service  service)

Callback for vpn service OnRemoved.

Called from secondary (:vpnservice) process.

Since
14.0

Implements com.speedify.speedifysdk.receivers.IForegroundServiceStateReceiver.

◆ OnServiceRemoved() [2/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnServiceRemoved ( )

Callback for vpn service OnRemoved.

Called from secondary (:vpnservice) process.

Since
5.6
Deprecated:
as of 14.0. use OnServiceRemoved(Service) instead

◆ OnServiceRestart()

void com.speedify.speedifysdk.SpeedifyHandler.OnServiceRestart ( State  lastState,
RestartReason  reason 
)

Callback when vpn service restarts after a crash, an application update, or any other unclean shutdown.

A default implementation is provided that reconnects if lastState was connecting/connected. Called from secondary (:vpnservice) process.

Parameters
lastStatethe last known vpn state
reasonreason for the restart
Since
10.4

Implements com.speedify.speedifysdk.receivers.IForegroundServiceStateReceiver.

◆ OnSettingError()

void com.speedify.speedifysdk.SpeedifyHandler.OnSettingError ( @NonNull String  settingAction,
ErrorType  errorType,
@Nullable String  message 
)

Called in response to an error changing a setting.

Parameters
settingActionstring identifying the setting that failed to change
errorTypetype of error
messageerror message
Since
14.0

Implements com.speedify.speedifysdk.receivers.ISdkStateReceiver.

◆ setServiceNotificationIcon()

final void com.speedify.speedifysdk.SpeedifyHandler.setServiceNotificationIcon ( int  drawableId)

Sets the icon used by the service foreground notification.

This defaults to a drawable resource named speedify_notification_icon.

Parameters
drawableIdresource id of the drawable to use
Since
12.0

◆ setServiceNotificationKillswitchVibeEnabled()

final void com.speedify.speedifysdk.SpeedifyHandler.setServiceNotificationKillswitchVibeEnabled ( boolean  enabled)

Sets whether a vibration is triggered when entering killswitch mode.

This defaults to true.

Parameters
enabledif vibration is enabled
Since
12.0

◆ setServiceNotificationLaunchIntent()

final void com.speedify.speedifysdk.SpeedifyHandler.setServiceNotificationLaunchIntent ( @Nullable Intent  intent)

Sets the Intent used when use clicks the service foreground notification.

This defaults to the application's default launcher intent.

Parameters
intentIntent launched when clicking default foreground notification
Since
12.0

◆ UpdateForegroundNotification()

void com.speedify.speedifysdk.SpeedifyHandler.UpdateForegroundNotification ( @NonNull Service  service,
@NonNull IForegroundNotificationReceiver.ServiceData  serviceData 
)

Member Data Documentation

◆ serviceNotificaitonVibeOnKillswitch

boolean com.speedify.speedifysdk.SpeedifyHandler.serviceNotificaitonVibeOnKillswitch = true
protected

◆ serviceNotificationIcon

int com.speedify.speedifysdk.SpeedifyHandler.serviceNotificationIcon = R.drawable.speedify_notification_icon
protected

◆ serviceNotificationLaunchIntent

Intent com.speedify.speedifysdk.SpeedifyHandler.serviceNotificationLaunchIntent = null
protected

◆ SPEEDIFY_FOREGROUND_CHANNEL_ID

final String com.speedify.speedifysdk.SpeedifyHandler.SPEEDIFY_FOREGROUND_CHANNEL_ID = "VPN"
static

◆ SPEEDIFY_FOREGROUND_NOTIFICATION_ID

final int com.speedify.speedifysdk.SpeedifyHandler.SPEEDIFY_FOREGROUND_NOTIFICATION_ID = 55501
static

The documentation for this class was generated from the following file: