Merge "Use flag to confirm whether callback should unregister"

This commit is contained in:
TreeHugger Robot
2019-12-30 02:39:03 +00:00
committed by Android (Google) Code Review
2 changed files with 11 additions and 17 deletions

View File

@@ -210,11 +210,8 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
}
@Test
public void onStop_isAvailable_unregisterCallback() {
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SETTINGS_UI,
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "true", true);
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
.thenReturn("true".getBytes());
public void onStop_isRegisterCallback_unregisterCallback() {
mController.mIsRegisterCallback = true;
mController.onStop();
@@ -234,9 +231,8 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
}
@Test
public void onStop_notAvailable_unregisterCallback() {
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
.thenReturn("false".getBytes());
public void onStop_notRegisterCallback_unregisterCallback() {
mController.mIsRegisterCallback = false;
mController.onStop();
@@ -245,11 +241,7 @@ public class AdvancedBluetoothDetailsHeaderControllerTest {
}
@Test
public void onDestroy_isAvailable_recycleBitmap() {
DeviceConfig.setProperty(DeviceConfig.NAMESPACE_SETTINGS_UI,
SettingsUIDeviceConfig.BT_ADVANCED_HEADER_ENABLED, "true", true);
when(mBluetoothDevice.getMetadata(BluetoothDevice.METADATA_IS_UNTETHERED_HEADSET))
.thenReturn("true".getBytes());
public void onDestroy_recycleBitmap() {
mController.mIconCache.put(ICON_URI, mBitmap);
mController.onDestroy();