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

Commit 870dcb69 authored by Chaohui Wang's avatar Chaohui Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix the device admin apps status not refreshed" into tm-dev

parents 6d9b155b 0e8acae9
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(