Merge change 26896 into eclair

* changes:
  ResultTransport needs a default value. If the thread is ununlocked by something else other than CallbackProxy's notify(), it can have a null value.
This commit is contained in:
Android (Google) Code Review
2009-09-24 15:35:22 -04:00

View File

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