Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 902d1bc4 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

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

parents 7a2466b5 ab72687b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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() {