diff options
Diffstat (limited to 'apps/CtsVerifier/src/com/android/cts/verifier/companion/CompanionDeviceServiceTestActivity.java')
-rw-r--r-- | apps/CtsVerifier/src/com/android/cts/verifier/companion/CompanionDeviceServiceTestActivity.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/companion/CompanionDeviceServiceTestActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/companion/CompanionDeviceServiceTestActivity.java index 97ec07acf78..b8b96023cb7 100644 --- a/apps/CtsVerifier/src/com/android/cts/verifier/companion/CompanionDeviceServiceTestActivity.java +++ b/apps/CtsVerifier/src/com/android/cts/verifier/companion/CompanionDeviceServiceTestActivity.java @@ -118,7 +118,7 @@ public class CompanionDeviceServiceTestActivity extends PassFailButtons.Activity /** Stop observing to associated device and then disassociate. */ private void disassociate(AssociationInfo association) { - String deviceAddress = association.getDeviceMacAddress().toString(); + String deviceAddress = association.getDeviceMacAddressAsString(); mCompanionDeviceManager.stopObservingDevicePresence(deviceAddress); mCompanionDeviceManager.disassociate(association.getId()); Log.d(LOG_TAG, "Disassociated with device: " + deviceAddress); @@ -142,14 +142,11 @@ public class CompanionDeviceServiceTestActivity extends PassFailButtons.Activity AssociationInfo association = data.getParcelableExtra(CompanionDeviceManager.EXTRA_ASSOCIATION, AssociationInfo.class); + String deviceAddress = association.getDeviceMacAddressAsString(); // This test is for bluetooth devices, which should all have a MAC address. - if (association == null || association.getDeviceMacAddress() == null) { - fail("The device was present but its address was null."); - return; - } + if (deviceAddress == null) fail("The device was present but its address was null."); - String deviceAddress = association.getDeviceMacAddress().toString(); mCompanionDeviceManager.startObservingDevicePresence(deviceAddress); mCurrentAssociation = getAssociation(association.getId()); Log.d(LOG_TAG, "Associated with device: " + deviceAddress); @@ -288,9 +285,7 @@ public class CompanionDeviceServiceTestActivity extends PassFailButtons.Activity @Override boolean verify() { // Check that it is associated and being observed. - // Bypass inaccessible AssociationInfo#isNotifyOnDeviceNearby() with toString() - return mCurrentAssociation != null - && mCurrentAssociation.toString().contains("mNotifyOnDeviceNearby=true"); + return mCurrentAssociation != null && mCurrentAssociation.isNotifyOnDeviceNearby(); } } |