Add getPackageName to MediaController

This removes the MediaSessionInfo class and adds a method on the
controller to get the package name. This also converts code that
depended on the session's UUID to use the token for comparison or
the Tag in the case of test code that needs a string identifier.

Change-Id: Icb8dc76c70e23e897da8fd07651c524b96372bf9
This commit is contained in:
RoboErik
2014-07-24 18:35:11 -07:00
parent b214efbb91
commit aa4e23bbb3
13 changed files with 101 additions and 159 deletions

View File

@@ -214,7 +214,7 @@ import java.util.List;
public String getRemoteControlClientPackageName() {
if (USE_SESSIONS) {
synchronized (mInfoLock) {
return mCurrentSession != null ? mCurrentSession.getSessionInfo().getPackageName()
return mCurrentSession != null ? mCurrentSession.getPackageName()
: null;
}
} else {
@@ -980,8 +980,8 @@ import java.util.List;
0 /* genId */, 1 /* clearing */, null /* obj */, 0 /* delay */);
}
} else if (mCurrentSession == null
|| !controller.getSessionInfo().getId()
.equals(mCurrentSession.getSessionInfo().getId())) {
|| !controller.getSessionToken()
.equals(mCurrentSession.getSessionToken())) {
if (mCurrentSession != null) {
mCurrentSession.removeCallback(mSessionCb);
}