Loading framework/java/android/bluetooth/BluetoothAdapter.java +6 −1 Original line number Diff line number Diff line Loading @@ -1514,7 +1514,12 @@ public final class BluetoothAdapter { new BluetoothCache<>(GET_STATE_API, sBluetoothGetStateQuery); private static final IpcDataCache<IBluetoothManager, Integer> sBluetoothGetSystemStateCache = new BluetoothCache<>(GET_SYSTEM_STATE_API, sBluetoothGetSystemStateQuery); new IpcDataCache<>( 8, IBluetoothManager.IPC_CACHE_MODULE_SYSTEM, GET_SYSTEM_STATE_API, GET_SYSTEM_STATE_API, sBluetoothGetSystemStateQuery); /** @hide */ @RequiresNoPermission Loading service/aidl/android/bluetooth/IBluetoothManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ interface IBluetoothManager @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true)") boolean disable(in AttributionSource attributionSource, boolean persist); const String IPC_CACHE_MODULE_SYSTEM = "system_server"; // See IpcDataCache.MODULE_SYSTEM const String GET_SYSTEM_STATE_API = "BluetoothAdapter_getSystemState"; @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") Loading service/src/AdapterState.kt +2 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.bluetooth import android.bluetooth.BluetoothAdapter import android.bluetooth.BluetoothAdapter.STATE_OFF import android.bluetooth.IBluetoothManager.GET_SYSTEM_STATE_API import android.bluetooth.IBluetoothManager.IPC_CACHE_MODULE_SYSTEM import android.os.IpcDataCache import com.android.bluetooth.flags.Flags import kotlin.time.Duration Loading @@ -40,7 +41,7 @@ class BluetoothAdapterState { fun set(s: Int) = runBlocking { _uiState.emit(s) if (Flags.getStateFromSystemServer()) { IpcDataCache.invalidateCache(IpcDataCache.MODULE_BLUETOOTH, GET_SYSTEM_STATE_API) IpcDataCache.invalidateCache(IPC_CACHE_MODULE_SYSTEM, GET_SYSTEM_STATE_API) } } Loading Loading
framework/java/android/bluetooth/BluetoothAdapter.java +6 −1 Original line number Diff line number Diff line Loading @@ -1514,7 +1514,12 @@ public final class BluetoothAdapter { new BluetoothCache<>(GET_STATE_API, sBluetoothGetStateQuery); private static final IpcDataCache<IBluetoothManager, Integer> sBluetoothGetSystemStateCache = new BluetoothCache<>(GET_SYSTEM_STATE_API, sBluetoothGetSystemStateQuery); new IpcDataCache<>( 8, IBluetoothManager.IPC_CACHE_MODULE_SYSTEM, GET_SYSTEM_STATE_API, GET_SYSTEM_STATE_API, sBluetoothGetSystemStateQuery); /** @hide */ @RequiresNoPermission Loading
service/aidl/android/bluetooth/IBluetoothManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ interface IBluetoothManager @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.BLUETOOTH_PRIVILEGED}, conditional=true)") boolean disable(in AttributionSource attributionSource, boolean persist); const String IPC_CACHE_MODULE_SYSTEM = "system_server"; // See IpcDataCache.MODULE_SYSTEM const String GET_SYSTEM_STATE_API = "BluetoothAdapter_getSystemState"; @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") Loading
service/src/AdapterState.kt +2 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package com.android.server.bluetooth import android.bluetooth.BluetoothAdapter import android.bluetooth.BluetoothAdapter.STATE_OFF import android.bluetooth.IBluetoothManager.GET_SYSTEM_STATE_API import android.bluetooth.IBluetoothManager.IPC_CACHE_MODULE_SYSTEM import android.os.IpcDataCache import com.android.bluetooth.flags.Flags import kotlin.time.Duration Loading @@ -40,7 +41,7 @@ class BluetoothAdapterState { fun set(s: Int) = runBlocking { _uiState.emit(s) if (Flags.getStateFromSystemServer()) { IpcDataCache.invalidateCache(IpcDataCache.MODULE_BLUETOOTH, GET_SYSTEM_STATE_API) IpcDataCache.invalidateCache(IPC_CACHE_MODULE_SYSTEM, GET_SYSTEM_STATE_API) } } Loading