Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Documentation
Sidebar

Class SdlBroadcastReceiver

Hierarchy

java.lang.Object
     android.content.BroadcastReceiver

Package
com.smartdevicelink.transport

Fields

SDL_ROUTER_SERVICE_CLASS_NAME

protected static final java.lang.String SDL_ROUTER_SERVICE_CLASS_NAME
Constant Value
"sdlrouterservice"

LOCAL_ROUTER_SERVICE_EXTRA

public static final java.lang.String LOCAL_ROUTER_SERVICE_EXTRA
Constant Value
"router_service"

LOCAL_ROUTER_SERVICE_DID_START_OWN

public static final java.lang.String LOCAL_ROUTER_SERVICE_DID_START_OWN
Constant Value
"did_start"

TRANSPORT_GLOBAL_PREFS

public static final java.lang.String TRANSPORT_GLOBAL_PREFS
Constant Value
"SdlTransportPrefs"

IS_TRANSPORT_CONNECTED

public static final java.lang.String IS_TRANSPORT_CONNECTED
Constant Value
"isTransportConnected"

runningBluetoothServicePackage

public static java.util.Vector runningBluetoothServicePackage

Constructors

SdlBroadcastReceiver()

public SdlBroadcastReceiver()

Methods

getRouterServiceVersion()

public int getRouterServiceVersion()

onReceive( Context context, Intent intent )

public void onReceive(Context context,Intent intent)

Parameters

context
intent

pingRouterService( Context context, String packageName, String className )

Attempts to ping a running router service

protected static void pingRouterService(Context context,String packageName,String className)

Parameters

context
A context to access Android system services through.
packageName
Package name for service to ping
className
Class name for service to ping

queryForConnectedService( Context context )

This call will reach out to all SDL related router services to check if they're connected. If a the router service is connected, it will react by pinging all clients. This receiver will then receive that ping and if the router service is trusted, the onSdlEnabled method will be called.

public static void queryForConnectedService(Context context)

Parameters

context

requestTransportStatus( Context context, SdlRouterStatusProvider.ConnectedStatusCallback callback )

Deprecated
If a Router Service is running, this method determines if that service is connected to a device over some form of transport.

public static void requestTransportStatus(Context context,SdlRouterStatusProvider.ConnectedStatusCallback callback)

Parameters

context
A context to access Android system services through. If null is passed, this will always return false
callback
Use this callback to find out if the router service is connected or not.

consumeQueuedRouterService()

public static android.content.ComponentName consumeQueuedRouterService()

defineLocalSdlRouterClass()

We need to define this for local copy of the Sdl Router Service class. It will be the main point of connection for Sdl enabled apps

public abstract java.lang.Class defineLocalSdlRouterClass()

onSdlEnabled( Context context, Intent intent )

The developer will need to define exactly what should happen when Sdl is enabled. This method will only get called when a Sdl session is initiated.

The most useful code here would be to start the activity or service that handles most of the Livio Connect code.

public abstract void onSdlEnabled(Context context,Intent intent)

Parameters

context
this is the context that was passed to this receiver when it was called.
intent
this is the intent that alerted this broadcast. Make sure to pass all extra it came with to your service/activity {@inheritDoc}

Inherited Methods

From Class Methods
android.content.BroadcastReceiver onReceive, goAsync, peekService, setResultCode, getResultCode, setResultData, getResultData, setResultExtras, getResultExtras, setResult, getAbortBroadcast, abortBroadcast, clearAbortBroadcast, isOrderedBroadcast, isInitialStickyBroadcast, setOrderedHint, setDebugUnregister, getDebugUnregister
java.lang.Object getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize
View on GitHub.com
Previous Section Next Section