From db6f3e7a902e011af4fbb4434d353dc59b8e2c19 Mon Sep 17 00:00:00 2001 From: Lee Shombert Date: Fri, 4 Mar 2022 07:37:36 -0800 Subject: Convert the Bluetooth module to os/IpcDataCache Bug: 214455273 Tag: #refactor Convert all references to PropertyInvalidatedCache into references to os/IpcDataCache. IpcDataCache has the necessary system APIs for mainline modules. Any system APIs in PropertyInvalidatedCache will be deleted. Manual testing was done by pairing a phone with a headset and verifying that the caches were in use via 'dumpsys cacheinfo'. Test: presubmit Change-Id: Ia9ebc89ba6fc8d1c3757dcb141b37a59a0b3f713 --- framework/java/android/bluetooth/BluetoothDevice.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'framework/java/android/bluetooth/BluetoothDevice.java') diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java index 8c591e897d..71e15f0063 100644 --- a/framework/java/android/bluetooth/BluetoothDevice.java +++ b/framework/java/android/bluetooth/BluetoothDevice.java @@ -26,7 +26,6 @@ import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SuppressLint; import android.annotation.SystemApi; -import android.app.PropertyInvalidatedCache; import android.bluetooth.annotations.RequiresBluetoothConnectPermission; import android.bluetooth.annotations.RequiresBluetoothLocationPermission; import android.bluetooth.annotations.RequiresBluetoothScanPermission; @@ -38,6 +37,7 @@ import android.content.AttributionSource; import android.content.Context; import android.os.Build; import android.os.Handler; +import android.os.IpcDataCache; import android.os.Parcel; import android.os.ParcelUuid; import android.os.Parcelable; @@ -1823,13 +1823,13 @@ public final class BluetoothDevice implements Parcelable, Attributable { } /** - * There are several instances of PropertyInvalidatedCache used in this class. + * There are several instances of IpcDataCache used in this class. * BluetoothCache wraps up the common code. All caches are created with a maximum of * eight entries, and the key is in the bluetooth module. The name is set to the api. */ - private static class BluetoothCache extends PropertyInvalidatedCache { - BluetoothCache(String api, PropertyInvalidatedCache.QueryHandler query) { - super(8, PropertyInvalidatedCache.MODULE_BLUETOOTH, api, api, query); + private static class BluetoothCache extends IpcDataCache { + BluetoothCache(String api, IpcDataCache.QueryHandler query) { + super(8, IpcDataCache.MODULE_BLUETOOTH, api, api, query); }}; /** @@ -1837,12 +1837,12 @@ public final class BluetoothDevice implements Parcelable, Attributable { * enforces the bluetooth module. */ private static void invalidateCache(@NonNull String api) { - PropertyInvalidatedCache.invalidateCache(PropertyInvalidatedCache.MODULE_BLUETOOTH, api); + IpcDataCache.invalidateCache(IpcDataCache.MODULE_BLUETOOTH, api); } private final - PropertyInvalidatedCache.QueryHandler mBluetoothBondQuery = - new PropertyInvalidatedCache.QueryHandler<>() { + IpcDataCache.QueryHandler mBluetoothBondQuery = + new IpcDataCache.QueryHandler<>() { @RequiresLegacyBluetoothPermission @RequiresBluetoothConnectPermission @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) -- cgit v1.2.3