private static synchronized void setHidService(HidService instance) { if (instance != null && instance.isAvailable()) { if (DBG) Log.d(TAG, "setHidService(): set to: " + sHidService); sHidService = instance; } else { if (DBG) { if (sHidService == null) { Log.d(TAG, "setHidService(): service not available"); } else if (!sHidService.isAvailable()) { Log.d(TAG, "setHidService(): service is cleaning up"); } } } }
public static synchronized HidService getHidService() { if (sHidService != null && sHidService.isAvailable()) { if (DBG) Log.d(TAG, "getHidService(): returning " + sHidService); return sHidService; } if (DBG) { if (sHidService == null) { Log.d(TAG, "getHidService(): service is NULL"); } else if (!(sHidService.isAvailable())) { Log.d(TAG, "getHidService(): service is not available"); } } return null; }
private HidService getService() { if (!Utils.checkCaller()) { Log.w(TAG, "InputDevice call not allowed for non-active user"); return null; } if (mService != null && mService.isAvailable()) { return mService; } return null; }
public boolean getIdleTime(BluetoothDevice device) { HidService service = getService(); if (service == null) return false; return service.getIdleTime(device); }
public boolean sendData(BluetoothDevice device, String report) { HidService service = getService(); if (service == null) return false; return service.sendData(device, report); }
public boolean setReport(BluetoothDevice device, byte reportType, String report) { HidService service = getService(); if (service == null) return false; return service.setReport(device, reportType, report); }
public boolean getReport( BluetoothDevice device, byte reportType, byte reportId, int bufferSize) { HidService service = getService(); if (service == null) return false; return service.getReport(device, reportType, reportId, bufferSize); }
public boolean setProtocolMode(BluetoothDevice device, int protocolMode) { HidService service = getService(); if (service == null) return false; return service.setProtocolMode(device, protocolMode); }
public boolean virtualUnplug(BluetoothDevice device) { HidService service = getService(); if (service == null) return false; return service.virtualUnplug(device); }
public int getPriority(BluetoothDevice device) { HidService service = getService(); if (service == null) return BluetoothProfile.PRIORITY_UNDEFINED; return service.getPriority(device); }
public boolean setPriority(BluetoothDevice device, int priority) { HidService service = getService(); if (service == null) return false; return service.setPriority(device, priority); }
public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) { HidService service = getService(); if (service == null) return new ArrayList<BluetoothDevice>(0); return service.getDevicesMatchingConnectionStates(states); }
public int getConnectionState(BluetoothDevice device) { HidService service = getService(); if (service == null) return BluetoothInputDevice.STATE_DISCONNECTED; return service.getConnectionState(device); }
public boolean disconnect(BluetoothDevice device) { HidService service = getService(); if (service == null) return false; return service.disconnect(device); }