public static synchronized A2dpService getA2dpService() { if (sAd2dpService != null && sAd2dpService.isAvailable()) { if (DBG) Log.d(TAG, "getA2DPService(): returning " + sAd2dpService); return sAd2dpService; } if (DBG) { if (sAd2dpService == null) { Log.d(TAG, "getA2dpService(): service is NULL"); } else if (!(sAd2dpService.isAvailable())) { Log.d(TAG, "getA2dpService(): service is not available"); } } return null; }
private static synchronized void setA2dpService(A2dpService instance) { if (instance != null && instance.isAvailable()) { if (DBG) Log.d(TAG, "setA2dpService(): set to: " + sAd2dpService); sAd2dpService = instance; } else { if (DBG) { if (sAd2dpService == null) { Log.d(TAG, "setA2dpService(): service not available"); } else if (!sAd2dpService.isAvailable()) { Log.d(TAG, "setA2dpService(): service is cleaning up"); } } } }
private A2dpService getService() { if (!Utils.checkCaller()) { Log.w(TAG, "A2dp call not allowed for non-active user"); return null; } if (mService != null && mService.isAvailable()) { return mService; } return null; }