Register PackageMonitor for CompanionDeviceManagerService
1. On package removed -> remove all its associations
2. On package updated -> if had associations, update special access permission
in accordance with (potentially changed) permission entries in manifest
Bug: 30932767
Test: 1. Remove app, and ensure xml entries for it got removed.
2. adb install new version of app without special permissions in manifest, and
ensure whitelist removal method got called
Change-Id: I87261c05ddcf40a18332d160b44ee2f8284df5e4
diff --git a/core/java/android/companion/BluetoothDeviceFilter.java b/core/java/android/companion/BluetoothDeviceFilter.java
index 0f16b7b..1d8df7f 100644
--- a/core/java/android/companion/BluetoothDeviceFilter.java
+++ b/core/java/android/companion/BluetoothDeviceFilter.java
@@ -31,6 +31,7 @@
import android.provider.OneTimeUseBuilder;
import com.android.internal.util.ArrayUtils;
+import com.android.internal.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
@@ -53,8 +54,8 @@
List<ParcelUuid> serviceUuidMasks) {
mNamePattern = namePattern;
mAddress = address;
- mServiceUuids = ArrayUtils.emptyIfNull(serviceUuids);
- mServiceUuidMasks = ArrayUtils.emptyIfNull(serviceUuidMasks);
+ mServiceUuids = CollectionUtils.emptyIfNull(serviceUuids);
+ mServiceUuidMasks = CollectionUtils.emptyIfNull(serviceUuidMasks);
}
private BluetoothDeviceFilter(Parcel in) {