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
5d2398cb
Commit
5d2398cb
authored
1 year ago
by
Jack He
Committed by
Gerrit Code Review
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge "[le audio] Broadcast service api enforce callback check"
parents
d438c5b2
6fbd7887
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/BluetoothLeBroadcast.java
+16
-0
16 additions, 0 deletions
framework/java/android/bluetooth/BluetoothLeBroadcast.java
with
16 additions
and
0 deletions
framework/java/android/bluetooth/BluetoothLeBroadcast.java
+
16
−
0
View file @
5d2398cb
...
...
@@ -554,6 +554,9 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
public
void
startBroadcast
(
@NonNull
BluetoothLeAudioContentMetadata
contentMetadata
,
@Nullable
byte
[]
broadcastCode
)
{
Objects
.
requireNonNull
(
contentMetadata
,
"contentMetadata cannot be null"
);
if
(
mCallbackExecutorMap
.
isEmpty
())
{
throw
new
IllegalStateException
(
"No callback was ever registered"
);
}
if
(
DBG
)
log
(
"startBroadcasting"
);
final
IBluetoothLeAudio
service
=
getService
();
...
...
@@ -593,6 +596,9 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
})
public
void
startBroadcast
(
@NonNull
BluetoothLeBroadcastSettings
broadcastSettings
)
{
Objects
.
requireNonNull
(
broadcastSettings
,
"broadcastSettings cannot be null"
);
if
(
mCallbackExecutorMap
.
isEmpty
())
{
throw
new
IllegalStateException
(
"No callback was ever registered"
);
}
if
(
DBG
)
log
(
"startBroadcasting"
);
final
IBluetoothLeAudio
service
=
getService
();
...
...
@@ -637,6 +643,9 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
public
void
updateBroadcast
(
int
broadcastId
,
@NonNull
BluetoothLeAudioContentMetadata
contentMetadata
)
{
Objects
.
requireNonNull
(
contentMetadata
,
"contentMetadata cannot be null"
);
if
(
mCallbackExecutorMap
.
isEmpty
())
{
throw
new
IllegalStateException
(
"No callback was ever registered"
);
}
if
(
DBG
)
log
(
"updateBroadcast"
);
final
IBluetoothLeAudio
service
=
getService
();
...
...
@@ -682,6 +691,9 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
public
void
updateBroadcast
(
int
broadcastId
,
@NonNull
BluetoothLeBroadcastSettings
broadcastSettings
)
{
Objects
.
requireNonNull
(
broadcastSettings
,
"broadcastSettings cannot be null"
);
if
(
mCallbackExecutorMap
.
isEmpty
())
{
throw
new
IllegalStateException
(
"No callback was ever registered"
);
}
if
(
DBG
)
log
(
"updateBroadcast"
);
final
IBluetoothLeAudio
service
=
getService
();
...
...
@@ -721,6 +733,10 @@ public final class BluetoothLeBroadcast implements AutoCloseable, BluetoothProfi
android
.
Manifest
.
permission
.
BLUETOOTH_PRIVILEGED
,
})
public
void
stopBroadcast
(
int
broadcastId
)
{
if
(
mCallbackExecutorMap
.
isEmpty
())
{
throw
new
IllegalStateException
(
"No callback was ever registered"
);
}
if
(
DBG
)
log
(
"disableBroadcastMode"
);
final
IBluetoothLeAudio
service
=
getService
();
if
(
service
==
null
)
{
...
...
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