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

Commit 03b2b7ec authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge changes from topic "apr16" into sc-dev

* changes:
  More Bluetooth API annotation updates.
  Refine BluetoothLeAdvertiser permissions.
parents de95c9cc b2051326
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.os.ResultReceiver;
 */
interface IBluetooth
{
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    int getState();

    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
@@ -54,6 +55,8 @@ interface IBluetooth
    boolean setName(in String name);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    String getName();
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_ADVERTISE)")
    int getNameLengthForAdvertise();
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    BluetoothClass getBluetoothClass();
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
@@ -87,7 +90,9 @@ interface IBluetooth
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
    long getDiscoveryEndMillis();

    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    int getAdapterConnectionState();
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    int getProfileConnectionState(int profile);

    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
@@ -103,6 +108,7 @@ interface IBluetooth
    int getBondState(in BluetoothDevice device);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    boolean isBondingInitiatedLocally(in BluetoothDevice device);
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    long getSupportedProfiles();
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    int getConnectionState(in BluetoothDevice device);
@@ -161,19 +167,29 @@ interface IBluetooth
    void unregisterCallback(in IBluetoothCallback callback);

    // For Socket
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    IBluetoothSocketManager getSocketManager();

    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
    boolean factoryReset();

    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isMultiAdvertisementSupported();
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isOffloadedFilteringSupported();
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isOffloadedScanBatchingSupported();
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isActivityAndEnergyReportingSupported();
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isLe2MPhySupported();
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isLeCodedPhySupported();
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isLeExtendedAdvertisingSupported();
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isLePeriodicAdvertisingSupported();
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    int getLeMaximumAdvertisingDataLength();

    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ interface IBluetoothA2dp {
    boolean setConnectionPolicy(in BluetoothDevice device, int connectionPolicy);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
    int getConnectionPolicy(in BluetoothDevice device);
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isAvrcpAbsoluteVolumeSupported();
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    oneway void setAvrcpAbsoluteVolume(int volume);
+6 −0
Original line number Diff line number Diff line
@@ -42,8 +42,10 @@ interface IBluetoothManager
    boolean enableNoAutoConnect(String packageName);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    boolean disable(String packageName, boolean persist);
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    int getState();
    @UnsupportedAppUsage
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    IBluetoothGatt getBluetoothGatt();

    boolean bindBluetoothProfileService(int profile, IBluetoothProfileServiceConnection proxy);
@@ -57,13 +59,17 @@ interface IBluetoothManager
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)")
    boolean onFactoryReset();

    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isBleScanAlwaysAvailable();
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    boolean enableBle(String packageName, IBinder b);
    @JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
    boolean disableBle(String packageName, IBinder b);
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isBleAppPresent();
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    boolean isHearingAidProfileSupported();

    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    List<String> getSystemConfigEnabledProfilesForPackage(String packageName);
}
+1 −0
Original line number Diff line number Diff line
@@ -24,5 +24,6 @@ import android.bluetooth.BluetoothDevice;
 * @hide
 */
oneway interface IBluetoothMetadataListener {
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    void onMetadataChanged(in BluetoothDevice devices, in int key, in byte[] value);
}
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ import android.os.IBinder;
 * {@hide}
 */
oneway interface IBluetoothProfileServiceConnection {
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    void onServiceConnected(in ComponentName comp, in IBinder service);
    @JavaPassthrough(annotation="@android.annotation.RequiresNoPermission")
    void onServiceDisconnected(in ComponentName comp);
}