mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix command check in MediaControllerImplBase
The command check for setDeviceMuted was wrong.
PiperOrigin-RevId: 502355332
(cherry picked from commit cfcce9aec9)
This commit is contained in:
parent
24b0367374
commit
903915de3d
3 changed files with 4 additions and 3 deletions
|
|
@ -1468,7 +1468,7 @@ import org.checkerframework.checker.nullness.qual.NonNull;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDeviceMuted(boolean muted) {
|
public void setDeviceMuted(boolean muted) {
|
||||||
if (!isPlayerCommandAvailable(Player.COMMAND_SET_DEVICE_VOLUME)) {
|
if (!isPlayerCommandAvailable(Player.COMMAND_ADJUST_DEVICE_VOLUME)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1324,7 +1324,7 @@ import java.util.concurrent.ExecutionException;
|
||||||
queueSessionTaskWithPlayerCommand(
|
queueSessionTaskWithPlayerCommand(
|
||||||
caller,
|
caller,
|
||||||
sequenceNumber,
|
sequenceNumber,
|
||||||
COMMAND_SET_DEVICE_VOLUME,
|
COMMAND_ADJUST_DEVICE_VOLUME,
|
||||||
sendSessionResultSuccess(player -> player.setDeviceMuted(muted)));
|
sendSessionResultSuccess(player -> player.setDeviceMuted(muted)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,8 @@ public class MediaSessionPermissionTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void setDeviceMuted() throws Exception {
|
public void setDeviceMuted() throws Exception {
|
||||||
testOnCommandRequest(COMMAND_SET_DEVICE_VOLUME, controller -> controller.setDeviceMuted(true));
|
testOnCommandRequest(
|
||||||
|
COMMAND_ADJUST_DEVICE_VOLUME, controller -> controller.setDeviceMuted(true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue