public void onReceive(Context context, Intent intent) { // handle accessories attached at boot time synchronized (mLock) { if (mCurrentAccessory != null) { mDeviceManager.accessoryAttached(mCurrentAccessory); } } }
private final void readCurrentAccessoryLocked() { if (mHasUsbAccessory) { String[] strings = nativeGetAccessoryStrings(); if (strings != null) { mCurrentAccessory = new UsbAccessory(strings); Log.d(TAG, "entering USB accessory mode: " + mCurrentAccessory); if (mSystemReady) { mDeviceManager.accessoryAttached(mCurrentAccessory); } } else { Log.e(TAG, "nativeGetAccessoryStrings failed"); } } }