Bug 842797 - Rename GeckoAsyncTask to UiAsyncTask. r=mfinkle

--HG--
rename : mobile/android/base/GeckoAsyncTask.java => mobile/android/base/UiAsyncTask.java
This commit is contained in:
Brian Nicholson 2013-02-21 12:01:09 -08:00
parent 5741dcfde5
commit 3dcf800fa0
10 changed files with 26 additions and 26 deletions

View File

@ -13,7 +13,7 @@ import org.mozilla.gecko.db.BrowserDB.PinnedSite;
import org.mozilla.gecko.db.BrowserDB.TopSitesCursorWrapper;
import org.mozilla.gecko.sync.setup.SyncAccounts;
import org.mozilla.gecko.util.ActivityResultHandler;
import org.mozilla.gecko.util.GeckoAsyncTask;
import org.mozilla.gecko.util.UiAsyncTask;
import org.json.JSONArray;
import org.json.JSONException;
@ -421,7 +421,7 @@ public class AboutHomeContent extends ScrollView
if (urls.size() == 0)
return;
(new GeckoAsyncTask<Void, Void, Cursor>(getHandler(), GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, Cursor>(getHandler(), GeckoAppShell.getHandler()) {
@Override
public Cursor doInBackground(Void... params) {
return BrowserDB.getThumbnailsForUrls(cr, urls);
@ -993,7 +993,7 @@ public class AboutHomeContent extends ScrollView
final String url = holder.getUrl();
// Quickly update the view so that there isn't as much lag between the request and response
clearThumbnail(holder);
(new GeckoAsyncTask<Void, Void, Void>(getHandler(), GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, Void>(getHandler(), GeckoAppShell.getHandler()) {
@Override
public Void doInBackground(Void... params) {
final ContentResolver resolver = mActivity.getContentResolver();
@ -1014,7 +1014,7 @@ public class AboutHomeContent extends ScrollView
holder.setPinned(true);
// update the database on a background thread
(new GeckoAsyncTask<Void, Void, Void>(getHandler(), GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, Void>(getHandler(), GeckoAppShell.getHandler()) {
@Override
public Void doInBackground(Void... params) {
final ContentResolver resolver = mActivity.getContentResolver();
@ -1058,7 +1058,7 @@ public class AboutHomeContent extends ScrollView
holder.setPinned(true);
// update the database on a background thread
(new GeckoAsyncTask<Void, Void, Bitmap>(getHandler(), GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, Bitmap>(getHandler(), GeckoAppShell.getHandler()) {
@Override
public Bitmap doInBackground(Void... params) {
final ContentResolver resolver = mActivity.getContentResolver();

View File

@ -7,7 +7,7 @@ package org.mozilla.gecko;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.sync.setup.activities.SetupSyncActivity;
import org.mozilla.gecko.sync.setup.SyncAccounts;
import org.mozilla.gecko.util.GeckoAsyncTask;
import org.mozilla.gecko.util.UiAsyncTask;
import android.accounts.Account;
import android.accounts.AccountManager;
@ -191,7 +191,7 @@ public class AboutHomePromoBox extends TextView implements View.OnClickListener
}
private void getAvailableTypes(final GetTypesCallback callback) {
(new GeckoAsyncTask<Void, Void, ArrayList<Type>>(getHandler(), GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, ArrayList<Type>>(getHandler(), GeckoAppShell.getHandler()) {
@Override
public ArrayList<Type> doInBackground(Void... params) {
// Run all of this on a background thread

View File

@ -7,7 +7,7 @@ package org.mozilla.gecko;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.db.BrowserContract.Combined;
import org.mozilla.gecko.util.GeckoAsyncTask;
import org.mozilla.gecko.util.UiAsyncTask;
import org.mozilla.gecko.util.StringUtils;
import android.app.Activity;
@ -566,7 +566,7 @@ public class AwesomeBar extends GeckoActivity {
editPrompt.setPositiveButton(R.string.button_ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
(new GeckoAsyncTask<Void, Void, Void>(mAwesomeTabs.getHandler(), GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, Void>(mAwesomeTabs.getHandler(), GeckoAppShell.getHandler()) {
@Override
public Void doInBackground(Void... params) {
String newUrl = locationText.getText().toString().trim();
@ -612,7 +612,7 @@ public class AwesomeBar extends GeckoActivity {
break;
}
case R.id.remove_bookmark: {
(new GeckoAsyncTask<Void, Void, Void>(mAwesomeTabs.getHandler(), GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, Void>(mAwesomeTabs.getHandler(), GeckoAppShell.getHandler()) {
private boolean mInReadingList;
@Override
@ -642,7 +642,7 @@ public class AwesomeBar extends GeckoActivity {
break;
}
case R.id.remove_history: {
(new GeckoAsyncTask<Void, Void, Void>(mAwesomeTabs.getHandler(), GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, Void>(mAwesomeTabs.getHandler(), GeckoAppShell.getHandler()) {
@Override
public Void doInBackground(Void... params) {
BrowserDB.removeHistoryEntry(getContentResolver(), id);

View File

@ -8,7 +8,7 @@ package org.mozilla.gecko;
import org.mozilla.gecko.db.BrowserContract.Combined;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.gfx.BitmapUtils;
import org.mozilla.gecko.util.GeckoAsyncTask;
import org.mozilla.gecko.util.UiAsyncTask;
import org.mozilla.gecko.util.GeckoBackgroundThread;
import org.json.JSONArray;
@ -1161,7 +1161,7 @@ abstract public class BrowserApp extends GeckoApp
if (!Intent.ACTION_MAIN.equals(intent.getAction()) || !mInitialized)
return;
(new GeckoAsyncTask<Void, Void, Boolean>(mMainHandler, GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, Boolean>(mMainHandler, GeckoAppShell.getHandler()) {
@Override
public synchronized Boolean doInBackground(Void... params) {
// Check to see how many times the app has been launched.
@ -1198,7 +1198,7 @@ abstract public class BrowserApp extends GeckoApp
}
private void getLastUrl() {
(new GeckoAsyncTask<Void, Void, String>(mMainHandler, GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, String>(mMainHandler, GeckoAppShell.getHandler()) {
@Override
public synchronized String doInBackground(Void... params) {
// Get the most recent URL stored in browser history.

View File

@ -6,7 +6,7 @@
package org.mozilla.gecko;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.util.GeckoAsyncTask;
import org.mozilla.gecko.util.UiAsyncTask;
import org.mozilla.gecko.util.GeckoJarReader;
import org.apache.http.HttpEntity;
@ -199,7 +199,7 @@ public class Favicons {
}
}
private class LoadFaviconTask extends GeckoAsyncTask<Void, Void, Bitmap> {
private class LoadFaviconTask extends UiAsyncTask<Void, Void, Bitmap> {
private long mId;
private String mPageUrl;
private String mFaviconUrl;

View File

@ -14,7 +14,7 @@ import org.mozilla.gecko.gfx.PanZoomController;
import org.mozilla.gecko.gfx.PluginLayer;
import org.mozilla.gecko.gfx.PointUtils;
import org.mozilla.gecko.mozglue.GeckoLoader;
import org.mozilla.gecko.util.GeckoAsyncTask;
import org.mozilla.gecko.util.UiAsyncTask;
import org.mozilla.gecko.util.GeckoBackgroundThread;
import org.mozilla.gecko.util.GeckoEventListener;
import org.mozilla.gecko.util.GeckoEventResponder;
@ -623,7 +623,7 @@ abstract public class GeckoApp
}
void handleFaviconRequest(final String url) {
(new GeckoAsyncTask<Void, Void, String>(mMainHandler, GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, String>(mMainHandler, GeckoAppShell.getHandler()) {
@Override
public String doInBackground(Void... params) {
return Favicons.getInstance().getFaviconUrlForPageUrl(url);
@ -1237,7 +1237,7 @@ abstract public class GeckoApp
notification.setLatestEventInfo(mAppContext, fileName, progText, emptyIntent );
notification.flags |= Notification.FLAG_ONGOING_EVENT;
notification.show();
new GeckoAsyncTask<Void, Void, Boolean>(mMainHandler, GeckoAppShell.getHandler()){
new UiAsyncTask<Void, Void, Boolean>(mMainHandler, GeckoAppShell.getHandler()){
@Override
protected Boolean doInBackground(Void... params) {

View File

@ -27,7 +27,7 @@ MOZGLUE_PP_JAVA_FILES := \
UTIL_JAVA_FILES := \
ActivityResultHandler.java \
ActivityResultHandlerMap.java \
GeckoAsyncTask.java \
UiAsyncTask.java \
GeckoBackgroundThread.java \
GeckoEventListener.java \
GeckoEventResponder.java \

View File

@ -5,7 +5,7 @@
package org.mozilla.gecko;
import org.mozilla.gecko.db.BrowserContract;
import org.mozilla.gecko.util.GeckoAsyncTask;
import org.mozilla.gecko.util.UiAsyncTask;
import org.json.JSONArray;
import org.json.JSONException;
@ -74,7 +74,7 @@ public final class TabsAccessor {
if (listener == null)
return;
(new GeckoAsyncTask<Void, Void, List<RemoteTab>>(uiHandler, GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, List<RemoteTab>>(uiHandler, GeckoAppShell.getHandler()) {
@Override
protected List<RemoteTab> doInBackground(Void... unused) {
Uri uri = BrowserContract.Tabs.CONTENT_URI;

View File

@ -10,12 +10,12 @@ import android.os.Handler;
// AsyncTask runs onPostExecute on the thread it is constructed on
// We construct these off of the main thread, and we want that to run
// on the main UI thread, so this is a convenience class to do that
public abstract class GeckoAsyncTask<Params, Progress, Result> {
public abstract class UiAsyncTask<Params, Progress, Result> {
private volatile boolean mCancelled = false;
private final Handler mBackgroundThreadHandler;
private final Handler mUiHandler;
public GeckoAsyncTask(Handler uiHandler, Handler backgroundThreadHandler) {
public UiAsyncTask(Handler uiHandler, Handler backgroundThreadHandler) {
mUiHandler = uiHandler;
mBackgroundThreadHandler = backgroundThreadHandler;
}

View File

@ -10,7 +10,7 @@ import org.mozilla.gecko.db.BrowserContract.Combined;
import org.mozilla.gecko.db.BrowserDB;
import org.mozilla.gecko.db.BrowserDB.URLColumns;
import org.mozilla.gecko.gfx.BitmapUtils;
import org.mozilla.gecko.util.GeckoAsyncTask;
import org.mozilla.gecko.util.UiAsyncTask;
import org.mozilla.gecko.util.GeckoEventListener;
import org.mozilla.gecko.util.StringUtils;
@ -821,7 +821,7 @@ public class AllPagesTab extends AwesomeBarTab implements GeckoEventListener {
if (urls.size() == 0)
return;
(new GeckoAsyncTask<Void, Void, Cursor>(getView().getHandler(), GeckoAppShell.getHandler()) {
(new UiAsyncTask<Void, Void, Cursor>(getView().getHandler(), GeckoAppShell.getHandler()) {
@Override
public Cursor doInBackground(Void... params) {
return BrowserDB.getFaviconsForUrls(getContentResolver(), urls);