Loading android/app/aidl/android/bluetooth/IBluetooth.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ import android.os.ResultReceiver; */ interface IBluetooth { // TODO: b/357645528 - delete aidl method @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") int getState(); Loading android/app/src/com/android/bluetooth/Utils.java +7 −1 Original line number Diff line number Diff line Loading @@ -821,11 +821,17 @@ public final class Utils { UserHandle uh = um.getProfileParent(callingUser); int parentUser = (uh != null) ? uh.getIdentifier() : USER_HANDLE_NULL.getIdentifier(); // In HSUM mode, UserHandle.SYSTEM is only for System and the human users will use other // ids boolean isSystemUserInHsumMode = um.isHeadlessSystemUserMode() && callingUser.equals(UserHandle.SYSTEM); // Always allow SystemUI/System access. return (sForegroundUserId == callingUser.getIdentifier()) || (sForegroundUserId == parentUser) || (UserHandle.getAppId(sSystemUiUid) == UserHandle.getAppId(callingUid)) || (UserHandle.getAppId(Process.SYSTEM_UID) == UserHandle.getAppId(callingUid)); || (UserHandle.getAppId(Process.SYSTEM_UID) == UserHandle.getAppId(callingUid)) || (isSystemUserInHsumMode); } catch (Exception ex) { Log.e(TAG, "checkCallerAllowManagedProfiles: Exception ex=" + ex); return false; Loading android/app/src/com/android/bluetooth/btservice/AdapterService.java +4 −13 Original line number Diff line number Diff line Loading @@ -1153,10 +1153,8 @@ public class AdapterService extends Service { } private void invalidateBluetoothGetStateCache() { if (!Flags.broadcastAdapterStateWithCallback()) { BluetoothAdapter.invalidateBluetoothGetStateCache(); } } void updateLeAudioProfileServiceState() { Set<Integer> nonSupportedProfiles = new HashSet<>(); Loading Loading @@ -1186,9 +1184,7 @@ public class AdapterService extends Service { void updateAdapterState(int prevState, int newState) { mAdapterProperties.setState(newState); if (!Flags.broadcastAdapterStateWithCallback()) { invalidateBluetoothGetStateCache(); } // Only BluetoothManagerService should be registered int n = mRemoteCallbacks.beginBroadcast(); Loading Loading @@ -1486,9 +1482,7 @@ public class AdapterService extends Service { BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothDevice.invalidateBluetoothGetBondStateCache(); if (!Flags.broadcastAdapterStateWithCallback()) { BluetoothAdapter.invalidateBluetoothGetStateCache(); } BluetoothAdapter.invalidateGetAdapterConnectionStateCache(); BluetoothMap.invalidateBluetoothGetConnectionStateCache(); BluetoothSap.invalidateBluetoothGetConnectionStateCache(); Loading Loading @@ -2246,9 +2240,7 @@ public class AdapterService extends Service { AdapterServiceBinder(AdapterService svc) { mService = svc; if (!Flags.broadcastAdapterStateWithCallback()) { mService.invalidateBluetoothGetStateCache(); } BluetoothAdapter.getDefaultAdapter().disableBluetoothGetStateCache(); } Loading @@ -2259,7 +2251,6 @@ public class AdapterService extends Service { return mService; } // TODO: b/357645528 - delete getState method @Override public int getState() { AdapterService service = getService(); Loading android/app/src/com/android/bluetooth/btservice/CompanionManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -248,6 +248,10 @@ public class CompanionManager { new BluetoothAdapter.OnMetadataChangedListener() { @Override public void onMetadataChanged(BluetoothDevice device, int key, byte[] value) { if (value == null) { Log.d(TAG, "onMetadataChanged(device, " + key + ", null)"); return; } String valueStr = new String(value); Log.d(TAG, "Metadata updated in " + device + ": " + key + "=" + valueStr); if (key == BluetoothDevice.METADATA_SOFTWARE_VERSION Loading flags/system_service.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -29,16 +29,6 @@ flag { bug: "339554081" } flag { name: "broadcast_adapter_state_with_callback" namespace: "bluetooth" description: "Instead of caching the value with an IPC cache, we directly broadcast the state to each app so they can store it locally" metadata { purpose: PURPOSE_BUGFIX } bug: "357645528" } flag { name: "fast_bind_to_app" namespace: "bluetooth" Loading Loading
android/app/aidl/android/bluetooth/IBluetooth.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,6 @@ import android.os.ResultReceiver; */ interface IBluetooth { // TODO: b/357645528 - delete aidl method @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission") int getState(); Loading
android/app/src/com/android/bluetooth/Utils.java +7 −1 Original line number Diff line number Diff line Loading @@ -821,11 +821,17 @@ public final class Utils { UserHandle uh = um.getProfileParent(callingUser); int parentUser = (uh != null) ? uh.getIdentifier() : USER_HANDLE_NULL.getIdentifier(); // In HSUM mode, UserHandle.SYSTEM is only for System and the human users will use other // ids boolean isSystemUserInHsumMode = um.isHeadlessSystemUserMode() && callingUser.equals(UserHandle.SYSTEM); // Always allow SystemUI/System access. return (sForegroundUserId == callingUser.getIdentifier()) || (sForegroundUserId == parentUser) || (UserHandle.getAppId(sSystemUiUid) == UserHandle.getAppId(callingUid)) || (UserHandle.getAppId(Process.SYSTEM_UID) == UserHandle.getAppId(callingUid)); || (UserHandle.getAppId(Process.SYSTEM_UID) == UserHandle.getAppId(callingUid)) || (isSystemUserInHsumMode); } catch (Exception ex) { Log.e(TAG, "checkCallerAllowManagedProfiles: Exception ex=" + ex); return false; Loading
android/app/src/com/android/bluetooth/btservice/AdapterService.java +4 −13 Original line number Diff line number Diff line Loading @@ -1153,10 +1153,8 @@ public class AdapterService extends Service { } private void invalidateBluetoothGetStateCache() { if (!Flags.broadcastAdapterStateWithCallback()) { BluetoothAdapter.invalidateBluetoothGetStateCache(); } } void updateLeAudioProfileServiceState() { Set<Integer> nonSupportedProfiles = new HashSet<>(); Loading Loading @@ -1186,9 +1184,7 @@ public class AdapterService extends Service { void updateAdapterState(int prevState, int newState) { mAdapterProperties.setState(newState); if (!Flags.broadcastAdapterStateWithCallback()) { invalidateBluetoothGetStateCache(); } // Only BluetoothManagerService should be registered int n = mRemoteCallbacks.beginBroadcast(); Loading Loading @@ -1486,9 +1482,7 @@ public class AdapterService extends Service { BluetoothAdapter.invalidateGetProfileConnectionStateCache(); BluetoothAdapter.invalidateIsOffloadedFilteringSupportedCache(); BluetoothDevice.invalidateBluetoothGetBondStateCache(); if (!Flags.broadcastAdapterStateWithCallback()) { BluetoothAdapter.invalidateBluetoothGetStateCache(); } BluetoothAdapter.invalidateGetAdapterConnectionStateCache(); BluetoothMap.invalidateBluetoothGetConnectionStateCache(); BluetoothSap.invalidateBluetoothGetConnectionStateCache(); Loading Loading @@ -2246,9 +2240,7 @@ public class AdapterService extends Service { AdapterServiceBinder(AdapterService svc) { mService = svc; if (!Flags.broadcastAdapterStateWithCallback()) { mService.invalidateBluetoothGetStateCache(); } BluetoothAdapter.getDefaultAdapter().disableBluetoothGetStateCache(); } Loading @@ -2259,7 +2251,6 @@ public class AdapterService extends Service { return mService; } // TODO: b/357645528 - delete getState method @Override public int getState() { AdapterService service = getService(); Loading
android/app/src/com/android/bluetooth/btservice/CompanionManager.java +4 −0 Original line number Diff line number Diff line Loading @@ -248,6 +248,10 @@ public class CompanionManager { new BluetoothAdapter.OnMetadataChangedListener() { @Override public void onMetadataChanged(BluetoothDevice device, int key, byte[] value) { if (value == null) { Log.d(TAG, "onMetadataChanged(device, " + key + ", null)"); return; } String valueStr = new String(value); Log.d(TAG, "Metadata updated in " + device + ": " + key + "=" + valueStr); if (key == BluetoothDevice.METADATA_SOFTWARE_VERSION Loading
flags/system_service.aconfig +0 −10 Original line number Diff line number Diff line Loading @@ -29,16 +29,6 @@ flag { bug: "339554081" } flag { name: "broadcast_adapter_state_with_callback" namespace: "bluetooth" description: "Instead of caching the value with an IPC cache, we directly broadcast the state to each app so they can store it locally" metadata { purpose: PURPOSE_BUGFIX } bug: "357645528" } flag { name: "fast_bind_to_app" namespace: "bluetooth" Loading