public abstract class SdlBroadcastReceiver extends BroadcastReceiver
BroadcastReceiver.PendingResult| Modifier and Type | Field and Description |
|---|---|
static String |
IS_TRANSPORT_CONNECTED |
static String |
LOCAL_ROUTER_SERVICE_DID_START_OWN |
static String |
LOCAL_ROUTER_SERVICE_EXTRA |
static Vector<ComponentName> |
runningBluetoothServicePackage |
protected static String |
SDL_ROUTER_SERVICE_CLASS_NAME |
static String |
TRANSPORT_GLOBAL_PREFS |
| Constructor and Description |
|---|
SdlBroadcastReceiver() |
| Modifier and Type | Method and Description |
|---|---|
static ComponentName |
consumeQueuedRouterService() |
abstract Class<? extends SdlRouterService> |
defineLocalSdlRouterClass()
We need to define this for local copy of the Sdl Router Service class.
|
int |
getRouterServiceVersion() |
void |
onReceive(Context context,
Intent intent) |
abstract void |
onSdlEnabled(Context context,
Intent intent)
The developer will need to define exactly what should happen when Sdl is enabled.
|
protected static void |
pingRouterService(Context context,
String packageName,
String className)
Attempts to ping a running router service.
|
static void |
queryForConnectedService(Context context)
This call will reach out to all SDL related router services to check if they're connected.
|
protected static void |
setForegroundExceptionHandler()
This method will set a new UncaughtExceptionHandler for the current thread.
|
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, goAsync, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtrasprotected static final String SDL_ROUTER_SERVICE_CLASS_NAME
public static final String LOCAL_ROUTER_SERVICE_EXTRA
public static final String LOCAL_ROUTER_SERVICE_DID_START_OWN
public static final String TRANSPORT_GLOBAL_PREFS
public static final String IS_TRANSPORT_CONNECTED
public static Vector<ComponentName> runningBluetoothServicePackage
public int getRouterServiceVersion()
@CallSuper public void onReceive(Context context, Intent intent)
onReceive in class BroadcastReceiverprotected static void setForegroundExceptionHandler()
protected static void pingRouterService(Context context, String packageName, String className)
context - A context to access Android system services through.packageName - Package name for service to pingclassName - Class name for service to pingpublic static void queryForConnectedService(Context context)
context - public static ComponentName consumeQueuedRouterService()
public abstract Class<? extends SdlRouterService> defineLocalSdlRouterClass()
public abstract void onSdlEnabled(Context context, Intent intent)
The most useful code here would be to start the activity or service that handles most of the Livio Connect code.
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