Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time
November 8, 2021 17:10
June 1, 2020 15:41
November 8, 2021 17:10
November 8, 2021 17:10
November 8, 2021 17:10

Media Controller Test

Create a simple MediaController that connects to a MediaBrowserService in order to test inter-app media controls. This tool is described in the Android documentation: Using the media controller test app.

This app works with the Universal Android Music Player sample, or any other app that implements the media APIs.


  1. Select an app from the list of those presented.
    • Only apps that register a service with an intent filter action of "" will be shown.
  2. Select the type of action to perform to start the player. Options are:
    • Search: Sends the text provided as a search via prepareFromSearch() or playFromSearch().
    • Media ID: Sends the text provided as a media ID via prepareFromMediaId() or playFromMediaId().
    • URI: Sends the text provided as a URI via prepareFromUri() or playFromUri().
    • No Input: Calls the methods prepare() or play() directly.
  3. Text below the PREPARE and PLAY buttons updates based on changes to the media player state via onPlaybackStateChanged and onMetadataChanged and includes the current player state reported via PlaybackStateCompat.getState().
  4. Swipe to the left to see typical media controls with the media's art as a background, if provided.
  5. Press back to return to the list of media apps.


It's also possible to launch the app via ADB and the Activity manager (am).

Parameter Extra Name
Package name
Search term
Media ID

To start the app and connect to UAMP:

adb shell am start -n --es ""

To perform a search with the term "jazz?" one would use:

adb shell am start -n --es "jazz?"


Audio Focus

This app allows for testing how media apps respond to audio focus changes.

The app allows requesting and abandoning the following types of audio focus:


For more information on audio focus please see Managing Audio Focus.

Supported Actions

This tool displays the supported actions as reported by the MediaSession in the call to MediaSessionCompat.setPlaybackState() as a list of prepare and play actions on the main screen. For actions that are not declared as supported, it also colors the buttons red on the controller screen.

See the screenshots below for examples.



Copyright 2017 Google Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


No description, website, or topics provided.







No releases published


No packages published