Fix usage of the updated CDM APIs

Bug: 194301022
Test: make
Change-Id: I70633f43d37fdeec8329e0c58f7cffa402dba689
This commit is contained in:
Sergey Nikolaienkov
2021-10-27 15:41:25 +02:00
parent 74a797efd8
commit 7fea5bd54f
4 changed files with 37 additions and 17 deletions

View File

@@ -54,6 +54,7 @@ import android.util.Log;
import androidx.annotation.VisibleForTesting;
import com.android.internal.util.CollectionUtils;
import com.android.settingslib.R;
import com.android.settingslib.Utils;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
@@ -159,7 +160,9 @@ public class NotificationBackend {
StringBuilder sb = new StringBuilder();
try {
List<String> associatedMacAddrs = cdm.getAssociations(pkg, userId);
List<String> associatedMacAddrs = CollectionUtils.mapNotNull(
cdm.getAssociations(pkg, userId),
a -> a.isSelfManaged() ? null : a.getDeviceMacAddress().toString());
if (associatedMacAddrs != null) {
for (String assocMac : associatedMacAddrs) {
final Collection<CachedBluetoothDevice> cachedDevices =