Add log and turn on debug flag

Add log and turn on debug flag

Bug: 80161203
Test: make -j42 RunSettingsRoboTests
Change-Id: Ibd57f91b83c487ee71adb9e3de7ecfc5ea66bbef
This commit is contained in:
hughchen
2018-06-28 17:25:40 +08:00
committed by Hugh Chen
parent a5f68f9c3c
commit 37dd4f1c71
4 changed files with 14 additions and 2 deletions

View File

@@ -19,6 +19,7 @@ import android.bluetooth.BluetoothDevice;
import android.content.Context;
import android.os.Bundle;
import android.os.SystemProperties;
import android.util.Log;
import com.android.settings.R;
import com.android.settings.connecteddevice.DevicePreferenceCallback;
@@ -49,6 +50,7 @@ import androidx.preference.Preference;
public abstract class BluetoothDeviceUpdater implements BluetoothCallback,
LocalBluetoothProfileManager.ServiceListener {
private static final String TAG = "BluetoothDeviceUpdater";
private static final boolean DBG = true;
private static final String BLUETOOTH_SHOW_DEVICES_WITHOUT_NAMES_PROPERTY =
"persist.bluetooth.showdeviceswithoutnames";
@@ -250,6 +252,10 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback,
return false;
}
final BluetoothDevice device = cachedDevice.getDevice();
if (DBG) {
Log.d(TAG, "isDeviceConnected() device name : " + cachedDevice.getName() +
", is connected : " + device.isConnected());
}
return device.getBondState() == BluetoothDevice.BOND_BONDED && device.isConnected();
}
}