Don't start the loader task if one is already running

This should appease the monkeys.

Bug: 9619255
Change-Id: Idbac0bd86acafbdb636b0b18e09fcbb9eea15cc4
This commit is contained in:
Amith Yamasani
2013-06-28 15:30:08 -07:00
parent f64e3b7b92
commit ab72687b15

View File

@@ -113,6 +113,7 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen
private List<SelectableAppInfo> mVisibleApps;
private List<ApplicationInfo> mUserApps;
private AsyncTask mAppLoadingTask;
private BroadcastReceiver mUserBackgrounding = new BroadcastReceiver() {
@Override
@@ -271,7 +272,9 @@ public class AppRestrictionsFragment extends SettingsPreferenceFragment implemen
getActivity().registerReceiver(mUserBackgrounding,
new IntentFilter(Intent.ACTION_USER_BACKGROUND));
mAppListChanged = false;
new AppLoadingTask().execute((Void[]) null);
if (mAppLoadingTask == null || mAppLoadingTask.getStatus() == AsyncTask.Status.FINISHED) {
mAppLoadingTask = new AppLoadingTask().execute((Void[]) null);
}
}
public void onPause() {