Home | History | Annotate | Download | only in media

Lines Matching refs:command

37  * A set of {@link SessionCommand2} which represents a command group.
43 // Prefix for all command codes
45 // Prefix for command codes that will be sent directly to the MediaPlayerInterface
47 // Prefix for command codes that will be sent directly to the MediaPlaylistAgent
49 // Prefix for command codes that will be sent directly to AudioManager or VolumeProvider.
71 * Adds a command to this command group.
73 * @param command A command to add. Shouldn't be {@code null}.
75 public void addCommand(@NonNull SessionCommand2 command) {
76 if (command == null) {
77 throw new IllegalArgumentException("command shouldn't be null");
79 mCommands.add(command);
83 * Adds a predefined command with given {@code commandCode} to this command group.
85 * @param commandCode A command code to add.
90 throw new IllegalArgumentException("command shouldn't be null");
96 * Adds all predefined commands to this command group.
131 * Removes a command from this group which matches given {@code command}.
133 * @param command A command to find. Shouldn't be {@code null}.
135 public void removeCommand(@NonNull SessionCommand2 command) {
136 if (command == null) {
137 throw new IllegalArgumentException("command shouldn't be null");
139 mCommands.remove(command);
143 * Removes a command from this group which matches given {@code commandCode}.
145 * @param commandCode A command code to find.
156 * Checks whether this command group has a command that matches given {@code command}.
158 * @param command A command to find. Shouldn't be {@code null}.
160 public boolean hasCommand(@NonNull SessionCommand2 command) {
161 if (command == null) {
162 throw new IllegalArgumentException("command shouldn't be null");
164 return mCommands.contains(command);
168 * Checks whether this command group has a command that matches given {@code commandCode}.
170 * @param commandCode A command code to find.
175 throw new IllegalArgumentException("Use hasCommand(Command) for custom command");
177 for (SessionCommand2 command : mCommands) {
178 if (command.getCommandCode() == commandCode) {
186 * Gets all commands of this command group.
199 for (SessionCommand2 command : mCommands) {
200 list.add(command.toBundle());
227 SessionCommand2 command = SessionCommand2.fromBundle(commandBundle);
228 if (command != null) {
229 commandGroup.addCommand(command);