From: Eugene Crosser Date: Tue, 31 Jan 2012 14:49:21 +0000 (+0400) Subject: clean worker interface X-Git-Url: http://average.org/gitweb/?a=commitdiff_plain;h=f0a40c9526244dbc9369480f2f7056771dfa40c6;p=WhereAmI.git clean worker interface --- diff --git a/src/org/average/whereami/Location.java b/src/org/average/whereami/Location.java index fcbc59f..9f588b3 100644 --- a/src/org/average/whereami/Location.java +++ b/src/org/average/whereami/Location.java @@ -9,12 +9,12 @@ import com.google.api.client.http.HttpTransport; import com.google.api.client.util.DateTime; import android.util.Log; +import android.os.SystemClock; public final class Location extends Oracle { @Override public final String getResult() { + SystemClock.sleep(6000); return "Response from Location.getResult"; } - - //public PhoneLog() {} } diff --git a/src/org/average/whereami/PhoneLog.java b/src/org/average/whereami/PhoneLog.java index 66517a4..0d99cbb 100644 --- a/src/org/average/whereami/PhoneLog.java +++ b/src/org/average/whereami/PhoneLog.java @@ -16,12 +16,12 @@ import com.google.api.client.util.DateTime; //import com.google.common.collect.Lists; import android.util.Log; +import android.os.SystemClock; public final class PhoneLog extends Oracle { @Override public final String getResult() { + SystemClock.sleep(5000); return "Response from PhoneLog.getResult"; } - - //public PhoneLog() {} } diff --git a/src/org/average/whereami/WhereAmI.java b/src/org/average/whereami/WhereAmI.java index 2539e0e..953fcc9 100644 --- a/src/org/average/whereami/WhereAmI.java +++ b/src/org/average/whereami/WhereAmI.java @@ -10,7 +10,6 @@ import android.net.wifi.WifiManager; import android.os.Bundle; import android.os.AsyncTask; import android.os.Handler; -import android.os.SystemClock; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.content.BroadcastReceiver; @@ -47,10 +46,7 @@ public class WhereAmI extends Activity @Override protected String doInBackground(Void... params) { Log.w("WhereAmI", "BgUpdate " + updater + " starting"); - SystemClock.sleep(5000); // real job do be done here - String result = updater.getResult(); - Log.w("WhereAmI", "BgUpdate about to return"); - return result; + return updater.getResult(); } @Override