Merge "Fix immutability bug in http://ag/587241" into lmp-mr1-dev

This commit is contained in:
Ihab Awad
2014-12-02 01:00:07 +00:00
committed by Android (Google) Code Review

View File

@@ -1310,14 +1310,18 @@ public abstract class Connection implements IConferenceable {
} }
private static class FailureSignalingConnection extends Connection { private static class FailureSignalingConnection extends Connection {
private boolean mImmutable = false;
public FailureSignalingConnection(DisconnectCause disconnectCause) { public FailureSignalingConnection(DisconnectCause disconnectCause) {
setDisconnected(disconnectCause); setDisconnected(disconnectCause);
mImmutable = true;
} }
public void checkImmutable() { public void checkImmutable() {
if (mImmutable) {
throw new UnsupportedOperationException("Connection is immutable"); throw new UnsupportedOperationException("Connection is immutable");
} }
} }
}
/** /**
* Return a {@code Connection} which represents a failed connection attempt. The returned * Return a {@code Connection} which represents a failed connection attempt. The returned