Loading android/app/src/com/android/bluetooth/BluetoothMethodProxy.java +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.bluetooth; import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.annotation.SuppressLint; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; Loading Loading @@ -186,7 +185,8 @@ public class BluetoothMethodProxy { } /** Proxies {@link Context#sendBroadcast(Intent)}. */ public void contextSendBroadcast(Context context, @RequiresPermission Intent intent) { @SuppressLint("AndroidFrameworkRequiresPermission") // only intent is ACTION_OPEN public void contextSendBroadcast(Context context, Intent intent) { context.sendBroadcast(intent); } Loading android/app/src/com/android/bluetooth/bass_client/BassClientStateMachine.java +5 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.bluetooth.bass_client; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import android.annotation.Nullable; import android.annotation.SuppressLint; Loading Loading @@ -2354,8 +2355,10 @@ public class BassClientStateMachine extends StateMachine { intent.addFlags( Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); mService.sendBroadcast( intent, BLUETOOTH_CONNECT, Utils.getTempBroadcastOptions().toBundle()); mService.sendBroadcastMultiplePermissions( intent, new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}, Utils.getTempBroadcastOptions()); } int getConnectionState() { Loading android/app/src/com/android/bluetooth/hap/HapClientService.java +6 −7 Original line number Diff line number Diff line Loading @@ -1071,7 +1071,6 @@ public class HapClientService extends ProfileService { return; } Intent intent = null; BluetoothDevice device = stackEvent.device; switch (stackEvent.type) { Loading @@ -1082,9 +1081,12 @@ public class HapClientService extends ProfileService { if (device != null) { mDeviceFeaturesMap.put(device, features); intent = new Intent(BluetoothHapClient.ACTION_HAP_DEVICE_AVAILABLE); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); intent.putExtra(BluetoothHapClient.EXTRA_HAP_FEATURES, features); Intent intent = new Intent(BluetoothHapClient.ACTION_HAP_DEVICE_AVAILABLE) .putExtra(BluetoothDevice.EXTRA_DEVICE, device) .putExtra(BluetoothHapClient.EXTRA_HAP_FEATURES, features); sendBroadcastWithMultiplePermissions( intent, new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}); } } break; Loading Loading @@ -1180,9 +1182,6 @@ public class HapClientService extends ProfileService { return; } if (intent != null) { sendBroadcast(intent, BLUETOOTH_PRIVILEGED); } } private void resendToStateMachine(HapClientStackEvent stackEvent) { Loading android/app/src/com/android/bluetooth/hap/HapClientStateMachine.java +11 −8 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ package com.android.bluetooth.hap; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHapClient; Loading Loading @@ -171,14 +172,16 @@ final class HapClientStateMachine extends StateMachine { + profileStateToString(newState)); mService.connectionStateChanged(mDevice, prevState, newState); Intent intent = new Intent(BluetoothHapClient.ACTION_HAP_CONNECTION_STATE_CHANGED); intent.putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState); intent.putExtra(BluetoothProfile.EXTRA_STATE, newState); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice); intent.addFlags( Intent intent = new Intent(BluetoothHapClient.ACTION_HAP_CONNECTION_STATE_CHANGED) .putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState) .putExtra(BluetoothProfile.EXTRA_STATE, newState) .putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice) .addFlags( Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); mService.sendBroadcast(intent, BLUETOOTH_CONNECT); mService.sendBroadcastWithMultiplePermissions( intent, new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}); } public void dump(StringBuilder sb) { Loading android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +2 −1 Original line number Diff line number Diff line Loading @@ -1701,7 +1701,8 @@ public class LeAudioService extends ProfileService { intent.addFlags( Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); sendBroadcast(intent, BLUETOOTH_CONNECT); sendBroadcastWithMultiplePermissions( intent, new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}); } void notifyVolumeControlServiceAboutActiveGroup(BluetoothDevice device) { Loading Loading
android/app/src/com/android/bluetooth/BluetoothMethodProxy.java +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package com.android.bluetooth; import android.annotation.NonNull; import android.annotation.RequiresPermission; import android.annotation.SuppressLint; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; Loading Loading @@ -186,7 +185,8 @@ public class BluetoothMethodProxy { } /** Proxies {@link Context#sendBroadcast(Intent)}. */ public void contextSendBroadcast(Context context, @RequiresPermission Intent intent) { @SuppressLint("AndroidFrameworkRequiresPermission") // only intent is ACTION_OPEN public void contextSendBroadcast(Context context, Intent intent) { context.sendBroadcast(intent); } Loading
android/app/src/com/android/bluetooth/bass_client/BassClientStateMachine.java +5 −2 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.bluetooth.bass_client; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import android.annotation.Nullable; import android.annotation.SuppressLint; Loading Loading @@ -2354,8 +2355,10 @@ public class BassClientStateMachine extends StateMachine { intent.addFlags( Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); mService.sendBroadcast( intent, BLUETOOTH_CONNECT, Utils.getTempBroadcastOptions().toBundle()); mService.sendBroadcastMultiplePermissions( intent, new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}, Utils.getTempBroadcastOptions()); } int getConnectionState() { Loading
android/app/src/com/android/bluetooth/hap/HapClientService.java +6 −7 Original line number Diff line number Diff line Loading @@ -1071,7 +1071,6 @@ public class HapClientService extends ProfileService { return; } Intent intent = null; BluetoothDevice device = stackEvent.device; switch (stackEvent.type) { Loading @@ -1082,9 +1081,12 @@ public class HapClientService extends ProfileService { if (device != null) { mDeviceFeaturesMap.put(device, features); intent = new Intent(BluetoothHapClient.ACTION_HAP_DEVICE_AVAILABLE); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, device); intent.putExtra(BluetoothHapClient.EXTRA_HAP_FEATURES, features); Intent intent = new Intent(BluetoothHapClient.ACTION_HAP_DEVICE_AVAILABLE) .putExtra(BluetoothDevice.EXTRA_DEVICE, device) .putExtra(BluetoothHapClient.EXTRA_HAP_FEATURES, features); sendBroadcastWithMultiplePermissions( intent, new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}); } } break; Loading Loading @@ -1180,9 +1182,6 @@ public class HapClientService extends ProfileService { return; } if (intent != null) { sendBroadcast(intent, BLUETOOTH_PRIVILEGED); } } private void resendToStateMachine(HapClientStackEvent stackEvent) { Loading
android/app/src/com/android/bluetooth/hap/HapClientStateMachine.java +11 −8 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ package com.android.bluetooth.hap; import static android.Manifest.permission.BLUETOOTH_CONNECT; import static android.Manifest.permission.BLUETOOTH_PRIVILEGED; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothHapClient; Loading Loading @@ -171,14 +172,16 @@ final class HapClientStateMachine extends StateMachine { + profileStateToString(newState)); mService.connectionStateChanged(mDevice, prevState, newState); Intent intent = new Intent(BluetoothHapClient.ACTION_HAP_CONNECTION_STATE_CHANGED); intent.putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState); intent.putExtra(BluetoothProfile.EXTRA_STATE, newState); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice); intent.addFlags( Intent intent = new Intent(BluetoothHapClient.ACTION_HAP_CONNECTION_STATE_CHANGED) .putExtra(BluetoothProfile.EXTRA_PREVIOUS_STATE, prevState) .putExtra(BluetoothProfile.EXTRA_STATE, newState) .putExtra(BluetoothDevice.EXTRA_DEVICE, mDevice) .addFlags( Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); mService.sendBroadcast(intent, BLUETOOTH_CONNECT); mService.sendBroadcastWithMultiplePermissions( intent, new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}); } public void dump(StringBuilder sb) { Loading
android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +2 −1 Original line number Diff line number Diff line Loading @@ -1701,7 +1701,8 @@ public class LeAudioService extends ProfileService { intent.addFlags( Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); sendBroadcast(intent, BLUETOOTH_CONNECT); sendBroadcastWithMultiplePermissions( intent, new String[] {BLUETOOTH_CONNECT, BLUETOOTH_PRIVILEGED}); } void notifyVolumeControlServiceAboutActiveGroup(BluetoothDevice device) { Loading