Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de3b1db4 authored by Oli Lan's avatar Oli Lan Committed by Jeff Sharkey
Browse files

Add AttributionSource to BT methods.

This adds attribution source as a parameter to bluetooth methods,
matching aidl changes also made in this topic.

This is now required to allow the app ops for the new
bluetooth permissions (BLUETOOTH_CONNECT, BLUETOOTH_ADVERTISE,
and BLUETOOTH_SCAN) to be noted.

Bug: 183626112
Test: atest BluetoothInstrumentationTests
Change-Id: I7b3e8871f9750337fd1b100a90d378e0c40bf2f1
parent daee2b30
Loading
Loading
Loading
Loading
+330 −223

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -400,7 +400,7 @@ public class ScanManager {
                if (DBG) {
                    Log.d(TAG, "app died, unregister scanner - " + client.scannerId);
                }
                mService.unregisterScanner(client.scannerId);
                mService.unregisterScanner(client.scannerId, mService.getAttributionSource());
            }
        }

+2 −2
Original line number Diff line number Diff line
@@ -55,9 +55,9 @@ public class ProfileServiceTest {

    private void setProfileState(Class profile, int state) throws TimeoutException {
        if (state == BluetoothAdapter.STATE_ON) {
            when(mMockAdapterService.isStartedProfile(anyString())).thenReturn(true);
            doReturn(true).when(mMockAdapterService).isStartedProfile(eq(profile.getSimpleName()));
        } else if (state == BluetoothAdapter.STATE_OFF) {
            when(mMockAdapterService.isStartedProfile(anyString())).thenReturn(false);
            doReturn(false).when(mMockAdapterService).isStartedProfile(eq(profile.getSimpleName()));
        }
        Intent startIntent = new Intent(InstrumentationRegistry.getTargetContext(), profile);
        startIntent.putExtra(AdapterService.EXTRA_ACTION,