Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
platform_packages_modules_Bluetooth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LMODroid
platform_packages_modules_Bluetooth
Commits
334b7721
Commit
334b7721
authored
1 year ago
by
Kihong Seong
Committed by
Gerrit Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "Throw error when notification is larger than max attribute value" into main
parents
1434d775
59c19fa4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
framework/java/android/bluetooth/BluetoothGattServer.java
+6
-0
6 additions, 0 deletions
framework/java/android/bluetooth/BluetoothGattServer.java
with
6 additions
and
0 deletions
framework/java/android/bluetooth/BluetoothGattServer.java
+
6
−
0
View file @
334b7721
...
...
@@ -68,6 +68,8 @@ public final class BluetoothGattServer implements BluetoothProfile {
private
List
<
BluetoothGattService
>
mServices
;
private
static
final
int
CALLBACK_REG_TIMEOUT
=
10000
;
// Max length of an attribute value, defined in gatt_api.h
private
static
final
int
GATT_MAX_ATTR_LEN
=
512
;
/**
* Bluetooth GATT interface callbacks
...
...
@@ -829,6 +831,10 @@ public final class BluetoothGattServer implements BluetoothProfile {
if
(
device
==
null
)
{
throw
new
IllegalArgumentException
(
"device must not be null"
);
}
if
(
value
.
length
>
GATT_MAX_ATTR_LEN
)
{
throw
new
IllegalArgumentException
(
"notification should not be longer than max length of an attribute value"
);
}
BluetoothGattService
service
=
characteristic
.
getService
();
if
(
service
==
null
)
{
throw
new
IllegalArgumentException
(
"Characteristic must have a non-null service"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment