public class

UsbDeviceAttachmentActivity

extends Activity
java.lang.Object
   ↳ android.content.Context
     ↳ android.content.ContextWrapper
       ↳ android.view.ContextThemeWrapper
         ↳ android.app.Activity
           ↳ com.openxc.interfaces.usb.UsbDeviceAttachmentActivity

Class Overview

The UsbDeviceActivity is a proxy to listen for USB_DEVICE_ATTACHED intents. Android unfortunately doesn't provide a way to specify USB device filters for the ATTACHED intent programatically - it must be in the AndroidManifest. This means we have no way to link the correct device filters with the actual instance of the BroadcastReceiver (an object inside of UsbVehicleInterface), since we are doing something besides just starting an activity based on the intent. This seems like an oversight by the Android developers - they only envisioned you using the ATTACHED signal to auto-start your application. This Activity is a workaround that listens for the intent. Originally it rebroadcast a custom version that the true listener can actually receive, but that is actually unneccessary - when the activity's blank screen opens and immediately closes (invisble to the user), it causes the active OpenXC app to pause. That currently means the background services all get destroyed and recreated when the activity exits and the previous activity regains focus. After the services restart, the USB devices is reconnected.

Summary

[Expand]
Inherited Constants
From class android.app.Activity
From class android.content.Context
From interface android.content.ComponentCallbacks2
[Expand]
Inherited Fields
From class android.app.Activity
Public Constructors
UsbDeviceAttachmentActivity()
Public Methods
void onResume()
[Expand]
Inherited Methods
From class android.app.Activity
From class android.view.ContextThemeWrapper
From class android.content.ContextWrapper
From class android.content.Context
From class java.lang.Object
From interface android.content.ComponentCallbacks
From interface android.content.ComponentCallbacks2
From interface android.view.KeyEvent.Callback
From interface android.view.LayoutInflater.Factory
From interface android.view.LayoutInflater.Factory2
From interface android.view.View.OnCreateContextMenuListener
From interface android.view.Window.Callback

Public Constructors

public UsbDeviceAttachmentActivity ()

Public Methods

public void onResume ()