Merge "Fix usage of the updated CDM APIs"
This commit is contained in:
committed by
Android (Google) Code Review
commit
13d7e086e6
@@ -29,6 +29,7 @@ import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.RemoteException;
|
||||
import android.os.ServiceManager;
|
||||
import android.os.UserHandle;
|
||||
import android.provider.DeviceConfig;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -126,8 +127,8 @@ public class BluetoothDetailsCompanionAppsController extends BluetoothDetailsCon
|
||||
try {
|
||||
java.util.Objects.requireNonNull(ICompanionDeviceManager.Stub.asInterface(
|
||||
ServiceManager.getService(
|
||||
Context.COMPANION_DEVICE_SERVICE))).disassociate(
|
||||
address, packageName);
|
||||
Context.COMPANION_DEVICE_SERVICE))).legacyDisassociate(
|
||||
address, packageName, UserHandle.myUserId());
|
||||
} catch (RemoteException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user