MI: some more logging
This commit is contained in:
parent
6c16b4fb15
commit
ec6a8b6743
|
@ -293,6 +293,7 @@ public class DiscoveryActivity extends GBActivity implements AdapterView.OnItemC
|
||||||
DeviceType deviceType = DeviceHelper.getInstance().getSupportedType(candidate);
|
DeviceType deviceType = DeviceHelper.getInstance().getSupportedType(candidate);
|
||||||
if (deviceType.isSupported()) {
|
if (deviceType.isSupported()) {
|
||||||
candidate.setDeviceType(deviceType);
|
candidate.setDeviceType(deviceType);
|
||||||
|
LOG.info("Recognized supported device: " + candidate);
|
||||||
int index = deviceCandidates.indexOf(candidate);
|
int index = deviceCandidates.indexOf(candidate);
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
deviceCandidates.set(index, candidate); // replace
|
deviceCandidates.set(index, candidate); // replace
|
||||||
|
@ -506,6 +507,7 @@ public class DiscoveryActivity extends GBActivity implements AdapterView.OnItemC
|
||||||
|
|
||||||
stopDiscovery();
|
stopDiscovery();
|
||||||
DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(deviceCandidate);
|
DeviceCoordinator coordinator = DeviceHelper.getInstance().getCoordinator(deviceCandidate);
|
||||||
|
LOG.info("Using device candidate " + deviceCandidate + " with coordinator: " + coordinator.getClass());
|
||||||
Class<? extends Activity> pairingActivity = coordinator.getPairingActivity();
|
Class<? extends Activity> pairingActivity = coordinator.getPairingActivity();
|
||||||
if (pairingActivity != null) {
|
if (pairingActivity != null) {
|
||||||
Intent intent = new Intent(this, pairingActivity);
|
Intent intent = new Intent(this, pairingActivity);
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class MiBandPairingActivity extends GBActivity {
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(MiBandPairingActivity.class);
|
private static final Logger LOG = LoggerFactory.getLogger(MiBandPairingActivity.class);
|
||||||
|
|
||||||
private static final int REQ_CODE_USER_SETTINGS = 52;
|
private static final int REQ_CODE_USER_SETTINGS = 52;
|
||||||
private static final String STATE_MIBAND_ADDRESS = "mibandMacAddress";
|
private static final String STATE_DEVICE_CANDIDATE = "stateDeviceCandidate";
|
||||||
private static final long DELAY_AFTER_BONDING = 1000; // 1s
|
private static final long DELAY_AFTER_BONDING = 1000; // 1s
|
||||||
private TextView message;
|
private TextView message;
|
||||||
private boolean isPairing;
|
private boolean isPairing;
|
||||||
|
@ -103,7 +103,7 @@ public class MiBandPairingActivity extends GBActivity {
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
deviceCandidate = intent.getParcelableExtra(DeviceCoordinator.EXTRA_DEVICE_CANDIDATE);
|
deviceCandidate = intent.getParcelableExtra(DeviceCoordinator.EXTRA_DEVICE_CANDIDATE);
|
||||||
if (deviceCandidate == null && savedInstanceState != null) {
|
if (deviceCandidate == null && savedInstanceState != null) {
|
||||||
deviceCandidate = savedInstanceState.getParcelable(STATE_MIBAND_ADDRESS);
|
deviceCandidate = savedInstanceState.getParcelable(STATE_DEVICE_CANDIDATE);
|
||||||
}
|
}
|
||||||
if (deviceCandidate == null) {
|
if (deviceCandidate == null) {
|
||||||
Toast.makeText(this, getString(R.string.message_cannot_pair_no_mac), Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, getString(R.string.message_cannot_pair_no_mac), Toast.LENGTH_SHORT).show();
|
||||||
|
@ -125,13 +125,13 @@ public class MiBandPairingActivity extends GBActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
outState.putParcelable(STATE_MIBAND_ADDRESS, deviceCandidate);
|
outState.putParcelable(STATE_DEVICE_CANDIDATE, deviceCandidate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
protected void onRestoreInstanceState(Bundle savedInstanceState) {
|
||||||
super.onRestoreInstanceState(savedInstanceState);
|
super.onRestoreInstanceState(savedInstanceState);
|
||||||
deviceCandidate = savedInstanceState.getParcelable(STATE_MIBAND_ADDRESS);
|
deviceCandidate = savedInstanceState.getParcelable(STATE_DEVICE_CANDIDATE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue