/frameworks/base/tests/UsbTests/src/com/android/server/usb/ |
D | UsbManagerNoPermTest.java | 22 import android.hardware.usb.UsbManager; 61 mUsbManagerTestLib.testSetCurrentFunctionsSysEx(UsbManager.FUNCTION_NONE); in testUsbApi_SetCurrentFunctionsSys_OnSecurityException() 81 mUsbManagerTestLib.testSetCurrentFunctionsEx(UsbManager.FUNCTION_NONE); in testUsbApi_SetCurrentFunctions_OnSecurityException() 86 "areSettableFunctions(" + UsbManager.usbFunctionsToString(functions) + "):", in assertSettableFunctions() 87 settable, UsbManager.areSettableFunctions(functions)); in assertSettableFunctions() 97 assertSettableFunctions(true, UsbManager.FUNCTION_NONE); in testUsbManager_AreSettableFunctions() 100 assertSettableFunctions(true, UsbManager.FUNCTION_MTP); in testUsbManager_AreSettableFunctions() 101 assertSettableFunctions(true, UsbManager.FUNCTION_PTP); in testUsbManager_AreSettableFunctions() 102 assertSettableFunctions(true, UsbManager.FUNCTION_RNDIS); in testUsbManager_AreSettableFunctions() 103 assertSettableFunctions(true, UsbManager.FUNCTION_MIDI); in testUsbManager_AreSettableFunctions() [all …]
|
D | UsbHandlerTest.java | 30 import android.hardware.usb.UsbManager; 155 UsbManager.FUNCTION_MTP)); in setFunctionsMtp() 156 assertNotEquals(mUsbHandler.getEnabledFunctions() & UsbManager.FUNCTION_MTP, 0); in setFunctionsMtp() 163 UsbManager.FUNCTION_PTP)); in setFunctionsPtp() 164 assertNotEquals(mUsbHandler.getEnabledFunctions() & UsbManager.FUNCTION_PTP, 0); in setFunctionsPtp() 171 UsbManager.FUNCTION_MIDI)); in setFunctionsMidi() 172 assertNotEquals(mUsbHandler.getEnabledFunctions() & UsbManager.FUNCTION_MIDI, 0); in setFunctionsMidi() 179 UsbManager.FUNCTION_RNDIS)); in setFunctionsRndis() 180 assertNotEquals(mUsbHandler.getEnabledFunctions() & UsbManager.FUNCTION_RNDIS, 0); in setFunctionsRndis() 186 final long rndisPlusNcm = UsbManager.FUNCTION_RNDIS | UsbManager.FUNCTION_NCM; in setFunctionsNcmAndRndis() [all …]
|
/frameworks/base/tests/UsbManagerTests/lib/src/com/android/server/usblib/ |
D | UsbManagerTestLib.java | 26 import android.hardware.usb.UsbManager; 41 private UsbManager mUsbManagerSys; 42 private UsbManager mUsbManagerMock; 49 assertNotNull(mUsbManagerSys = mContext.getSystemService(UsbManager.class)); in UsbManagerTestLib() 50 assertNotNull(mUsbManagerMock = new UsbManager(mContext, mMockUsbService)); in UsbManagerTestLib() 115 testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_NONE); in testGetCurrentFunctions_shouldMatched() 116 testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_MTP); in testGetCurrentFunctions_shouldMatched() 117 testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_PTP); in testGetCurrentFunctions_shouldMatched() 118 testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_MIDI); in testGetCurrentFunctions_shouldMatched() 119 testGetCurrentFunctionsMock_Matched(UsbManager.FUNCTION_RNDIS); in testGetCurrentFunctions_shouldMatched() [all …]
|
/frameworks/base/tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/src/com/android/hardware/usb/externalmanagementtest/ |
D | UsbHostManagementActivity.java | 30 import android.hardware.usb.UsbManager; 79 if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(intent.getAction())) { in onCreate() 80 mUsbDevice = intent.<UsbDevice>getParcelableExtra(UsbManager.EXTRA_DEVICE); in onCreate() 82 UsbManager usbManager = (UsbManager)getSystemService(Context.USB_SERVICE); in onCreate() 92 filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED); in onCreate() 93 filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED); in onCreate() 154 UsbManager usbManager = (UsbManager)getSystemService(Context.USB_SERVICE); in startAoapActivity() 156 Intent intent = new Intent(UsbManager.ACTION_USB_DEVICE_ATTACHED); in startAoapActivity() 157 intent.putExtra(UsbManager.EXTRA_DEVICE, device); in startAoapActivity() 168 UsbManager usbManager = (UsbManager)getSystemService(Context.USB_SERVICE); in dumpUsbDevices() [all …]
|
D | UsbDeviceStateController.java | 24 import android.hardware.usb.UsbManager; 49 private final UsbManager mUsbManager; 61 UsbManager usbManager) { in UsbDeviceStateController() 74 filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED); in init() 75 filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED); in init() 299 if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(intent.getAction())) { in onReceive() 300 UsbDevice device = intent.<UsbDevice>getParcelableExtra(UsbManager.EXTRA_DEVICE); in onReceive() 302 } else if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(intent.getAction())) { in onReceive() 303 UsbDevice device = intent.<UsbDevice>getParcelableExtra(UsbManager.EXTRA_DEVICE); in onReceive()
|
D | UsbUtil.java | 24 import android.hardware.usb.UsbManager; 32 public static LinkedList<UsbDevice> findAllPossibleAndroidDevices(UsbManager usbManager) { in findAllPossibleAndroidDevices() 78 public static boolean isDeviceConnected(UsbManager usbManager, UsbDevice device) { in isDeviceConnected()
|
/frameworks/base/services/usb/java/com/android/server/usb/ |
D | UsbDeviceManager.java | 53 import android.hardware.usb.UsbManager; 300 FileDescriptor mtpFd = nativeOpenControl(UsbManager.USB_FUNCTION_MTP); in UsbDeviceManager() 304 mControlFds.put(UsbManager.FUNCTION_MTP, mtpFd); in UsbDeviceManager() 305 FileDescriptor ptpFd = nativeOpenControl(UsbManager.USB_FUNCTION_PTP); in UsbDeviceManager() 309 mControlFds.put(UsbManager.FUNCTION_PTP, ptpFd); in UsbDeviceManager() 333 ParcelableUsbPort port = intent.getParcelableExtra(UsbManager.EXTRA_PORT); in UsbDeviceManager() 334 UsbPortStatus status = intent.getParcelableExtra(UsbManager.EXTRA_PORT_STATUS); in UsbDeviceManager() 336 port.getUsbPort(context.getSystemService(UsbManager.class)), status); in UsbDeviceManager() 352 Iterator devices = ((UsbManager) context.getSystemService(Context.USB_SERVICE)) in UsbDeviceManager() 354 if (intent.getAction().equals(UsbManager.ACTION_USB_DEVICE_ATTACHED)) { in UsbDeviceManager() [all …]
|
D | UsbPermissionManager.java | 26 import android.hardware.usb.UsbManager; 92 Intent intent = new Intent(UsbManager.ACTION_USB_DEVICE_DETACHED); in usbDeviceRemoved() 94 intent.putExtra(UsbManager.EXTRA_DEVICE, device); in usbDeviceRemoved() 115 Intent intent = new Intent(UsbManager.ACTION_USB_ACCESSORY_DETACHED); in usbAccessoryRemoved() 117 intent.putExtra(UsbManager.EXTRA_ACCESSORY, accessory); in usbAccessoryRemoved()
|
D | UsbHandlerManager.java | 28 import android.hardware.usb.UsbManager; 66 dialogIntent.putExtra(UsbManager.EXTRA_ACCESSORY, accessory); in showUsbAccessoryUriActivity() 97 resolverIntent.putExtra(UsbManager.EXTRA_DEVICE, device); in confirmUsbHandler() 99 resolverIntent.putExtra(UsbManager.EXTRA_ACCESSORY, accessory); in confirmUsbHandler()
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/usb/ |
D | UsbDisconnectedReceiver.java | 26 import android.hardware.usb.UsbManager; 39 IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_DEVICE_DETACHED); in UsbDisconnectedReceiver() 47 IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_ACCESSORY_DETACHED); in UsbDisconnectedReceiver() 54 if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action)) { in onReceive() 55 UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); in onReceive() 59 } else if (UsbManager.ACTION_USB_ACCESSORY_DETACHED.equals(action)) { in onReceive() 61 (UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY); in onReceive()
|
D | UsbPermissionActivity.java | 30 import android.hardware.usb.UsbManager; 67 mDevice = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); in onCreate() 68 mAccessory = (UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY); in onCreate() 71 mPackageName = intent.getStringExtra(UsbManager.EXTRA_PACKAGE); in onCreate() 72 boolean canBeDefault = intent.getBooleanExtra(UsbManager.EXTRA_CAN_BE_DEFAULT, false); in onCreate() 149 intent.putExtra(UsbManager.EXTRA_DEVICE, mDevice); in onDestroy() 159 intent.putExtra(UsbManager.EXTRA_ACCESSORY, mAccessory); in onDestroy() 168 intent.putExtra(UsbManager.EXTRA_PERMISSION_GRANTED, mPermissionGranted); in onDestroy()
|
D | UsbConfirmActivity.java | 30 import android.hardware.usb.UsbManager; 69 mDevice = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); in onCreate() 70 mAccessory = (UsbAccessory)intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY); in onCreate() 72 String packageName = intent.getStringExtra(UsbManager.EXTRA_PACKAGE); in onCreate() 147 intent = new Intent(UsbManager.ACTION_USB_DEVICE_ATTACHED); in onClick() 148 intent.putExtra(UsbManager.EXTRA_DEVICE, mDevice); in onClick() 160 intent = new Intent(UsbManager.ACTION_USB_ACCESSORY_ATTACHED); in onClick() 161 intent.putExtra(UsbManager.EXTRA_ACCESSORY, mAccessory); in onClick()
|
D | UsbDebuggingSecondaryUserActivity.java | 26 import android.hardware.usb.UsbManager; 78 if (UsbManager.ACTION_USB_STATE.equals(action)) { in onReceive() 79 boolean connected = intent.getBooleanExtra(UsbManager.USB_CONNECTED, false); in onReceive() 91 IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_STATE); in onStart()
|
D | UsbResolverActivity.java | 27 import android.hardware.usb.UsbManager; 89 mDevice = (UsbDevice)target.getParcelableExtra(UsbManager.EXTRA_DEVICE); in onCreate() 95 mAccessory = (UsbAccessory)target.getParcelableExtra(UsbManager.EXTRA_ACCESSORY); in onCreate() 116 mOtherProfileIntent.putExtra(UsbManager.EXTRA_DEVICE, mDevice); in onCreate() 120 mOtherProfileIntent.putExtra(UsbManager.EXTRA_ACCESSORY, mAccessory); in onCreate()
|
/frameworks/base/tests/UsbHostExternalManagmentTest/AoapTestDevice/src/com/android/hardware/usb/aoapdevicetest/ |
D | UsbAoapDeviceTestActivity.java | 25 import android.hardware.usb.UsbManager; 43 private UsbManager mUsbManager; 55 mUsbManager = (UsbManager)getSystemService(Context.USB_SERVICE); in onCreate() 57 filter.addAction(UsbManager.ACTION_USB_ACCESSORY_ATTACHED); in onCreate() 58 filter.addAction(UsbManager.ACTION_USB_ACCESSORY_DETACHED); in onCreate() 64 if (intent.getAction().equals(UsbManager.ACTION_USB_ACCESSORY_ATTACHED)) { in onCreate() 66 (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY); in onCreate() 162 UsbAccessory accessory = intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY); in onReceive() 165 if (action.equals(UsbManager.ACTION_USB_ACCESSORY_ATTACHED)) { in onReceive() 167 } else if (action.equals(UsbManager.ACTION_USB_ACCESSORY_DETACHED)) { in onReceive() [all …]
|
/frameworks/base/tests/AccessoryDisplay/source/src/com/android/accessorydisplay/source/ |
D | SourceActivity.java | 29 import android.hardware.usb.UsbManager; 46 private UsbManager mUsbManager; 62 mUsbManager = (UsbManager)getSystemService(Context.USB_SERVICE); in onCreate() 74 filter.addAction(UsbManager.ACTION_USB_ACCESSORY_ATTACHED); in onCreate() 75 filter.addAction(UsbManager.ACTION_USB_ACCESSORY_DETACHED); in onCreate() 81 if (intent.getAction().equals(UsbManager.ACTION_USB_ACCESSORY_ATTACHED)) { in onCreate() 83 (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY); in onCreate() 217 UsbManager.EXTRA_ACCESSORY); in onReceive() 220 if (action.equals(UsbManager.ACTION_USB_ACCESSORY_ATTACHED)) { in onReceive() 222 } else if (action.equals(UsbManager.ACTION_USB_ACCESSORY_DETACHED)) { in onReceive() [all …]
|
/frameworks/base/cmds/svc/src/com/android/commands/svc/ |
D | UsbCommand.java | 21 import android.hardware.usb.UsbManager; 72 usbMgr.setCurrentFunctions(UsbManager.usbFunctionsFromString( in run() 81 UsbManager.usbFunctionsToString(usbMgr.getCurrentFunctions())); in run() 88 usbMgr.setScreenUnlockedFunctions(UsbManager.usbFunctionsFromString( in run() 104 UsbManager.usbSpeedToBandwidth(usbMgr.getCurrentUsbSpeed())); in run() 112 UsbManager.usbGadgetHalVersionToString( in run()
|
/frameworks/base/tests/UsbHostExternalManagmentTest/AoapTestHost/src/com/android/hardware/usb/aoaphosttest/ |
D | UsbAoapHostTestActivity.java | 29 import android.hardware.usb.UsbManager; 43 private UsbManager mUsbManager; 55 mUsbManager = (UsbManager)getSystemService(Context.USB_SERVICE); in onCreate() 57 filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED); in onCreate() 62 if (intent.getAction().equals(UsbManager.ACTION_USB_DEVICE_ATTACHED)) { in onCreate() 63 mUsbDevice = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); in onCreate() 157 if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(intent.getAction())) { in onReceive() 158 UsbDevice device = intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); in onReceive()
|
/frameworks/base/core/java/android/hardware/usb/ |
D | UsbManager.java | 64 public class UsbManager { class 627 FUNCTION_NAME_TO_CODE.put(UsbManager.USB_FUNCTION_MTP, FUNCTION_MTP); in FUNCTION_NAME_TO_CODE.put() 628 FUNCTION_NAME_TO_CODE.put(UsbManager.USB_FUNCTION_PTP, FUNCTION_PTP); in FUNCTION_NAME_TO_CODE.put() 629 FUNCTION_NAME_TO_CODE.put(UsbManager.USB_FUNCTION_RNDIS, FUNCTION_RNDIS); in FUNCTION_NAME_TO_CODE.put() 630 FUNCTION_NAME_TO_CODE.put(UsbManager.USB_FUNCTION_MIDI, FUNCTION_MIDI); in FUNCTION_NAME_TO_CODE.put() 631 FUNCTION_NAME_TO_CODE.put(UsbManager.USB_FUNCTION_ACCESSORY, FUNCTION_ACCESSORY); in FUNCTION_NAME_TO_CODE.put() 632 FUNCTION_NAME_TO_CODE.put(UsbManager.USB_FUNCTION_AUDIO_SOURCE, FUNCTION_AUDIO_SOURCE); in FUNCTION_NAME_TO_CODE.put() 633 FUNCTION_NAME_TO_CODE.put(UsbManager.USB_FUNCTION_ADB, FUNCTION_ADB); in FUNCTION_NAME_TO_CODE.put() 634 FUNCTION_NAME_TO_CODE.put(UsbManager.USB_FUNCTION_NCM, FUNCTION_NCM); in FUNCTION_NAME_TO_CODE.put() 677 public UsbManager(Context context, IUsbManager service) { in UsbManager() method in UsbManager [all …]
|
/frameworks/base/libs/usb/src/com/android/future/usb/ |
D | UsbManager.java | 36 public class UsbManager { class 69 private UsbManager(Context context, IUsbManager service) { in UsbManager() method in UsbManager 80 public static UsbManager getInstance(Context context) { in getInstance() 82 return new UsbManager(context, IUsbManager.Stub.asInterface(b)); in getInstance() 95 intent.getParcelableExtra(android.hardware.usb.UsbManager.EXTRA_ACCESSORY); in getAccessory()
|
/frameworks/base/media/tests/CameraBrowser/src/com/android/camerabrowser/ |
D | MtpClient.java | 28 import android.hardware.usb.UsbManager; 54 private final UsbManager mUsbManager; 67 UsbDevice usbDevice = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); 73 if (UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(action)) { 82 } else if (UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action)) { 90 boolean permission = intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, 155 mUsbManager = (UsbManager)context.getSystemService(Context.USB_SERVICE); in MtpClient() 158 filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED); in MtpClient() 159 filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED); in MtpClient()
|
D | DeviceDisconnectedReceiver.java | 25 import android.hardware.usb.UsbManager; 39 IntentFilter filter = new IntentFilter(UsbManager.ACTION_USB_DEVICE_DETACHED); in DeviceDisconnectedReceiver() 45 UsbDevice device = (UsbDevice)intent.getParcelableExtra(UsbManager.EXTRA_DEVICE); in onReceive()
|
/frameworks/base/tests/UsbManagerTests/src/com/android/server/usbtest/ |
D | UsbManagerApiTest.java | 20 import android.hardware.usb.UsbManager; 59 mUsbManagerTestLib.testSetCurrentFunctionsSysEx(UsbManager.FUNCTION_NONE); in testUsbApi_SetCurrentFunctionsSys_shouldNoSecurityException() 77 mUsbManagerTestLib.testSetCurrentFunctionsEx(UsbManager.FUNCTION_NONE); in testUsbApi_SetCurrentFunctions_shouldNoSecurityException()
|
/frameworks/base/tests/AccessoryDisplay/sink/src/com/android/accessorydisplay/sink/ |
D | SinkActivity.java | 32 import android.hardware.usb.UsbManager; 67 private UsbManager mUsbManager; 94 mUsbManager = (UsbManager)getSystemService(Context.USB_SERVICE); in onCreate() 116 filter.addAction(UsbManager.ACTION_USB_DEVICE_ATTACHED); in onCreate() 117 filter.addAction(UsbManager.ACTION_USB_DEVICE_DETACHED); in onCreate() 123 if (intent.getAction().equals(UsbManager.ACTION_USB_DEVICE_ATTACHED)) { in onCreate() 124 UsbDevice device = intent.<UsbDevice>getParcelableExtra(UsbManager.EXTRA_DEVICE); in onCreate() 490 UsbDevice device = intent.<UsbDevice>getParcelableExtra(UsbManager.EXTRA_DEVICE); in onReceive() 493 if (action.equals(UsbManager.ACTION_USB_DEVICE_ATTACHED)) { in onReceive() 495 } else if (action.equals(UsbManager.ACTION_USB_DEVICE_DETACHED)) { in onReceive() [all …]
|
/frameworks/base/libs/usb/tests/AccessoryChat/src/com/android/accessorychat/ |
D | AccessoryChat.java | 36 import android.hardware.usb.UsbManager; 56 private UsbManager mUsbManager; 67 … UsbAccessory accessory = (UsbAccessory) intent.getParcelableExtra(UsbManager.EXTRA_ACCESSORY); 68 if (intent.getBooleanExtra(UsbManager.EXTRA_PERMISSION_GRANTED, false)) { 85 mUsbManager = (UsbManager) getSystemService(Context.USB_SERVICE); in onCreate()
|