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

Commit e028d30c authored by Roman Birg's avatar Roman Birg Committed by Aashish K. Tantiya
Browse files

Settings: refresh ui on force stop/disable



Fixes the storage summary not updating after force closing, enabling,
or disabling the app.

Ticket: CYNGNOS-2527

Change-Id: I000459d27d06071a36ab0ac6761c1af56c132dde
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
(cherry picked from commit 6f12b368)
(cherry picked from commit d54c8730)
parent 15db02c9
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -709,6 +709,10 @@ public class InstalledAppDetails extends AppInfoBase
    }

    private void checkForceStop() {
        if (getActivity() == null || getActivity().isFinishing()) {
            return;
        }

        if (mDpm.packageHasActiveAdmins(mPackageInfo.packageName)) {
            // User can't force stop device admin.
            updateForceStopButton(false);
@@ -984,6 +988,13 @@ public class InstalledAppDetails extends AppInfoBase
            mPm.setApplicationEnabledSetting(mInfo.packageName, mState, 0);
            return null;
        }

        @Override
        protected void onPostExecute(Object o) {
            if (mActivity.get() !=  null) {
                mActivity.get().refreshUi();
            }
        }
    }

    private final LoaderCallbacks<ChartData> mDataCallbacks = new LoaderCallbacks<ChartData>() {
@@ -1009,6 +1020,7 @@ public class InstalledAppDetails extends AppInfoBase
        @Override
        public void onReceive(Context context, Intent intent) {
            updateForceStopButton(getResultCode() != Activity.RESULT_CANCELED);
            refreshUi();
        }
    };