From 0a319ece224ec8c540cee374b1fb8e6c35f4507b Mon Sep 17 00:00:00 2001 From: Sergey Nikolaienkov Date: Mon, 25 Oct 2021 13:12:34 +0200 Subject: [PATCH] Fix usages of renamed Association class Fix use of the Assocition class, which has been renamed AssociationInfo. Bug: 194301022 Test: make SettingsRoboTests Change-Id: I00e3c76c219c36bc8da0dadfb8727d1c217bba18 --- .../bluetooth/BluetoothDetailsCompanionAppsController.java | 6 +++--- .../BluetoothDetailsCompanionAppsControllerTest.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsController.java b/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsController.java index 665737199b3..73360f13a88 100644 --- a/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsController.java +++ b/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsController.java @@ -18,7 +18,7 @@ package com.android.settings.bluetooth; import static com.android.internal.util.CollectionUtils.filter; -import android.companion.Association; +import android.companion.AssociationInfo; import android.companion.CompanionDeviceManager; import android.companion.ICompanionDeviceManager; import android.content.Context; @@ -88,7 +88,7 @@ public class BluetoothDetailsCompanionAppsController extends BluetoothDetailsCon mProfilesContainer.setLayoutResource(R.layout.preference_companion_app); } - private List getAssociations(String address) { + private List getAssociations(String address) { return filter( mCompanionDeviceManager.getAllAssociations(), a -> Objects.equal(address, a.getDeviceMacAddress())); @@ -150,7 +150,7 @@ public class BluetoothDetailsCompanionAppsController extends BluetoothDetailsCon private List getPreferencesNeedToShow(String address, PreferenceCategory container) { List preferencesToRemove = new ArrayList<>(); Set packages = getAssociations(address) - .stream().map(Association::getPackageName) + .stream().map(AssociationInfo::getPackageName) .collect(Collectors.toSet()); for (int i = 0; i < container.getPreferenceCount(); i++) { diff --git a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsControllerTest.java b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsControllerTest.java index 0dc0208a78b..1d5aa549ac5 100644 --- a/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsControllerTest.java +++ b/tests/robotests/src/com/android/settings/bluetooth/BluetoothDetailsCompanionAppsControllerTest.java @@ -22,7 +22,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; -import android.companion.Association; +import android.companion.AssociationInfo; import android.companion.CompanionDeviceManager; import android.companion.DeviceId; import android.content.pm.ApplicationInfo; @@ -63,7 +63,7 @@ public class BluetoothDetailsCompanionAppsControllerTest extends private PreferenceCategory mProfiles; private List mPackages; private List mAppNames; - private List mAssociations; + private List mAssociations; @Override @@ -102,7 +102,7 @@ public class BluetoothDetailsCompanionAppsControllerTest extends final int associationId = mAssociations.size() + 1; final DeviceId deviceId = new DeviceId(DeviceId.TYPE_MAC_ADDRESS, mCachedDevice.getAddress()); - final Association association = new Association( + final AssociationInfo association = new AssociationInfo( associationId, /* userId */ 0, packageName,