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

Commit 191ce9c4 authored by Ivan Podogov's avatar Ivan Podogov Committed by Hansong Zhang
Browse files

HIDD: Address API Review concerns

 * Replace bare field usage with getter methods;
 * Remove Builder;
 * Move BluetoothHidDeviceCallback to inner class;
 * Remove toArray() and equals();
 * Throw IllegalArgumentException where applicable;
 * Add an Executor parameter before Callback;

Bug: 72168436, 72168126
Test: make update-api, make, make sl4a.Common
Change-Id: I13095458bf3ded7a376e8d20fd13df12ef426693
(cherry picked from commit f2f5dc35)
parent 20b7c174
Loading
Loading
Loading
Loading
+23 −35
Original line number Diff line number Diff line
@@ -8333,7 +8333,7 @@ package android.bluetooth {
    method public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method public int getConnectionState(android.bluetooth.BluetoothDevice);
    method public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method public boolean registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings, android.bluetooth.BluetoothHidDeviceAppQosSettings, android.bluetooth.BluetoothHidDeviceAppQosSettings, android.bluetooth.BluetoothHidDeviceCallback);
    method public boolean registerApp(android.bluetooth.BluetoothHidDeviceAppSdpSettings, android.bluetooth.BluetoothHidDeviceAppQosSettings, android.bluetooth.BluetoothHidDeviceAppQosSettings, java.util.concurrent.Executor, android.bluetooth.BluetoothHidDevice.Callback);
    method public boolean replyReport(android.bluetooth.BluetoothDevice, byte, byte, byte[]);
    method public boolean reportError(android.bluetooth.BluetoothDevice, byte);
    method public boolean sendReport(android.bluetooth.BluetoothDevice, int, byte[]);
@@ -8363,56 +8363,44 @@ package android.bluetooth {
    field public static final byte SUBCLASS2_UNCATEGORIZED = 0; // 0x0
  }
  public static abstract class BluetoothHidDevice.Callback {
    ctor public BluetoothHidDevice.Callback();
    method public void onAppStatusChanged(android.bluetooth.BluetoothDevice, boolean);
    method public void onConnectionStateChanged(android.bluetooth.BluetoothDevice, int);
    method public void onGetReport(android.bluetooth.BluetoothDevice, byte, byte, int);
    method public void onInterruptData(android.bluetooth.BluetoothDevice, byte, byte[]);
    method public void onSetProtocol(android.bluetooth.BluetoothDevice, byte);
    method public void onSetReport(android.bluetooth.BluetoothDevice, byte, byte, byte[]);
    method public void onVirtualCableUnplug(android.bluetooth.BluetoothDevice);
  }
  public final class BluetoothHidDeviceAppQosSettings implements android.os.Parcelable {
    ctor public BluetoothHidDeviceAppQosSettings(int, int, int, int, int, int);
    method public int describeContents();
    method public int[] toArray();
    method public int getDelayVariation();
    method public int getLatency();
    method public int getPeakBandwidth();
    method public int getServiceType();
    method public int getTokenBucketSize();
    method public int getTokenRate();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHidDeviceAppQosSettings> CREATOR;
    field public static final int MAX = -1; // 0xffffffff
    field public static final int SERVICE_BEST_EFFORT = 1; // 0x1
    field public static final int SERVICE_GUARANTEED = 2; // 0x2
    field public static final int SERVICE_NO_TRAFFIC = 0; // 0x0
    field public final int delayVariation;
    field public final int latency;
    field public final int peakBandwidth;
    field public final int serviceType;
    field public final int tokenBucketSize;
    field public final int tokenRate;
  }
  public static class BluetoothHidDeviceAppQosSettings.Builder {
    ctor public BluetoothHidDeviceAppQosSettings.Builder();
    method public android.bluetooth.BluetoothHidDeviceAppQosSettings build();
    method public android.bluetooth.BluetoothHidDeviceAppQosSettings.Builder delayVariation(int);
    method public android.bluetooth.BluetoothHidDeviceAppQosSettings.Builder latency(int);
    method public android.bluetooth.BluetoothHidDeviceAppQosSettings.Builder peakBandwidth(int);
    method public android.bluetooth.BluetoothHidDeviceAppQosSettings.Builder serviceType(int);
    method public android.bluetooth.BluetoothHidDeviceAppQosSettings.Builder tokenBucketSize(int);
    method public android.bluetooth.BluetoothHidDeviceAppQosSettings.Builder tokenRate(int);
  }
  public final class BluetoothHidDeviceAppSdpSettings implements android.os.Parcelable {
    ctor public BluetoothHidDeviceAppSdpSettings(java.lang.String, java.lang.String, java.lang.String, byte, byte[]);
    method public int describeContents();
    method public java.lang.String getDescription();
    method public byte[] getDescriptors();
    method public java.lang.String getName();
    method public java.lang.String getProvider();
    method public byte getSubclass();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHidDeviceAppSdpSettings> CREATOR;
    field public final java.lang.String description;
    field public final byte[] descriptors;
    field public final java.lang.String name;
    field public final java.lang.String provider;
    field public final byte subclass;
  }
  public abstract class BluetoothHidDeviceCallback {
    ctor public BluetoothHidDeviceCallback();
    method public void onAppStatusChanged(android.bluetooth.BluetoothDevice, boolean);
    method public void onConnectionStateChanged(android.bluetooth.BluetoothDevice, int);
    method public void onGetReport(android.bluetooth.BluetoothDevice, byte, byte, int);
    method public void onInterruptData(android.bluetooth.BluetoothDevice, byte, byte[]);
    method public void onSetProtocol(android.bluetooth.BluetoothDevice, byte);
    method public void onSetReport(android.bluetooth.BluetoothDevice, byte, byte, byte[]);
    method public void onVirtualCableUnplug(android.bluetooth.BluetoothDevice);
  }
  public final class BluetoothManager {