summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java
diff options
context:
space:
mode:
authorIvan Podogov <ginkage@google.com>2018-02-27 17:58:16 +0000
committerHansong Zhang <hsz@google.com>2018-03-21 09:44:57 -0700
commitcc8b9b19d5f1990d72f95ec43e081aa79bf84c8c (patch)
tree964cc8ed48f9a398cb7249905aba17d63b640e15 /framework/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java
parent5a96fe77b8727c8077f82007af1a87d4ff7aeacb (diff)
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
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java60
1 files changed, 33 insertions, 27 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java b/framework/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java
index 562c559edd..237082e4cb 100644
--- a/framework/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java
+++ b/framework/java/android/bluetooth/BluetoothHidDeviceAppSdpSettings.java
@@ -19,7 +19,6 @@ package android.bluetooth;
import android.os.Parcel;
import android.os.Parcelable;
-import java.util.Arrays;
/**
* Represents the Service Discovery Protocol (SDP) settings for a Bluetooth HID Device application.
@@ -31,11 +30,11 @@ import java.util.Arrays;
*/
public final class BluetoothHidDeviceAppSdpSettings implements Parcelable {
- public final String name;
- public final String description;
- public final String provider;
- public final byte subclass;
- public final byte[] descriptors;
+ private final String mName;
+ private final String mDescription;
+ private final String mProvider;
+ private final byte mSubclass;
+ private final byte[] mDescriptors;
/**
* Create a BluetoothHidDeviceAppSdpSettings object for the Bluetooth SDP record.
@@ -52,24 +51,31 @@ public final class BluetoothHidDeviceAppSdpSettings implements Parcelable {
*/
public BluetoothHidDeviceAppSdpSettings(
String name, String description, String provider, byte subclass, byte[] descriptors) {
- this.name = name;
- this.description = description;
- this.provider = provider;
- this.subclass = subclass;
- this.descriptors = descriptors.clone();
+ mName = name;
+ mDescription = description;
+ mProvider = provider;
+ mSubclass = subclass;
+ mDescriptors = descriptors.clone();
}
- @Override
- public boolean equals(Object o) {
- if (o instanceof BluetoothHidDeviceAppSdpSettings) {
- BluetoothHidDeviceAppSdpSettings sdp = (BluetoothHidDeviceAppSdpSettings) o;
- return this.name.equals(sdp.name)
- && this.description.equals(sdp.description)
- && this.provider.equals(sdp.provider)
- && this.subclass == sdp.subclass
- && Arrays.equals(this.descriptors, sdp.descriptors);
- }
- return false;
+ public String getName() {
+ return mName;
+ }
+
+ public String getDescription() {
+ return mDescription;
+ }
+
+ public String getProvider() {
+ return mProvider;
+ }
+
+ public byte getSubclass() {
+ return mSubclass;
+ }
+
+ public byte[] getDescriptors() {
+ return mDescriptors;
}
@Override
@@ -99,10 +105,10 @@ public final class BluetoothHidDeviceAppSdpSettings implements Parcelable {
@Override
public void writeToParcel(Parcel out, int flags) {
- out.writeString(name);
- out.writeString(description);
- out.writeString(provider);
- out.writeByte(subclass);
- out.writeByteArray(descriptors);
+ out.writeString(mName);
+ out.writeString(mDescription);
+ out.writeString(mProvider);
+ out.writeByte(mSubclass);
+ out.writeByteArray(mDescriptors);
}
}