MediaSession2: Fix bug in SessionToken2 constructor
There's a bug in SessionToken2 constructor that session service is
misunderstood as library service. It's because
PackageManager.resolveService(Intent, int) ignores action in the intent
if the class name is specified, and there's no way for getting the
action from the ResolvedInfo.
Use PackageManager.queryIntentServices(Intent, int) instead to query
services with the action.
Also added tests and fixed ID mismatch issue in test service.
Test: Run all MediaComponents tests once
Change-Id: I5df2f36eae8100be268629881122f47e44eb41d1
diff --git a/packages/MediaComponents/test/AndroidManifest.xml b/packages/MediaComponents/test/AndroidManifest.xml
index 48e4292..5ebe31a 100644
--- a/packages/MediaComponents/test/AndroidManifest.xml
+++ b/packages/MediaComponents/test/AndroidManifest.xml
@@ -34,7 +34,7 @@
<intent-filter>
<action android:name="android.media.MediaLibraryService2" />
</intent-filter>
- <meta-data android:name="android.media.session" android:value="TestBrowser" />
+ <meta-data android:name="android.media.session" android:value="TestLibrary" />
</service>
</application>