Lines Matching defs:device

140         // List of all device connections for this client
167 public void addDeviceConnection(Device device, IMidiDeviceOpenCallback callback) {
168 DeviceConnection connection = new DeviceConnection(device, this, callback);
170 device.addDeviceConnection(connection);
192 public void deviceAdded(Device device) {
194 if (!device.isUidAllowed(mUid)) return;
196 MidiDeviceInfo deviceInfo = device.getDeviceInfo();
206 public void deviceRemoved(Device device) {
208 if (!device.isUidAllowed(mUid)) return;
210 MidiDeviceInfo deviceInfo = device.getDeviceInfo();
220 public void deviceStatusChanged(Device device, MidiDeviceStatus status) {
222 if (!device.isUidAllowed(mUid)) return;
260 sb.append(" <device ");
291 // ServiceInfo for the device's MidiDeviceServer implementation (virtual devices only)
293 // UID of device implementation
300 // List of all device connections for this device
410 // We need to explicitly add the device in a separate method
449 Log.e(TAG, "No way to connect to device in addDeviceConnection");
521 // Represents a connection between a client and a device
528 public DeviceConnection(Device device, Client client, IMidiDeviceOpenCallback callback) {
529 mDevice = device;
618 for (Device device : mDevicesByInfo.values()) {
620 if (device.isUidAllowed(uid)) {
622 MidiDeviceStatus status = device.getDeviceStatus();
641 for (Device device : mDevicesByInfo.values()) {
642 if (device.isUidAllowed(uid)) {
643 deviceInfos.add(device.getDeviceInfo());
657 Device device;
659 device = mDevicesByInfo.get(deviceInfo);
660 if (device == null) {
661 throw new IllegalArgumentException("device does not exist: " + deviceInfo);
663 if (!device.isUidAllowed(Binder.getCallingUid())) {
664 throw new SecurityException("Attempt to open private device with wrong UID");
671 client.addDeviceConnection(device, callback);
684 Device device;
686 device = mBluetoothDevices.get(bluetoothDevice);
687 if (device == null) {
688 device = new Device(bluetoothDevice);
689 mBluetoothDevices.put(bluetoothDevice, device);
696 client.addDeviceConnection(device, callback);
729 Device device = mDevicesByServer.get(server.asBinder());
730 if (device != null) {
731 device.closeLocked();
739 for (Device device : mDevicesByInfo.values()) {
740 ServiceInfo serviceInfo = device.getServiceInfo();
744 return device.getDeviceInfo();
753 Device device = mDevicesByInfo.get(deviceInfo);
754 if (device == null) {
755 throw new IllegalArgumentException("no such device for " + deviceInfo);
757 return device.getDeviceStatus();
762 Device device = mDevicesByServer.get(server.asBinder());
763 if (device != null) {
764 if (Binder.getCallingUid() != device.getUid()) {
766 + " does not match device's UID " + device.getUid());
768 device.setDeviceStatus(status);
769 notifyDeviceStatusChanged(device, status);
773 private void notifyDeviceStatusChanged(Device device, MidiDeviceStatus status) {
776 c.deviceStatusChanged(device, status);
800 Device device = null;
805 device = mBluetoothDevices.get(bluetoothDevice);
806 if (device != null) {
807 device.setDeviceInfo(deviceInfo);
810 if (device == null) {
811 device = new Device(server, deviceInfo, serviceInfo, uid);
813 mDevicesByInfo.put(deviceInfo, device);
815 mBluetoothDevices.put(bluetoothDevice, device);
820 c.deviceAdded(device);
828 private void removeDeviceLocked(Device device) {
829 IMidiDeviceServer server = device.getDeviceServer();
833 mDevicesByInfo.remove(device.getDeviceInfo());
837 c.deviceRemoved(device);
870 // ignore virtual device servers that do not require the correct permission
873 Log.w(TAG, "Skipping MIDI device service " + serviceInfo.packageName
892 if ("device".equals(tagName)) {
894 Log.w(TAG, "nested <device> elements in metadata for "
916 Log.w(TAG, "<input-port> outside of <device> in metadata for "
935 Log.w(TAG, "<output-port> outside of <device> in metadata for "
955 if ("device".equals(tagName)) {
958 Log.w(TAG, "<device> with no ports in metadata for "
982 // processing a <device>
1001 Device device = iterator.next();
1002 if (packageName.equals(device.getPackageName())) {
1004 removeDeviceLocked(device);
1021 for (Device device : mDevicesByInfo.values()) {
1022 pw.println(device.toString());