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

Commit cd5b97df authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Fix updates of the enable/disable button" into mnc-dev

parents bdf3ddad 63fbf68a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
    protected boolean mAppControlRestricted = false;

    protected ApplicationsState mState;
    protected ApplicationsState.Session mSession;
    protected ApplicationsState.AppEntry mAppEntry;
    protected PackageInfo mPackageInfo;
    protected int mUserId;
@@ -75,6 +76,7 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
        mFinishing = false;

        mState = ApplicationsState.getInstance(getActivity().getApplication());
        mSession = mState.newSession(this);
        Context context = getActivity();
        mDpm = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
        mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
@@ -88,6 +90,7 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
    @Override
    public void onResume() {
        super.onResume();
        mSession.resume();
        mAppControlRestricted = mUserManager.hasUserRestriction(UserManager.DISALLOW_APPS_CONTROL);

        if (!refreshUi()) {
@@ -95,6 +98,12 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
        }
    }

    @Override
    public void onPause() {
        mSession.pause();
        super.onPause();
    }

    protected String retrieveAppEntry() {
        final Bundle args = getArguments();
        mPackageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null;