[CDM Perm Sync] Fix a NPE for Perm Sync toggle am: 8c51d9c71d am: cf705cf873

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24790419

Change-Id: I10fccd7b4036a57cdb665eb22a79b600fb006898
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Guojing Yuan
2023-09-18 23:17:16 +00:00
committed by Automerger Merge Worker

View File

@@ -64,6 +64,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(