ResultTransport needs a default value. If the thread is

ununlocked by something else other than CallbackProxy's
notify(), it can have a null value.

Fix http://b/issue?id=2131842
This commit is contained in:
Grace Kloba
2009-09-24 12:27:14 -07:00
parent bb6aba1984
commit dbad320bf3

View File

@@ -116,6 +116,10 @@ class CallbackProxy extends Handler {
// Private result object
private E mResult;
public ResultTransport(E defaultResult) {
mResult = defaultResult;
}
public synchronized void setResult(E result) {
mResult = result;
}
@@ -819,7 +823,7 @@ class CallbackProxy extends Handler {
public boolean shouldOverrideUrlLoading(String url) {
// We have a default behavior if no client exists so always send the
// message.
ResultTransport<Boolean> res = new ResultTransport<Boolean>();
ResultTransport<Boolean> res = new ResultTransport<Boolean>(false);
Message msg = obtainMessage(OVERRIDE_URL);
msg.getData().putString("url", url);
msg.obj = res;