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

Commit 0e8acae9 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

Fix the device admin apps status not refreshed

This is caused by I7175c966fbbfbf5d6331f5ac26c06b60d59a4e0d.

updateList() should be called in updateState() to refresh the latest
app status.

Fix: 231113758
Test: manual visual test
Change-Id: I9dc082c829020841ccd76bc4787855c8301f1154
parent 3198bd8c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ public class DeviceAdminListPreferenceController extends BasePreferenceControlle

    private PreferenceGroup mPreferenceGroup;
    private FooterPreference mFooterPreference;
    private boolean mFirstLaunch = true;

    static {
        FILTER.addAction(ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED);
@@ -120,6 +121,17 @@ public class DeviceAdminListPreferenceController extends BasePreferenceControlle
        updateList();
    }

    @Override
    public void updateState(Preference preference) {
        super.updateState(preference);
        if (mFirstLaunch) {
            mFirstLaunch = false;
            // When first launch, updateList() is already be called in displayPreference().
        } else {
            updateList();
        }
    }

    @Override
    public void onStart() {
        mContext.registerReceiverAsUser(