diff options
author | Rahul Sabnis <rahulsabnis@google.com> | 2022-03-17 22:17:14 -0700 |
---|---|---|
committer | Rahul Sabnis <rahulsabnis@google.com> | 2022-03-17 22:18:56 -0700 |
commit | 61e8f11e2359d0b087321b2a7b8b5c94a57afaed (patch) | |
tree | a0ebf028430ade208310f71c30236e544483d4c2 /framework/java/android/bluetooth/BluetoothGattCharacteristic.java | |
parent | dc7a3d9999f3935010d66319a38cd98f9f021d34 (diff) |
Address API council feedback on GATT API changes.
This CL also updates the permission enforcement mechanism for GATT APIs
so it now throws a SecurityException on new APIs as well as on older
APIs called by apps targeting T+.
Tag: #feature
Bug: 217742355
Test: Manual
Change-Id: I87fe2ffd088cbce4a9887538964e73f3f5198157
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothGattCharacteristic.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothGattCharacteristic.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/framework/java/android/bluetooth/BluetoothGattCharacteristic.java b/framework/java/android/bluetooth/BluetoothGattCharacteristic.java index c5e986e895..92bbfcefaf 100644 --- a/framework/java/android/bluetooth/BluetoothGattCharacteristic.java +++ b/framework/java/android/bluetooth/BluetoothGattCharacteristic.java @@ -15,11 +15,14 @@ */ package android.bluetooth; +import android.annotation.IntDef; import android.compat.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.ParcelUuid; import android.os.Parcelable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.List; import java.util.UUID; @@ -115,8 +118,17 @@ public class BluetoothGattCharacteristic implements Parcelable { */ public static final int PERMISSION_WRITE_SIGNED_MITM = 0x100; + /** @hide */ + @Retention(RetentionPolicy.SOURCE) + @IntDef(prefix = "WRITE_TYPE_", value = { + WRITE_TYPE_DEFAULT, + WRITE_TYPE_NO_RESPONSE, + WRITE_TYPE_SIGNED + }) + public @interface WriteType{} + /** - * Write characteristic, requesting acknoledgement by the remote device + * Write characteristic, requesting acknowledgement by the remote device */ public static final int WRITE_TYPE_DEFAULT = 0x02; |