Speedify SDK for Android  10.7.0
Public Member Functions | 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

Public Member Functions

void UpdateForegroundNotification (Service service, State state, String serverName, boolean killswitchActive)
 Callback to show a notification of the service state. More...
 
void HideForegroundNotification (Service service)
 Callback when vpn service task is removed. 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 OnServiceRestart (State lastState, boolean wasFromUpdate)
 Use OnServiceRestart(State,RestartReason). More...
 
void OnServiceRestart (State lastState, RestartReason reason)
 Callback when vpn service restarts after a crash, an application update, or any other unclean shutdown. More...
 
boolean OnServiceStartError ()
 Error starting the vpn service. More...
 
boolean OnServiceInterruptedError ()
 Error when another VPN starts, interrupting Speedify. More...
 
void OnWebsocketCreate ()
 Callback on websocket service's OnCreate. More...
 
void OnLoginError (ErrorType errorType, String message)
 Error when logging in. More...
 
void OnConnectError (ErrorType errorType, String message)
 Error when connecting to a server. More...
 
void OnState (State state)
 State update received. More...
 
void OnConnectedServer (ServerInformationDetailed serverInfo)
 Connected update received. More...
 
void OnAdaptersList (List< AdapterData > adapters)
 Network adapters list update received. More...
 
void OnDirectory (List< ServerInformation > servers)
 Directory update received This list can be refreshed with refreshDirectory. More...
 
void OnConnectionStats (ConnectionStatsGroup tunnelStats)
 Latest tunnel stats update. More...
 
void OnConnectionStats (List< ConnectionStatsGroup > tunnelStats)
 Historic tunnel stats update. More...
 
void OnSessionStats (SessionStatPeriods stats)
 Session stats update. More...
 
void OnStreamingStats (StreamingStats stats)
 Streaming stats update. More...
 
void OnNewAdapter (String adapterID, NetworkType type)
 Notification for the first time seeing a new adapter. More...
 
void OnAdapterOverlimit (String adapterID, NetworkType type, AdapterUsageData usageData)
 Notification when an adapter is near its daily or monthly data usage limit. More...
 
void OnAdapterOverlimit (String adapterID, AdapterUsageData usageData)
 Use OnAdapterOverlimit(String,NetworkType,AdapterUsageData). More...
 
void OnSettings (Settings settings)
 Notification on settings change. More...
 
void OnSpeedtestResults (SpeedTestResults testResults)
 Notification of speedtest progress. More...
 
void OnAccountingData (AccountingData accounting)
 Accounting data update This can be refreshed with refreshAccounting. More...
 
void OnPrivacySettings (PrivacySettings privacy)
 Privacy settings update This can be refreshed with refreshPrivacy. More...
 
void OnDirectoryDomain (String domain)
 Use OnDirectorySettings. More...
 
void OnDirectoryDomain (String domain, boolean enableEsni)
 Use OnDirectorySettings. More...
 
void OnDirectorySettings (DirectorySettings directorySettings)
 Directory settings update This can be refreshed with refreshDirectorySettings. More...
 
void OnAccountCheckResult (ErrorType errorType, String errorMessage, boolean accountExists)
 Account check result. More...
 
void OnAccountCreateResult (ErrorType errorType, String errorMessage)
 Account create result. More...
 
void OnPasswordChangeResult (ErrorType errorType, String errorMessage)
 Password change result. More...
 
void OnTorrentDetection (boolean willDisconnect)
 A torrent use was detected. More...
 
void OnNonVPNApplications (List< String > nonVpnApps)
 List of apps configured to go around the VPN. More...
 
void OnLockedSetting (String settingAction)
 Called in response to attempt to change a setting that is locked by the server. More...
 
void OnLocalVendorSettings (JSONObject settings)
 Local vendor settings update. More...
 
void OnRemoteVendorSettings (JSONObject settings)
 Remote vendor settings update. More...
 
void OnVendorUserData (String userData)
 Remote vendor settings update. More...
 
void OnLocalProxySettings (LocalProxySettings settings)
 Local proxy settings update. More...
 
void OnFirewallSettings (FirewallSettings settings)
 Firewall settings update. More...
 
void OnLocalProxyDomainWatchlistHit (String title)
 Called when a domain from a disabled localproxy domainwatchlist is detected. More...
 
void OnCaptivePortals (List< String > networks)
 Called when captive portals are detected. More...
 
