FakeMusicMediaSourceController
Controller to send commands to the FakeMusic media source.
The media source can be found in module appsuite_media_standalone_testingsupport_fakemusic
, under the package com.tomtom.ivi.appsuite.media.standalone.testingsupport.fakemusic
. That module creates an APK which needs to be installed on a device before these commands can succeed.
All commands are sent synchronously. This ensures predictability of test flow, by not requiring the caller to wait for their completion.
Note: All the commands must be called using a background thread. This is due to an Android media framework limitation: even if media callbacks are received by this controller on the specified dispatcher, internally the media framework will only work on the main thread.
Functions
Disable search support in the FakeMusic media source. After this, the FakeMusic media source will not allow searching until the next reset.
Follow a collectionId. This means that the collection is added to a special library category FakeMusicMediaBrowserServiceInfo.LIBRARY_CATEGORY_ID and library item FakeMusicMediaBrowserServiceInfo.LIBRARY_ITEM_ID.
Retrieve whether log in is required to access the FakeMusic media source. If the command cannot be sent, this call throws a RuntimeException.
Retrieve whether the user is logged in to the FakeMusic media source. If the command cannot be sent, this call throws a RuntimeException.
Log in to the FakeMusic media source. After this, the contents of the FakeMusic media source will be accessible until logout is called. This call does nothing unless requireLogin is called.
Log out from the session, and require a new login action. After this, the contents of the FakeMusic media source will be inaccessible until login is called. This call does nothing until both requireLogin and login are called.
Reset the source to the initial state, with no active media.
Unfollow a collectionId. This means that the collection is removed from a special library category FakeMusicMediaBrowserServiceInfo.LIBRARY_CATEGORY_ID and library item FakeMusicMediaBrowserServiceInfo.LIBRARY_ITEM_ID.