Merge "Clear liveData when startForRequest" into tm-dev am: 265b2c56ac

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18244408

Change-Id: Ie4726b5810d34baadbb6911ca66475f365c6d294
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-05-12 05:09:15 +00:00
committed by Automerger Merge Worker

View File

@@ -123,6 +123,7 @@ public class CompanionDeviceDiscoveryService extends Service {
intent.setAction(ACTION_START_DISCOVERY);
intent.putExtra(EXTRA_ASSOCIATION_REQUEST, associationRequest);
sStateLiveData.setValue(DiscoveryState.STARTING);
sScanResultsLiveData.setValue(Collections.emptyList());
context.startService(intent);
}
@@ -173,7 +174,6 @@ public class CompanionDeviceDiscoveryService extends Service {
@Override
public void onDestroy() {
sScanResultsLiveData.setValue(Collections.emptyList());
super.onDestroy();
if (DEBUG) Log.d(TAG, "onDestroy()");
}
@@ -187,7 +187,6 @@ public class CompanionDeviceDiscoveryService extends Service {
mStopAfterFirstMatch = request.isSingleDevice();
mDiscoveryStarted = true;
sStateLiveData.setValue(DiscoveryState.DISCOVERY_IN_PROGRESS);
sScanResultsLiveData.setValue(Collections.emptyList());
final List<DeviceFilter<?>> allFilters = request.getDeviceFilters();
final List<BluetoothDeviceFilter> btFilters =