am df9d0fe5: Merge "Turn off dbg messages, be prepared for production build" into jb-mr1-dev
* commit 'df9d0fe584874f8cafa6ecedb3c3c054c9e99cba':
Turn off dbg messages, be prepared for production build
diff --git a/src/com/android/bluetooth/a2dp/A2dpService.java b/src/com/android/bluetooth/a2dp/A2dpService.java
index da30597..38c5f3a 100755
--- a/src/com/android/bluetooth/a2dp/A2dpService.java
+++ b/src/com/android/bluetooth/a2dp/A2dpService.java
@@ -22,7 +22,7 @@
* @hide
*/
public class A2dpService extends ProfileService {
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final String TAG="A2dpService";
private A2dpStateMachine mStateMachine;
diff --git a/src/com/android/bluetooth/a2dp/A2dpStateMachine.java b/src/com/android/bluetooth/a2dp/A2dpStateMachine.java
index d702966..dc79fb2 100755
--- a/src/com/android/bluetooth/a2dp/A2dpStateMachine.java
+++ b/src/com/android/bluetooth/a2dp/A2dpStateMachine.java
@@ -47,7 +47,7 @@
final class A2dpStateMachine extends StateMachine {
private static final String TAG = "A2dpStateMachine";
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
static final int CONNECT = 1;
static final int DISCONNECT = 2;
@@ -154,11 +154,9 @@
@Override
public boolean processMessage(Message message) {
log("Disconnected process message: " + message.what);
- if (DBG) {
- if (mCurrentDevice != null || mTargetDevice != null || mIncomingDevice != null) {
- log("ERROR: current, target, or mIncomingDevice not null in Disconnected");
- return NOT_HANDLED;
- }
+ if (mCurrentDevice != null || mTargetDevice != null || mIncomingDevice != null) {
+ Log.e(TAG, "ERROR: current, target, or mIncomingDevice not null in Disconnected");
+ return NOT_HANDLED;
}
boolean retValue = HANDLED;
@@ -415,9 +413,7 @@
// The stack is connecting to target device or
// there is an incoming connection from the target device at the same time
// we already broadcasted the intent, doing nothing here
- if (DBG) {
- log("Stack and target device are connecting");
- }
+ log("Stack and target device are connecting");
}
else if (mIncomingDevice != null && mIncomingDevice.equals(device)) {
Log.e(TAG, "Another connecting event on the incoming device");
@@ -461,11 +457,9 @@
@Override
public boolean processMessage(Message message) {
log("Connected process message: " + message.what);
- if (DBG) {
- if (mCurrentDevice == null) {
- log("ERROR: mCurrentDevice is null in Connected");
- return NOT_HANDLED;
- }
+ if (mCurrentDevice == null) {
+ Log.e(TAG, "ERROR: mCurrentDevice is null in Connected");
+ return NOT_HANDLED;
}
boolean retValue = HANDLED;
@@ -690,7 +684,7 @@
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
mContext.sendBroadcast(intent, A2dpService.BLUETOOTH_PERM);
- if (DBG) log("A2DP Playing state : device: " + device + " State:" + prevState + "->" + state);
+ log("A2DP Playing state : device: " + device + " State:" + prevState + "->" + state);
}
private byte[] getByteAddress(BluetoothDevice device) {
@@ -715,9 +709,7 @@
}
private void log(String msg) {
- if (DBG) {
- Log.d(TAG, msg);
- }
+ Log.d(TAG, msg);
}
private class StackEvent {
@@ -739,7 +731,7 @@
intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
mContext.sendBroadcast(intent, ProfileService.BLUETOOTH_PERM);
- if (DBG) log("Connection state " + device + ": " + prevState + "->" + state);
+ log("Connection state " + device + ": " + prevState + "->" + state);
mService.notifyProfileConnectionStateChanged(device, BluetoothProfile.A2DP, state, prevState);
}
diff --git a/src/com/android/bluetooth/btservice/AdapterApp.java b/src/com/android/bluetooth/btservice/AdapterApp.java
index f2d989e..a7f90e8 100644
--- a/src/com/android/bluetooth/btservice/AdapterApp.java
+++ b/src/com/android/bluetooth/btservice/AdapterApp.java
@@ -13,7 +13,7 @@
public class AdapterApp extends Application {
private static final String TAG = "BluetoothAdapterApp";
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
//For Debugging only
private static int sRefCount=0;
diff --git a/src/com/android/bluetooth/btservice/AdapterProperties.java b/src/com/android/bluetooth/btservice/AdapterProperties.java
index 80f51b3..9b7b2a6 100755
--- a/src/com/android/bluetooth/btservice/AdapterProperties.java
+++ b/src/com/android/bluetooth/btservice/AdapterProperties.java
@@ -20,7 +20,7 @@
import java.util.ArrayList;
class AdapterProperties {
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final String TAG = "BluetoothAdapterProperties";
private static final int BD_ADDR_LEN = 6; // 6 bytes
@@ -180,7 +180,7 @@
*/
void setState(int mState) {
synchronized (mObject) {
- Log.d(TAG,"Setting state to " + mState);
+ debugLog("Setting state to " + mState);
this.mState = mState;
}
}
@@ -190,7 +190,7 @@
*/
int getState() {
synchronized (mObject) {
- Log.d(TAG,"State = " + mState);
+ debugLog("State = " + mState);
return mState;
}
}
@@ -300,7 +300,7 @@
convertToAdapterState(prevState));
intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT);
mService.sendBroadcast(intent, mService.BLUETOOTH_PERM);
- debugLog("CONNECTION_STATE_CHANGE: " + device + ": "
+ Log.d(TAG, "CONNECTION_STATE_CHANGE: " + device + ": "
+ prevState + " -> " + state);
}
}
diff --git a/src/com/android/bluetooth/btservice/AdapterService.java b/src/com/android/bluetooth/btservice/AdapterService.java
index 55b83be..e32c8c5 100755
--- a/src/com/android/bluetooth/btservice/AdapterService.java
+++ b/src/com/android/bluetooth/btservice/AdapterService.java
@@ -57,7 +57,7 @@
public class AdapterService extends Service {
private static final String TAG = "BluetoothAdapterService";
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final boolean TRACE_REF = true;
//For Debugging only
private static int sRefCount=0;
diff --git a/src/com/android/bluetooth/btservice/AdapterState.java b/src/com/android/bluetooth/btservice/AdapterState.java
index de0c5d3..ea13094 100755
--- a/src/com/android/bluetooth/btservice/AdapterState.java
+++ b/src/com/android/bluetooth/btservice/AdapterState.java
@@ -24,7 +24,7 @@
*/
final class AdapterState extends StateMachine {
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final String TAG = "BluetoothAdapterState";
static final int USER_TURN_ON = 1;
diff --git a/src/com/android/bluetooth/btservice/BondStateMachine.java b/src/com/android/bluetooth/btservice/BondStateMachine.java
index b9b8eda..d192ddc 100755
--- a/src/com/android/bluetooth/btservice/BondStateMachine.java
+++ b/src/com/android/bluetooth/btservice/BondStateMachine.java
@@ -31,7 +31,7 @@
*/
final class BondStateMachine extends StateMachine {
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final String TAG = "BluetoothBondStateMachine";
static final int CREATE_BOND = 1;
diff --git a/src/com/android/bluetooth/btservice/ProfileService.java b/src/com/android/bluetooth/btservice/ProfileService.java
index baaf403..fab9ad8 100644
--- a/src/com/android/bluetooth/btservice/ProfileService.java
+++ b/src/com/android/bluetooth/btservice/ProfileService.java
@@ -15,7 +15,7 @@
import android.util.Log;
public abstract class ProfileService extends Service {
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
//For Debugging only
private static HashMap<String, Integer> sReferenceCount = new HashMap<String,Integer>();
diff --git a/src/com/android/bluetooth/btservice/RemoteDevices.java b/src/com/android/bluetooth/btservice/RemoteDevices.java
index 48b740c..df83b67 100755
--- a/src/com/android/bluetooth/btservice/RemoteDevices.java
+++ b/src/com/android/bluetooth/btservice/RemoteDevices.java
@@ -23,7 +23,7 @@
final class RemoteDevices {
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final String TAG = "BluetoothRemoteDevices";
diff --git a/src/com/android/bluetooth/hdp/HealthService.java b/src/com/android/bluetooth/hdp/HealthService.java
index 75a6cf8..51180ac 100755
--- a/src/com/android/bluetooth/hdp/HealthService.java
+++ b/src/com/android/bluetooth/hdp/HealthService.java
@@ -43,7 +43,7 @@
* @hide
*/
public class HealthService extends ProfileService {
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final String TAG="HealthService";
private List<HealthChannel> mHealthChannels;
@@ -566,7 +566,7 @@
BluetoothDevice device, int state, int prevState, ParcelFileDescriptor fd, int id) {
broadcastHealthDeviceStateChange(device, state);
- if (DBG) log("Health Device Callback: " + device + " State Change: " + prevState + "->" +
+ log("Health Device Callback: " + device + " State Change: " + prevState + "->" +
state);
ParcelFileDescriptor dupedFd = null;
diff --git a/src/com/android/bluetooth/hfp/HeadsetService.java b/src/com/android/bluetooth/hfp/HeadsetService.java
index a7e5cb0..09e8d6b 100755
--- a/src/com/android/bluetooth/hfp/HeadsetService.java
+++ b/src/com/android/bluetooth/hfp/HeadsetService.java
@@ -31,7 +31,7 @@
* @hide
*/
public class HeadsetService extends ProfileService {
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final String TAG = "HeadsetService";
private static final String MODIFY_PHONE_STATE = android.Manifest.permission.MODIFY_PHONE_STATE;
diff --git a/src/com/android/bluetooth/hfp/HeadsetStateMachine.java b/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
index 3c8106f..b4f637c 100755
--- a/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
+++ b/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
@@ -54,7 +54,7 @@
final class HeadsetStateMachine extends StateMachine {
private static final String TAG = "HeadsetStateMachine";
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
//For Debugging only
private static int sRefCount=0;
@@ -240,11 +240,9 @@
@Override
public boolean processMessage(Message message) {
log("Disconnected process message: " + message.what);
- if (DBG) {
- if (mCurrentDevice != null || mTargetDevice != null || mIncomingDevice != null) {
- log("ERROR: current, target, or mIncomingDevice not null in Disconnected");
- return NOT_HANDLED;
- }
+ if (mCurrentDevice != null || mTargetDevice != null || mIncomingDevice != null) {
+ Log.e(TAG, "ERROR: current, target, or mIncomingDevice not null in Disconnected");
+ return NOT_HANDLED;
}
boolean retValue = HANDLED;
@@ -1225,7 +1223,7 @@
// This method does not check for error conditon (newState == prevState)
private void broadcastConnectionState(BluetoothDevice device, int newState, int prevState) {
- if (DBG) log("Connection state " + device + ": " + prevState + "->" + newState);
+ log("Connection state " + device + ": " + prevState + "->" + newState);
if(prevState == BluetoothProfile.STATE_CONNECTED) {
// Headset is disconnecting, stop Virtual call if active.
terminateScoUsingVirtualVoiceCall();
@@ -1254,7 +1252,7 @@
intent.putExtra(BluetoothProfile.EXTRA_STATE, newState);
intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
mService.sendBroadcast(intent, HeadsetService.BLUETOOTH_PERM);
- if (DBG) log("Audio state " + device + ": " + prevState + "->" + newState);
+ log("Audio state " + device + ": " + prevState + "->" + newState);
}
private void configAudioParameters()
diff --git a/src/com/android/bluetooth/hid/HidService.java b/src/com/android/bluetooth/hid/HidService.java
index ade3aff..c6bbd81 100755
--- a/src/com/android/bluetooth/hid/HidService.java
+++ b/src/com/android/bluetooth/hid/HidService.java
@@ -35,7 +35,7 @@
* @hide
*/
public class HidService extends ProfileService {
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final String TAG = "HidService";
private Map<BluetoothDevice, Integer> mInputDevices;
@@ -561,7 +561,7 @@
/* Notifying the connection state change of the profile before sending the intent for
connection state change, as it was causing a race condition, with the UI not being
updated with the correct connection state. */
- if (DBG) log("Connection state " + device + ": " + prevState + "->" + newState);
+ log("Connection state " + device + ": " + prevState + "->" + newState);
notifyProfileConnectionStateChanged(device, BluetoothProfile.INPUT_DEVICE,
newState, prevState);
Intent intent = new Intent(BluetoothInputDevice.ACTION_CONNECTION_STATE_CHANGED);
diff --git a/src/com/android/bluetooth/opp/Constants.java b/src/com/android/bluetooth/opp/Constants.java
index cd57643..b17c0e4 100644
--- a/src/com/android/bluetooth/opp/Constants.java
+++ b/src/com/android/bluetooth/opp/Constants.java
@@ -231,7 +231,7 @@
/**
* Verbose level logging
*/
- public static final boolean VERBOSE = true;
+ public static final boolean VERBOSE = false;
/** use TCP socket instead of Rfcomm Socket to develop */
public static final boolean USE_TCP_DEBUG = false;
diff --git a/src/com/android/bluetooth/pan/PanService.java b/src/com/android/bluetooth/pan/PanService.java
index a7d6817..f8a2485 100755
--- a/src/com/android/bluetooth/pan/PanService.java
+++ b/src/com/android/bluetooth/pan/PanService.java
@@ -44,7 +44,7 @@
*/
public class PanService extends ProfileService {
private static final String TAG = "PanService";
- private static final boolean DBG = true;
+ private static final boolean DBG = false;
private static final String BLUETOOTH_IFACE_ADDR_START= "192.168.44.1";
private static final int BLUETOOTH_MAX_PAN_CONNECTIONS = 5;
@@ -211,7 +211,7 @@
public void setBluetoothTethering(boolean value) {
PanService service = getService();
if (service == null) return;
- if(DBG) Log.d(TAG, "setBluetoothTethering: " + value +", mTetherOn: " + service.mTetherOn);
+ Log.d(TAG, "setBluetoothTethering: " + value +", mTetherOn: " + service.mTetherOn);
service.setBluetoothTethering(value);
}
@@ -421,7 +421,7 @@
/* Notifying the connection state change of the profile before sending the intent for
connection state change, as it was causing a race condition, with the UI not being
updated with the correct connection state. */
- if (DBG) Log.d(TAG, "Pan Device state : device: " + device + " State:" +
+ Log.d(TAG, "Pan Device state : device: " + device + " State:" +
prevState + "->" + state);
notifyProfileConnectionStateChanged(device, BluetoothProfile.PAN, state, prevState);
Intent intent = new Intent(BluetoothPan.ACTION_CONNECTION_STATE_CHANGED);
diff --git a/src/com/android/bluetooth/pbap/BluetoothPbapService.java b/src/com/android/bluetooth/pbap/BluetoothPbapService.java
index 21fbee3..49e19e5 100755
--- a/src/com/android/bluetooth/pbap/BluetoothPbapService.java
+++ b/src/com/android/bluetooth/pbap/BluetoothPbapService.java
@@ -78,7 +78,7 @@
public static final boolean DEBUG = true;
- public static final boolean VERBOSE = true;
+ public static final boolean VERBOSE = false;
/**
* Intent indicating incoming obex authentication request which is from