diff options
author | Jason Monk <jmonk@google.com> | 2015-06-04 10:57:31 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2015-06-04 10:57:31 -0400 |
commit | 63fbf68a42df5f69671257cb88fd5ef9a8bacb89 (patch) | |
tree | 89e0f247d5afe3a24a9317a8a54b0c01f0b11d74 /src/com/android/settings/applications/AppInfoBase.java | |
parent | fb32790adc9ed647ad4e77c9613a860f9b76e855 (diff) | |
download | packages_apps_Settings-63fbf68a42df5f69671257cb88fd5ef9a8bacb89.tar.gz packages_apps_Settings-63fbf68a42df5f69671257cb88fd5ef9a8bacb89.tar.bz2 packages_apps_Settings-63fbf68a42df5f69671257cb88fd5ef9a8bacb89.zip |
Fix updates of the enable/disable button
Make the entire ApplicationsState resume and do way too much work
so that we can get a little bit of state.
ApplicationsState could use some refactoring.
Bug: 21518528
Change-Id: Ibb6a2c15948f9bc69490426d4004dc83582087b4
Diffstat (limited to 'src/com/android/settings/applications/AppInfoBase.java')
-rw-r--r-- | src/com/android/settings/applications/AppInfoBase.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/settings/applications/AppInfoBase.java b/src/com/android/settings/applications/AppInfoBase.java index 5e0f4ebf10..6dbeefd8b6 100644 --- a/src/com/android/settings/applications/AppInfoBase.java +++ b/src/com/android/settings/applications/AppInfoBase.java @@ -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; |