Loading framework/java/android/bluetooth/BluetoothAdapter.java +30 −0 Original line number Diff line number Diff line Loading @@ -1512,6 +1512,36 @@ public final class BluetoothAdapter { return null; } /** * Gets the currently supported profiles by the adapter. * *<p> This can be used to check whether a profile is supported before attempting * to connect to its respective proxy. * * @return a list of integers indicating the ids of supported profiles as defined in * {@link BluetoothProfile}. * @hide */ public List<Integer> getSupportedProfiles() { final ArrayList<Integer> supportedProfiles = new ArrayList<Integer>(); try { synchronized (mManagerCallback) { if (mService != null) { final long supportedProfilesBitMask = mService.getSupportedProfiles(); for (int i = 0; i <= BluetoothProfile.MAX_PROFILE_ID; i++) { if ((supportedProfilesBitMask & (1 << i)) != 0) { supportedProfiles.add(i); } } } } } catch (RemoteException e) {Log.e(TAG, "getSupportedProfiles:", e);} return supportedProfiles; } /** * Get the current connection state of the local Bluetooth adapter. * This can be used to check whether the local Bluetooth adapter is connected Loading framework/java/android/bluetooth/BluetoothProfile.java +7 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,13 @@ public interface BluetoothProfile { */ public static final int PBAP_CLIENT = 17; /** * Max profile ID. This value should be updated whenever a new profile is added to match * the largest value assigned to a profile. * @hide */ public static final int MAX_PROFILE_ID = 17; /** * Default priority for devices that we try to auto-connect to and * and allow incoming connections for the profile Loading framework/java/android/bluetooth/IBluetooth.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ interface IBluetooth boolean removeBond(in BluetoothDevice device); int getBondState(in BluetoothDevice device); boolean isBondingInitiatedLocally(in BluetoothDevice device); long getSupportedProfiles(); int getConnectionState(in BluetoothDevice device); String getRemoteName(in BluetoothDevice device); Loading Loading
framework/java/android/bluetooth/BluetoothAdapter.java +30 −0 Original line number Diff line number Diff line Loading @@ -1512,6 +1512,36 @@ public final class BluetoothAdapter { return null; } /** * Gets the currently supported profiles by the adapter. * *<p> This can be used to check whether a profile is supported before attempting * to connect to its respective proxy. * * @return a list of integers indicating the ids of supported profiles as defined in * {@link BluetoothProfile}. * @hide */ public List<Integer> getSupportedProfiles() { final ArrayList<Integer> supportedProfiles = new ArrayList<Integer>(); try { synchronized (mManagerCallback) { if (mService != null) { final long supportedProfilesBitMask = mService.getSupportedProfiles(); for (int i = 0; i <= BluetoothProfile.MAX_PROFILE_ID; i++) { if ((supportedProfilesBitMask & (1 << i)) != 0) { supportedProfiles.add(i); } } } } } catch (RemoteException e) {Log.e(TAG, "getSupportedProfiles:", e);} return supportedProfiles; } /** * Get the current connection state of the local Bluetooth adapter. * This can be used to check whether the local Bluetooth adapter is connected Loading
framework/java/android/bluetooth/BluetoothProfile.java +7 −0 Original line number Diff line number Diff line Loading @@ -136,6 +136,13 @@ public interface BluetoothProfile { */ public static final int PBAP_CLIENT = 17; /** * Max profile ID. This value should be updated whenever a new profile is added to match * the largest value assigned to a profile. * @hide */ public static final int MAX_PROFILE_ID = 17; /** * Default priority for devices that we try to auto-connect to and * and allow incoming connections for the profile Loading
framework/java/android/bluetooth/IBluetooth.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ interface IBluetooth boolean removeBond(in BluetoothDevice device); int getBondState(in BluetoothDevice device); boolean isBondingInitiatedLocally(in BluetoothDevice device); long getSupportedProfiles(); int getConnectionState(in BluetoothDevice device); String getRemoteName(in BluetoothDevice device); Loading