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; }