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

Commit d13b50b3 authored by Doris Ling's avatar Doris Ling
Browse files

Remove the 2 seconds wait time to sync app data usage list.

- in v2, completely remove the asyn task to force update the network
stats since the network stats apis is actually not used.
- in v1, remove the 2s delay and only update the list when the asyn task
is done.

Change-Id: I10e887022d07fe38504036cbf3f12362eec939b3
Fixes: 119562454
Test: manual
parent 662b209b
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -193,17 +193,13 @@ public class DataUsageList extends DataUsageBaseFragment {
    public void onResume() {
        super.onResume();
        mDataStateListener.setListener(true, mSubId, getContext());
        updateBody();

        // kick off background task to update stats
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... params) {
                try {
                    // wait a few seconds before kicking off
                    Thread.sleep(2 * DateUtils.SECOND_IN_MILLIS);
                    services.mStatsService.forceUpdate();
                } catch (InterruptedException e) {
                } catch (RemoteException e) {
                }
                return null;
@@ -211,10 +207,8 @@ public class DataUsageList extends DataUsageBaseFragment {

            @Override
            protected void onPostExecute(Void result) {
                if (isAdded()) {
                updateBody();
            }
            }
        }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }

+0 −22
Original line number Diff line number Diff line
@@ -187,28 +187,6 @@ public class DataUsageListV2 extends DataUsageBaseFragment {
        super.onResume();
        mDataStateListener.setListener(true, mSubId, getContext());
        updateBody();

        // kick off background task to update stats
        new AsyncTask<Void, Void, Void>() {
            @Override
            protected Void doInBackground(Void... params) {
                try {
                    // wait a few seconds before kicking off
                    Thread.sleep(2 * DateUtils.SECOND_IN_MILLIS);
                    services.mStatsService.forceUpdate();
                } catch (InterruptedException e) {
                } catch (RemoteException e) {
                }
                return null;
            }

            @Override
            protected void onPostExecute(Void result) {
                if (isAdded()) {
                    updateBody();
                }
            }
        }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
    }

    @Override