コード例 #1
0
 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;
 }
コード例 #2
0
 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");
       }
     }
   }
 }
コード例 #3
0
    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;
    }