Merge "Fix flaky media key event related CTS tests" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-07-02 01:57:04 +00:00
committed by Android (Google) Code Review

View File

@@ -404,7 +404,7 @@ public class MediaSession2 implements AutoCloseable {
mCallback.onPostConnect(MediaSession2.this, controllerInfo);
connected = true;
} finally {
if (!connected) {
if (!connected || isClosed()) {
if (DEBUG) {
Log.d(TAG, "Rejecting connection or notifying that session is closed"
+ ", controllerInfo=" + controllerInfo);