From 8c51d9c71da0212f7f14d9fd958e20a17061db28 Mon Sep 17 00:00:00 2001 From: Guojing Yuan Date: Mon, 18 Sep 2023 18:44:10 +0000 Subject: [PATCH] [CDM Perm Sync] Fix a NPE for Perm Sync toggle Bug: 290063372 Test: manual test on the breaking build. Change-Id: I1f0a5c3840a4c97962fa9986d8f67ab0f652015f --- .../settings/bluetooth/BluetoothDetailsDataSyncController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/com/android/settings/bluetooth/BluetoothDetailsDataSyncController.java b/src/com/android/settings/bluetooth/BluetoothDetailsDataSyncController.java index e74a0b4e6e2..0d74f3ce5ec 100644 --- a/src/com/android/settings/bluetooth/BluetoothDetailsDataSyncController.java +++ b/src/com/android/settings/bluetooth/BluetoothDetailsDataSyncController.java @@ -65,6 +65,7 @@ public class BluetoothDetailsDataSyncController extends BluetoothDetailsControll mCompanionDeviceManager = context.getSystemService(CompanionDeviceManager.class); mCompanionDeviceManager.getAllAssociations().stream().filter( + a -> a.getDeviceMacAddress() != null).filter( a -> Objects.equal(mCachedDevice.getAddress(), a.getDeviceMacAddress().toString().toUpperCase())).max( Comparator.comparingLong(AssociationInfo::getTimeApprovedMs)).ifPresent(