Beispiel #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");
       }
     }
   }
 }
Beispiel #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;
 }
Beispiel #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;
    }