Use IntRange for setPsm
Configures an IntRange [0, 255] for the L2CAP BLE PSM. Note that L2CAP
over Bluetooth Classic uses PSM values that exceed this range though is
explicitly not supported.
This CL also changes the value for PSM_ANY from -1 to 0 to make the
IntRange continuous as 0 is not a valid PSM (in both BLE and Classic).
Bug: 388438641
Test: TH
Change-Id: I15a69cfb80545c4f3723d089afd3cf026eec0696
diff --git a/framework/api/current.txt b/framework/api/current.txt
index a080149..323c533 100644
--- a/framework/api/current.txt
+++ b/framework/api/current.txt
@@ -244,7 +244,7 @@
field public static final int HEADER_COMPRESSION_6LOWPAN = 2; // 0x2
field public static final int HEADER_COMPRESSION_ANY = 0; // 0x0
field public static final int HEADER_COMPRESSION_NONE = 1; // 0x1
- field public static final int PSM_ANY = -1; // 0xffffffff
+ field public static final int PSM_ANY = 0; // 0x0
field public static final int ROLE_ANY = 0; // 0x0
field public static final int ROLE_CLIENT = 1; // 0x1
field public static final int ROLE_SERVER = 2; // 0x2
@@ -254,7 +254,7 @@
ctor public L2capNetworkSpecifier.Builder();
method @NonNull public android.net.L2capNetworkSpecifier build();
method @NonNull public android.net.L2capNetworkSpecifier.Builder setHeaderCompression(int);
- method @NonNull public android.net.L2capNetworkSpecifier.Builder setPsm(int);
+ method @NonNull public android.net.L2capNetworkSpecifier.Builder setPsm(@IntRange(from=0, to=255) int);
method @NonNull public android.net.L2capNetworkSpecifier.Builder setRemoteAddress(@Nullable android.net.MacAddress);
method @NonNull public android.net.L2capNetworkSpecifier.Builder setRole(int);
}