Merge "Move illegal state detection in stub classes to warning"
This commit is contained in:
@@ -57,10 +57,10 @@ public class ImsEcbmImplBase {
|
|||||||
} else if (listener != null && mListener == null) {
|
} else if (listener != null && mListener == null) {
|
||||||
mListener = listener;
|
mListener = listener;
|
||||||
} else {
|
} else {
|
||||||
// Fail fast here instead of silently overwriting the listener to another
|
// Warn that the listener is being replaced while active
|
||||||
// listener due to another connection connecting.
|
Log.w(TAG, "setListener is being called when there is already an active "
|
||||||
throw new IllegalStateException("ImsEcbmImplBase: Listener already set by "
|
+ "listener");
|
||||||
+ "another connection.");
|
mListener = listener;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,10 +62,10 @@ public class ImsMultiEndpointImplBase {
|
|||||||
} else if (listener != null && mListener == null) {
|
} else if (listener != null && mListener == null) {
|
||||||
mListener = listener;
|
mListener = listener;
|
||||||
} else {
|
} else {
|
||||||
// Fail fast here instead of silently overwriting the listener to another
|
// Warn that the listener is being replaced while active
|
||||||
// listener due to another connection connecting.
|
Log.w(TAG, "setListener is being called when there is already an active "
|
||||||
throw new IllegalStateException("ImsMultiEndpointImplBase: Listener already"
|
+ "listener");
|
||||||
+ " set by another connection.");
|
mListener = listener;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -224,11 +224,10 @@ public class ImsUtImplBase {
|
|||||||
} else if (listener != null && mUtListener == null) {
|
} else if (listener != null && mUtListener == null) {
|
||||||
mUtListener = new ImsUtListener(listener);
|
mUtListener = new ImsUtListener(listener);
|
||||||
} else {
|
} else {
|
||||||
// This is a limitation of the current API surface, there can only be one
|
// Warn that the listener is being replaced while active
|
||||||
// listener connected. Fail fast instead of silently overwriting the other
|
Log.w(TAG, "setListener is being called when there is already an active "
|
||||||
// listener.
|
+ "listener");
|
||||||
throw new IllegalStateException("ImsUtImplBase#setListener: listener already "
|
mUtListener = new ImsUtListener(listener);
|
||||||
+ "set by another connected interface!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user