OSDN Git Service

MediaSessionService: Nullify the media button sesison when it's removed
authorJaewan Kim <jaewan@google.com>
Wed, 29 Mar 2017 18:22:03 +0000 (03:22 +0900)
committerJaewan Kim <jaewan@google.com>
Wed, 19 Apr 2017 05:53:23 +0000 (05:53 +0000)
commitfc1f7ab8ad2f6c01b804cdf41097766a30c89ca9
tree0b18e2b3c7f2ee89cf033d9a5ba822d52da8bf55
parentfe1bddfbb54c20156b45e99c9d18166d702c9adb
MediaSessionService: Nullify the media button sesison when it's removed

When the media button sesison is removed, we'd better not pick the
alternative media button session within the app because the alternative
media session might be a dummy which isn't able to handle media keys.

Test: Run the CtsMediaTest (MediaSessionTest and MediaSessionManagerTest)
  and the manual test (Launch a media app which creates two media
  sessions, and confirmed that another media session doesn't become the
  media button session when the media button session is removed)

Change-Id: I376a34ee4b5d2344007594134c40b135b2c5a1bf
services/core/java/com/android/server/media/MediaSessionStack.java