Merge "Make MR2ProviderProxy bind again when onBindingDied() is called"
This commit is contained in:
committed by
Android (Google) Code Review
commit
d43771e5b7
@@ -42,6 +42,7 @@ import java.util.Objects;
|
||||
/**
|
||||
* Maintains a connection to a particular media route provider service.
|
||||
*/
|
||||
// TODO: Need to revisit the bind/unbind/connect/disconnect logic in this class.
|
||||
final class MediaRoute2ProviderProxy extends MediaRoute2Provider implements ServiceConnection {
|
||||
private static final String TAG = "MR2ProviderProxy";
|
||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
@@ -252,6 +253,19 @@ final class MediaRoute2ProviderProxy extends MediaRoute2Provider implements Serv
|
||||
disconnect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindingDied(ComponentName name) {
|
||||
if (DEBUG) {
|
||||
Slog.d(TAG, this + ": Service binding died");
|
||||
}
|
||||
// TODO: Investigate whether it tries to bind endlessly when the service is
|
||||
// badly implemented.
|
||||
if (shouldBind()) {
|
||||
unbind();
|
||||
bind();
|
||||
}
|
||||
}
|
||||
|
||||
private void onConnectionReady(Connection connection) {
|
||||
if (mActiveConnection == connection) {
|
||||
mConnectionReady = true;
|
||||
|
||||
Reference in New Issue
Block a user