From ce4d93666275df294cb073fe41de5b85932570a8 Mon Sep 17 00:00:00 2001 From: Nick Pelly Date: Thu, 27 Aug 2009 18:42:51 -0700 Subject: Clean up Logging. Use the pattern if (V) Log.v(...); for logging. The Android style prefers curly braces, but for log lines it is ok to use a one-liner to keep the code manageable. Remove spaces from some log tags, and rename TAG BluetoothShareProvider to BluetoothOpp. Rename LOGVV to V, and LOGV to D. Just before ship we will change Constants.DEBUG and Constants.VERBOSE to false to compile out all the logging code. --- .../opp/BluetoothOppTransferActivity.java | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java') diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java b/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java index 666426c11..0d600bda7 100644 --- a/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java +++ b/src/com/android/bluetooth/opp/BluetoothOppTransferActivity.java @@ -67,6 +67,8 @@ import android.text.format.Formatter; public class BluetoothOppTransferActivity extends AlertActivity implements DialogInterface.OnClickListener { private static final String TAG = "BluetoothOppTransferActivity"; + private static final boolean D = Constants.DEBUG; + private static final boolean V = Constants.VERBOSE; private Uri mUri; @@ -118,9 +120,7 @@ public class BluetoothOppTransferActivity extends AlertActivity implements @Override public void onChange(boolean selfChange) { - if (Constants.LOGVV) { - Log.v(TAG, "received db changes."); - } + if (V) Log.v(TAG, "received db changes."); updateProgressbar(); } } @@ -134,9 +134,7 @@ public class BluetoothOppTransferActivity extends AlertActivity implements mTransInfo = new BluetoothOppTransferInfo(); mTransInfo = BluetoothOppUtility.queryRecord(this, mUri); if (mTransInfo == null) { - if (Constants.LOGVV) { - Log.e(TAG, "Error: Can not get data from db"); - } + if (V) Log.e(TAG, "Error: Can not get data from db"); finish(); return; } @@ -165,9 +163,7 @@ public class BluetoothOppTransferActivity extends AlertActivity implements @Override protected void onDestroy() { - if (Constants.LOGV) { - Log.v(TAG, "onDestroy()"); - } + if (D) Log.d(TAG, "onDestroy()"); if (mObserver != null) { getContentResolver().unregisterContentObserver(mObserver); @@ -204,10 +200,8 @@ public class BluetoothOppTransferActivity extends AlertActivity implements } } - if (Constants.LOGVV) { - Log.v(TAG, " WhichDialog/dir/isComplete/failOrSuccess" + mWhichDialog + direction + if (V) Log.v(TAG, " WhichDialog/dir/isComplete/failOrSuccess" + mWhichDialog + direction + isComplete + isSuccess); - } } private void setUpDialog() { @@ -420,9 +414,7 @@ public class BluetoothOppTransferActivity extends AlertActivity implements private void updateProgressbar() { mTransInfo = BluetoothOppUtility.queryRecord(this, mUri); if (mTransInfo == null) { - if (Constants.LOGVV) { - Log.e(TAG, "Error: Can not get data from db"); - } + if (V) Log.e(TAG, "Error: Can not get data from db"); return; } -- cgit v1.2.3