am 67b17615: am fa5a6aff: Merge "Clean up debug messages" into jb-mr1.1-dev

* commit '67b1761534d7e2518830cfb3d2c28271ffe56a26':
  Clean up debug messages
diff --git a/src/com/android/bluetooth/btservice/AdapterProperties.java b/src/com/android/bluetooth/btservice/AdapterProperties.java
index 0c00ffd..9b3c20a 100755
--- a/src/com/android/bluetooth/btservice/AdapterProperties.java
+++ b/src/com/android/bluetooth/btservice/AdapterProperties.java
@@ -547,7 +547,7 @@
     }
 
     private void infoLog(String msg) {
-        Log.i(TAG, msg);
+        if (DBG) Log.i(TAG, msg);
     }
 
     private void debugLog(String msg) {
diff --git a/src/com/android/bluetooth/btservice/ProfileService.java b/src/com/android/bluetooth/btservice/ProfileService.java
index 8339418..e3d9196 100644
--- a/src/com/android/bluetooth/btservice/ProfileService.java
+++ b/src/com/android/bluetooth/btservice/ProfileService.java
@@ -77,7 +77,7 @@
                     refCount = refCount+1;
                 }
                 sReferenceCount.put(mName, refCount);
-                log("REFCOUNT: CREATED. INSTANCE_COUNT=" +refCount);
+                if (DBG) log("REFCOUNT: CREATED. INSTANCE_COUNT=" +refCount);
             }
         }
     }
@@ -99,14 +99,14 @@
 
     @Override
     public void onCreate() {
-        log("onCreate");
+        if (DBG) log("onCreate");
         super.onCreate();
         mAdapter = BluetoothAdapter.getDefaultAdapter();
         mBinder = initBinder();
     }
 
     public int onStartCommand(Intent intent, int flags, int startId) {
-        log("onStartCommand()");
+        if (DBG) log("onStartCommand()");
         if (mStartError || mAdapter == null) {
             Log.w(mName, "Stopping profile service: device does not have BT");
             doStop(intent);
@@ -138,22 +138,22 @@
     }
 
     public IBinder onBind(Intent intent) {
-        log("onBind");
+        if (DBG) log("onBind");
         return mBinder;
     }
 
     public boolean onUnbind(Intent intent) {
-        log("onUnbind");
+        if (DBG) log("onUnbind");
         return super.onUnbind(intent);
     }
 
     @Override
     public void onDestroy() {
-        log("Destroying service.");
+        if (DBG) log("Destroying service.");
         if (mCleaningUp) {
-            log("Cleanup already started... Skipping cleanup()...");
+            if (DBG) log("Cleanup already started... Skipping cleanup()...");
         } else {
-            log("cleanup()");
+            if (DBG) log("cleanup()");
             mCleaningUp = true;
             cleanup();
             if (mBinder != null) {
@@ -170,7 +170,7 @@
         if (mAdapter == null) {
             Log.e(mName, "Error starting profile. BluetoothAdapter is null");
         } else {
-            log("start()");
+            if (DBG) log("start()");
             mStartError = !start();
             if (!mStartError) {
                 notifyProfileServiceStateChanged(BluetoothAdapter.STATE_ON);
@@ -182,7 +182,7 @@
 
     private void doStop(Intent intent) {
         if (stop()) {
-            log("stop()");
+            if (DBG) log("stop()");
             notifyProfileServiceStateChanged(BluetoothAdapter.STATE_OFF);
             stopSelf();
         } else {
diff --git a/src/com/android/bluetooth/hid/HidService.java b/src/com/android/bluetooth/hid/HidService.java
index 2e67154..8f2051f 100755
--- a/src/com/android/bluetooth/hid/HidService.java
+++ b/src/com/android/bluetooth/hid/HidService.java
@@ -179,7 +179,7 @@
                     if(halState == CONN_STATE_CONNECTED &&
                        prevState == BluetoothInputDevice.STATE_DISCONNECTED &&
                        (!okToConnect(device))) {
-                        Log.d(TAG,"Incoming HID connection rejected");
+                        if (DBG) Log.d(TAG,"Incoming HID connection rejected");
                         disconnectHidNative(Utils.getByteAddress(device));
                     } else {
                         broadcastConnectionState(device, convertHalState(halState));
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java
index 9020006..421ad2e 100755
--- a/src/com/android/bluetooth/opp/BluetoothOppService.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppService.java
@@ -680,7 +680,7 @@
             info.mUri = Uri.parse(stringFromCursor(info.mUri.toString(), cursor,
                     BluetoothShare.URI));
         } else {
-            Log.d(TAG, "updateShare() called for ID " + info.mId + " with null URI");
+            Log.w(TAG, "updateShare() called for ID " + info.mId + " with null URI");
         }
         info.mHint = stringFromCursor(info.mHint, cursor, BluetoothShare.FILENAME_HINT);
         info.mFilename = stringFromCursor(info.mFilename, cursor, BluetoothShare._DATA);