diff options
author | Md Shahriar Hossain Sajib <sajibonly@google.com> | 2022-01-19 15:37:26 +0800 |
---|---|---|
committer | Md Shahriar Hossain Sajib <sajibonly@google.com> | 2022-01-27 14:49:36 +0800 |
commit | fc6239e5b57f981a8ca296a1556d53a55f7faaad (patch) | |
tree | 92ce922fac31dc14d5ed3c04fa791c55a57797a3 /framework/java/android/bluetooth/BluetoothAdapter.java | |
parent | 83b20416a53548b338ab7625afa979e62277c186 (diff) |
[framework] Migration of hidden APIs to System APIs
Bug: 199827901
Tag: #compatibility
Test: IOP, BCST, GTS
Merged-In: Ib0a205bc575e4cc3cf97eac539cd303acd878134
Change-Id: Ib0a205bc575e4cc3cf97eac539cd303acd878134
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothAdapter.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index 385755a5e9..f420b94db7 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -2571,14 +2571,20 @@ public final class BluetoothAdapter { * BluetoothProfile}. * @hide */ - @RequiresNoPermission + @SystemApi + @RequiresBluetoothConnectPermission + @RequiresPermission(allOf = { + android.Manifest.permission.BLUETOOTH_CONNECT, + android.Manifest.permission.BLUETOOTH_PRIVILEGED, + }) public @NonNull List<Integer> getSupportedProfiles() { final ArrayList<Integer> supportedProfiles = new ArrayList<Integer>(); try { synchronized (mManagerCallback) { if (mService != null) { - final long supportedProfilesBitMask = mService.getSupportedProfiles(); + final long supportedProfilesBitMask = + mService.getSupportedProfiles(mAttributionSource); for (int i = 0; i <= BluetoothProfile.MAX_PROFILE_ID; i++) { if ((supportedProfilesBitMask & (1 << i)) != 0) { @@ -2594,6 +2600,7 @@ public final class BluetoothAdapter { } } catch (RemoteException e) { Log.e(TAG, "getSupportedProfiles:", e); + e.rethrowFromSystemServer(); } return supportedProfiles; } |