Ejemplo n.º 1
0
 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");
       }
     }
   }
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
    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;
    }
Ejemplo n.º 4
0
 public boolean getIdleTime(BluetoothDevice device) {
   HidService service = getService();
   if (service == null) return false;
   return service.getIdleTime(device);
 }
Ejemplo n.º 5
0
 public boolean sendData(BluetoothDevice device, String report) {
   HidService service = getService();
   if (service == null) return false;
   return service.sendData(device, report);
 }
Ejemplo n.º 6
0
 public boolean setReport(BluetoothDevice device, byte reportType, String report) {
   HidService service = getService();
   if (service == null) return false;
   return service.setReport(device, reportType, report);
 }
Ejemplo n.º 7
0
 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);
 }
Ejemplo n.º 8
0
 public boolean setProtocolMode(BluetoothDevice device, int protocolMode) {
   HidService service = getService();
   if (service == null) return false;
   return service.setProtocolMode(device, protocolMode);
 }
Ejemplo n.º 9
0
 public boolean virtualUnplug(BluetoothDevice device) {
   HidService service = getService();
   if (service == null) return false;
   return service.virtualUnplug(device);
 }
Ejemplo n.º 10
0
 public int getPriority(BluetoothDevice device) {
   HidService service = getService();
   if (service == null) return BluetoothProfile.PRIORITY_UNDEFINED;
   return service.getPriority(device);
 }
Ejemplo n.º 11
0
 public boolean setPriority(BluetoothDevice device, int priority) {
   HidService service = getService();
   if (service == null) return false;
   return service.setPriority(device, priority);
 }
Ejemplo n.º 12
0
 public List<BluetoothDevice> getDevicesMatchingConnectionStates(int[] states) {
   HidService service = getService();
   if (service == null) return new ArrayList<BluetoothDevice>(0);
   return service.getDevicesMatchingConnectionStates(states);
 }
Ejemplo n.º 13
0
 public int getConnectionState(BluetoothDevice device) {
   HidService service = getService();
   if (service == null) return BluetoothInputDevice.STATE_DISCONNECTED;
   return service.getConnectionState(device);
 }
Ejemplo n.º 14
0
 public boolean disconnect(BluetoothDevice device) {
   HidService service = getService();
   if (service == null) return false;
   return service.disconnect(device);
 }