diff options
author | Ajay Kumar <ajayku@codeaurora.org> | 2015-10-15 14:07:00 +0530 |
---|---|---|
committer | Ajay Kumar <ajayku@codeaurora.org> | 2015-10-16 15:41:27 +0530 |
commit | 28c8610237f94cf3e8a06576581bac703da34a91 (patch) | |
tree | e4f2138e28bef0b9a632dffa253e26d10c6258f5 /src/com/android/bluetooth/btservice | |
parent | 2906e54ef630fb1fb23ee8c7f6defbefa215bae4 (diff) | |
download | android_packages_apps_Bluetooth-28c8610237f94cf3e8a06576581bac703da34a91.tar.gz android_packages_apps_Bluetooth-28c8610237f94cf3e8a06576581bac703da34a91.tar.bz2 android_packages_apps_Bluetooth-28c8610237f94cf3e8a06576581bac703da34a91.zip |
Bluetooth: Enable debug logs to debug app level issues
Enable debug logs to debug profile level issues like
start timeout etc
Change-Id: Ifb724a37e6a77dee7de54825a19e4761b2373465
Diffstat (limited to 'src/com/android/bluetooth/btservice')
-rw-r--r-- | src/com/android/bluetooth/btservice/AdapterService.java | 21 | ||||
-rw-r--r--[-rwxr-xr-x] | src/com/android/bluetooth/btservice/ProfileService.java | 2 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java index 44a3dd0af..433ac09dc 100644 --- a/src/com/android/bluetooth/btservice/AdapterService.java +++ b/src/com/android/bluetooth/btservice/AdapterService.java @@ -332,7 +332,7 @@ public class AdapterService extends Service { doUpdate=true; } } - debugLog("onProfileServiceStateChange() serviceName=" + serviceName + Log.w(TAG, "onProfileServiceStateChange() serviceName=" + serviceName + ", state=" + state +", doUpdate=" + doUpdate); if (!doUpdate) { @@ -378,13 +378,13 @@ public class AdapterService extends Service { continue; } if (BluetoothAdapter.STATE_OFF != entry.getValue()) { - Log.d(TAG,"onProfileServiceStateChange() - Profile still running: " + Log.w(TAG,"onProfileServiceStateChange() - Profile still running: " + entry.getKey()); return; } } } - debugLog("onProfileServiceStateChange() - All profile services stopped..."); + Log.w(TAG,"onProfileServiceStateChange() - All profile services stopped..."); //Send message to state machine mProfilesStarted=false; mAdapterStateMachine.sendMessage(mAdapterStateMachine.obtainMessage(AdapterState.BREDR_STOPPED)); @@ -398,18 +398,18 @@ public class AdapterService extends Service { Map.Entry<String,Integer> entry = i.next(); debugLog("Service: " + entry.getKey()); if (entry.getKey().equals("com.android.bluetooth.gatt.GattService")) { - debugLog("Skip GATT service - already started before"); + Log.w(TAG, "Skip GATT service - already started before"); continue; } if (BluetoothAdapter.STATE_ON != entry.getValue()) { - debugLog("onProfileServiceStateChange() - Profile still not running:" + Log.w(TAG, "onProfileServiceStateChange() - Profile still not running:" + entry.getKey()); return; } } } - debugLog("onProfileServiceStateChange() - All profile services started."); + Log.w(TAG,"onProfileServiceStateChange() - All profile services started."); mProfilesStarted=true; //Send message to state machine mAdapterStateMachine.sendMessage(mAdapterStateMachine.obtainMessage(AdapterState.BREDR_STARTED)); @@ -448,7 +448,7 @@ public class AdapterService extends Service { } public boolean onUnbind(Intent intent) { if (getState() == BluetoothAdapter.STATE_OFF) { - debugLog("onUnbind, calling cleanup"); + Log.w(TAG, "onUnbind, calling cleanup"); cleanup(); return super.onUnbind(intent); } @@ -488,7 +488,7 @@ public class AdapterService extends Service { //Startup all profile services setProfileServiceState(supportedProfileServices,BluetoothAdapter.STATE_ON); }else { - debugLog("startCoreProfiles(): Profile Services alreay started"); + Log.w(TAG,"startCoreProfiles(): Profile Services alreay started"); mAdapterStateMachine.sendMessage(mAdapterStateMachine.obtainMessage(AdapterState.BREDR_STARTED)); } } @@ -713,6 +713,7 @@ public class AdapterService extends Service { expectedCurrentState= BluetoothAdapter.STATE_ON; pendingState = BluetoothAdapter.STATE_TURNING_OFF; } + Log.w(TAG, "Total profiles ="+ (services.length)); for (int i=0; i <services.length;i++) { String serviceName = services[i].getName(); @@ -722,14 +723,14 @@ public class AdapterService extends Service { Integer serviceState = mProfileServicesState.get(serviceName); if(serviceState != null && serviceState != expectedCurrentState) { - debugLog("setProfileServiceState() - Unable to " + Log.w(TAG, "setProfileServiceState() - Unable to " + (state == BluetoothAdapter.STATE_OFF ? "start" : "stop" ) + " service " + serviceName + ". Invalid state: " + serviceState); continue; } - debugLog("setProfileServiceState() - " + Log.w(TAG, "setProfileServiceState() - " + (state == BluetoothAdapter.STATE_OFF ? "Stopping" : "Starting") + " service " + serviceName); diff --git a/src/com/android/bluetooth/btservice/ProfileService.java b/src/com/android/bluetooth/btservice/ProfileService.java index c3802fb60..b470aaf60 100755..100644 --- a/src/com/android/bluetooth/btservice/ProfileService.java +++ b/src/com/android/bluetooth/btservice/ProfileService.java @@ -202,6 +202,7 @@ public abstract class ProfileService extends Service { if (DBG) log("start()"); mStartError = !start(); if (!mStartError) { + Log.d(mName, " profile started successfully"); notifyProfileServiceStateChanged(BluetoothAdapter.STATE_ON); } else { Log.e(mName, "Error starting profile. BluetoothAdapter is null"); @@ -213,6 +214,7 @@ public abstract class ProfileService extends Service { if (stop()) { if (DBG) log("stop()"); stopSelf(); + Log.d(mName, " profile stopped successfully"); notifyProfileServiceStateChanged(BluetoothAdapter.STATE_OFF); } else { Log.e(mName, "Unable to stop profile"); |