void OnServerSettings (ServerSettings settings)
 Server settings update. More...
 
void OnVPNPermissionResult (boolean hasPermission)
 Result of request for VPN permission. More...
 
void OnSafeBrowsing (SafeBrowsingSettings settings)
 Safe Browsing settings. More...
 
void OnSafeBrowsingStats (SafeBrowsingStats stats)
 Safe Browsing stats. More...
 
void OnSafeBrowsingConnectError (SafeBrowsingConnectError error)
 Notification for a Safe Browsing connect error. More...
 
void OnSafeBrowsingLookupError (SafeBrowsingLookupError error)
 Notification for a Safe Browsing lookup error. More...
 
void OnSafeBrowsingBlock (SafeBrowsingBlock block)
 Notification for a Safe Browsing block. More...
 
void OnLastDisconnectEvent (DisconnectEvent lastDisconnectEvent)
 Result of request for the last disconnect event. More...
 
void OnLogSettings (DaemonLogSettings daemon)
 Log settings result. More...
 

Member Function Documentation

◆ HideForegroundNotification()

void com.speedify.speedifysdk.SpeedifyHandler.HideForegroundNotification ( 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.ISpeedifyHandler.

◆ OnAccountCheckResult()

void com.speedify.speedifysdk.SpeedifyHandler.OnAccountCheckResult ( ErrorType  errorType,
String  errorMessage,
boolean  accountExists 
)

Account check result.

Parameters
errorTypetype of the error
errorMessagemessage
accountExistsif not an error, if the account exists
Since
7.5

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnAccountCreateResult()

void com.speedify.speedifysdk.SpeedifyHandler.OnAccountCreateResult ( ErrorType  errorType,
String  errorMessage 
)

Account create result.

Parameters
errorTypetype of the error
errorMessagemessage
Since
7.5

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnAccountingData()

void com.speedify.speedifysdk.SpeedifyHandler.OnAccountingData ( AccountingData  accounting)

Accounting data update This can be refreshed with refreshAccounting.

Parameters
accountinginformation on the current account
Since
6.1

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnAdapterOverlimit() [1/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnAdapterOverlimit ( String  adapterID,
NetworkType  type,
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.ISpeedifyHandler.

◆ OnAdapterOverlimit() [2/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnAdapterOverlimit ( String  adapterID,
AdapterUsageData  usageData 
)

◆ OnAdaptersList()

void com.speedify.speedifysdk.SpeedifyHandler.OnAdaptersList ( List< AdapterData adapters)

Network adapters list update received.

Sent on changes and every 30s while connected to update usage data.

Parameters
adapterslist of adapters
Since
5.8

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnCaptivePortals()

void com.speedify.speedifysdk.SpeedifyHandler.OnCaptivePortals ( List< String >  networks)

Called when captive portals are detected.

Parameters
networksnetworks on which a captive portal was detected
Since
9.3

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnConnectedServer()

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

Connected update received.

Send on start of connection attempt and connection completion.

Parameters
serverInfocurrently connected server
Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnConnectError()

void com.speedify.speedifysdk.SpeedifyHandler.OnConnectError ( ErrorType  errorType,
String  message 
)

Error when connecting to a server.

Parameters
errorTypetype of error
messageerror message
Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnConnectionStats() [1/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnConnectionStats ( ConnectionStatsGroup  tunnelStats)

Latest tunnel stats update.

Sent once per second while connected, if tunnel stat updates are enabled. via enableConnectionStatUpdates.

Parameters
tunnelStatsa group of tunnelstats for a point in time
Since
5.8

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnConnectionStats() [2/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnConnectionStats ( List< ConnectionStatsGroup tunnelStats)

Historic tunnel stats update.

Parameters
tunnelStatslist of tunnelstats for a period of time
Since
5.8

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnDirectory()

void com.speedify.speedifysdk.SpeedifyHandler.OnDirectory ( List< ServerInformation servers)

Directory update received This list can be refreshed with refreshDirectory.

Parameters
serverslist of servers
Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnDirectoryDomain() [1/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnDirectoryDomain ( String  domain)

◆ OnDirectoryDomain() [2/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnDirectoryDomain ( String  domain,
boolean  enableEsni 
)

◆ OnDirectorySettings()

void com.speedify.speedifysdk.SpeedifyHandler.OnDirectorySettings ( DirectorySettings  directorySettings)

Directory settings update This can be refreshed with refreshDirectorySettings.

Parameters
directorySettingsdirectory settings
Since
10.5

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnFirewallSettings()

void com.speedify.speedifysdk.SpeedifyHandler.OnFirewallSettings ( FirewallSettings  settings)

Firewall settings update.

Parameters
settingscurrent firewall settings
Since
9.2

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnLastDisconnectEvent()

void com.speedify.speedifysdk.SpeedifyHandler.OnLastDisconnectEvent ( DisconnectEvent  lastDisconnectEvent)

Result of request for the last disconnect event.

Since
10.4

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnLocalProxyDomainWatchlistHit()

void com.speedify.speedifysdk.SpeedifyHandler.OnLocalProxyDomainWatchlistHit ( String  title)

Called when a domain from a disabled localproxy domainwatchlist is detected.

Parameters
titletitle of the watchlist that was detected
Since
9.3

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnLocalProxySettings()

void com.speedify.speedifysdk.SpeedifyHandler.OnLocalProxySettings ( LocalProxySettings  settings)

Local proxy settings update.

Parameters
settingscurrent local proxy settings
Since
9.2

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnLocalVendorSettings()

void com.speedify.speedifysdk.SpeedifyHandler.OnLocalVendorSettings ( JSONObject  settings)

Local vendor settings update.

Parameters
settingscurrent local vendor settings
Since
9.2

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnLockedSetting()

void com.speedify.speedifysdk.SpeedifyHandler.OnLockedSetting ( String  settingAction)

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

Parameters
settingActionstring identifying the setting that is locked
Since
9.2

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnLoginError()

void com.speedify.speedifysdk.SpeedifyHandler.OnLoginError ( ErrorType  errorType,
String  message 
)

Error when logging in.

Parameters
errorTypetype of error
messageerror message
Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnLogSettings()

void com.speedify.speedifysdk.SpeedifyHandler.OnLogSettings ( DaemonLogSettings  daemon)

Log settings result.

Since
10.5

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnNewAdapter()

void com.speedify.speedifysdk.SpeedifyHandler.OnNewAdapter ( 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.ISpeedifyHandler.

◆ OnNonVPNApplications()

void com.speedify.speedifysdk.SpeedifyHandler.OnNonVPNApplications ( List< String >  nonVpnApps)

List of apps configured to go around the VPN.

Parameters
nonVpnAppsapp package ids
Since
7.6.1

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnPasswordChangeResult()

void com.speedify.speedifysdk.SpeedifyHandler.OnPasswordChangeResult ( ErrorType  errorType,
String  errorMessage 
)

Password change result.

Parameters
errorTypetype of the error
errorMessagemessage
Since
7.5

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnPrivacySettings()

void com.speedify.speedifysdk.SpeedifyHandler.OnPrivacySettings ( PrivacySettings  privacy)

Privacy settings update This can be refreshed with refreshPrivacy.

Parameters
privacyprivacy settings
Since
6.3

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnRemoteVendorSettings()

void com.speedify.speedifysdk.SpeedifyHandler.OnRemoteVendorSettings ( JSONObject  settings)

Remote vendor settings update.

Parameters
settingscurrent remote vendor settings
Since
9.2

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnSafeBrowsing()

void com.speedify.speedifysdk.SpeedifyHandler.OnSafeBrowsing ( SafeBrowsingSettings  settings)

Safe Browsing settings.

Parameters
settingsThe Safe Browsing settings
Since
10.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnSafeBrowsingBlock()

void com.speedify.speedifysdk.SpeedifyHandler.OnSafeBrowsingBlock ( SafeBrowsingBlock  block)

Notification for a Safe Browsing block.

Parameters
blockSafe browsing block information
Since
10.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnSafeBrowsingConnectError()

void com.speedify.speedifysdk.SpeedifyHandler.OnSafeBrowsingConnectError ( SafeBrowsingConnectError  error)

Notification for a Safe Browsing connect error.

Parameters
errorSafe browsing error information
Since
10.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnSafeBrowsingLookupError()

void com.speedify.speedifysdk.SpeedifyHandler.OnSafeBrowsingLookupError ( SafeBrowsingLookupError  error)

Notification for a Safe Browsing lookup error.

Parameters
errorSafe browsing error information
Since
10.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnSafeBrowsingStats()

void com.speedify.speedifysdk.SpeedifyHandler.OnSafeBrowsingStats ( SafeBrowsingStats  stats)

Safe Browsing stats.

Parameters
statsSafe Browsing stats
Since
10.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnServerSettings()

void com.speedify.speedifysdk.SpeedifyHandler.OnServerSettings ( ServerSettings  settings)

Server settings update.

Parameters
settingscurrent server settings
Since
9.4

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnServiceCreate()

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

Callback for vpn service OnCreate.

Called from secondary (:vpnservice) process.

Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnServiceDestroy()

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

Callback for vpn service OnDestroy.

Called from secondary (:vpnservice) process.

Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnServiceInterruptedError()

boolean com.speedify.speedifysdk.SpeedifyHandler.OnServiceInterruptedError ( )

Error when another VPN starts, interrupting Speedify.

Called from secondary (:vpnservice) process. The default handler uses the string resources SPEEDIFY_ERROR_VPN_REVOKED_TITLE and SPEEDIFY_ERROR_VPN_REVOKED_TEXT

Returns
true if error is handled, false for default dialog
Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnServiceRemoved()

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

Callback for vpn service OnRemoved.

Called from secondary (:vpnservice) process.

Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnServiceRestart() [1/2]

void com.speedify.speedifysdk.SpeedifyHandler.OnServiceRestart ( State  lastState,
boolean  wasFromUpdate 
)

◆ OnServiceRestart() [2/2]

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.ISpeedifyHandler.

◆ OnServiceStartError()

boolean com.speedify.speedifysdk.SpeedifyHandler.OnServiceStartError ( )

Error starting the vpn service.

The default handler uses the string resources SPEEDIFY_ERROR_VPN_START_TITLE and SPEEDIFY_ERROR_VPN_START_TEXT

Returns
true if error is handled, false for default dialog
Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnSessionStats()

void com.speedify.speedifysdk.SpeedifyHandler.OnSessionStats ( SessionStatPeriods  stats)

Session stats update.

Parameters
statssession stat periods object
Since
9.5

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnSettings()

void com.speedify.speedifysdk.SpeedifyHandler.OnSettings ( Settings  settings)

Notification on settings change.

Parameters
settingsthe current settings
Since
5.8

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnSpeedtestResults()

void com.speedify.speedifysdk.SpeedifyHandler.OnSpeedtestResults ( SpeedTestResults  testResults)

Notification of speedtest progress.

Parameters
testResultsprogress and results information
Since
5.9

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnState()

void com.speedify.speedifysdk.SpeedifyHandler.OnState ( State  state)

State update received.

This is sent on state updates, and every 30s while connected.

Parameters
statecurrent state
Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnStreamingStats()

void com.speedify.speedifysdk.SpeedifyHandler.OnStreamingStats ( StreamingStats  stats)

Streaming stats update.

Parameters
statsstreaming stats object
Since
9.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnTorrentDetection()

void com.speedify.speedifysdk.SpeedifyHandler.OnTorrentDetection ( boolean  willDisconnect)

A torrent use was detected.

Parameters
willDisconnectif this use will trigger a disconnect
Since
7.5

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnVendorUserData()

void com.speedify.speedifysdk.SpeedifyHandler.OnVendorUserData ( String  userData)

Remote vendor settings update.

Parameters
userDatacurrent vendor user data
Since
9.8

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnVPNPermissionResult()

void com.speedify.speedifysdk.SpeedifyHandler.OnVPNPermissionResult ( boolean  hasPermission)

Result of request for VPN permission.

Parameters
hasPermissionwhether permission was obtained
Since
10.0

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ OnWebsocketCreate()

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

Callback on websocket service's OnCreate.

Called from both main and secondary (:vpnservice) process.

Since
7.8

Implements com.speedify.speedifysdk.ISpeedifyHandler.

◆ UpdateForegroundNotification()

void com.speedify.speedifysdk.SpeedifyHandler.UpdateForegroundNotification ( Service  service,
State  state,
String  serverName,
boolean  killswitchActive 
)

Callback to show a notification of the service state.

A default implementation is provided. If overriding, it is required on Oreo and higher that you call service.startForeground so that Android does not automatically stop the service after a few seconds. Prior to Oreo it is still recommended to use service.startForeground so that Android is less likely to destroy the service in low memory situations. Called from secondary (:vpnservice) process.

Parameters
serviceReference to the vpn service
stateCurrent state
serverNameName of current server connected to
killswitchActiveif killswitch setting is on
Since
5.6

Implements com.speedify.speedifysdk.ISpeedifyHandler.


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