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

Commit 83b20416 authored by Md Shahriar Hossain Sajib's avatar Md Shahriar Hossain Sajib
Browse files

[service] Migration of APIs permission changes

Bug: 199827901
Tag: #compatibility
Test: IOP, BCST, GTS
Merged-In: Id727a4b5fc316a3c0a8456cfe7b249170bc94322
Change-Id: Id727a4b5fc316a3c0a8456cfe7b249170bc94322
parent c18507ad
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1750,11 +1750,14 @@ public class AdapterService extends Service {
        }

        @Override
        public long getSupportedProfiles() {
        public long getSupportedProfiles(AttributionSource source) {
            AdapterService service = getService();
            if (service == null) {
            if (service == null
                    || !Utils.checkConnectPermissionForDataDelivery(service, source, TAG)) {
                return 0;
            }
            enforceBluetoothPrivilegedPermission(service);

            return Config.getSupportedProfilesBitMask();
        }

+2 −0
Original line number Diff line number Diff line
@@ -740,6 +740,7 @@ public class HeadsetService extends ProfileService {
            try {
                HeadsetService service = getService(source);
                if (service != null) {
                    enforceBluetoothPrivilegedPermission(service);
                    service.setAudioRouteAllowed(allowed);
                }
                receiver.send(null);
@@ -755,6 +756,7 @@ public class HeadsetService extends ProfileService {
                HeadsetService service = getService(source);
                boolean defaultValue = false;
                if (service != null) {
                    enforceBluetoothPrivilegedPermission(service);
                    defaultValue = service.getAudioRouteAllowed();
                }
                receiver.send(defaultValue);
+1 −1
Original line number Diff line number Diff line
@@ -110,7 +110,7 @@ interface IBluetooth
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    boolean isBondingInitiatedLocally(in BluetoothDevice device, in AttributionSource attributionSource);
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    long getSupportedProfiles();
    long getSupportedProfiles(in AttributionSource attributionSource);
    @UnsupportedAppUsage
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    int getConnectionState(in BluetoothDevice device);