From 1fb74bb2505865c7ffe3357f3534cf6494b2c0bd Mon Sep 17 00:00:00 2001 From: Danesh M Date: Tue, 22 Sep 2015 21:55:16 -0700 Subject: Settings : Save instance state for app group deletes When deleting an app, inside of an app group in profiles, if the user rotates device while confirmation is showing and presses ok, it is a no-op. Reason is mPackageToDelete loses its state when rotation is change. Address this by persisting it in the state bundle. issue-id: CYNGNOS-1119 Change-Id: I43dd9ccae7e16e92e5ac054f1b2ac0119cbfe60b --- src/com/android/settings/profiles/AppGroupConfig.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/com/android/settings/profiles') diff --git a/src/com/android/settings/profiles/AppGroupConfig.java b/src/com/android/settings/profiles/AppGroupConfig.java index b05f485..5e25bce 100644 --- a/src/com/android/settings/profiles/AppGroupConfig.java +++ b/src/com/android/settings/profiles/AppGroupConfig.java @@ -82,6 +82,10 @@ public class AppGroupConfig extends SettingsPreferenceFragment public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + if (savedInstanceState != null) { + mPackageToDelete = savedInstanceState.getString("package_delete"); + } + mProfileManager = ProfileManager.getInstance(getActivity()); addPreferencesFromResource(R.xml.application_list); @@ -319,4 +323,10 @@ public class AppGroupConfig extends SettingsPreferenceFragment mNotificationGroup.removePackage(mPackageToDelete); updatePackages(); } -} + + @Override + public void onSaveInstanceState(Bundle in) { + super.onSaveInstanceState(in); + in.putString("package_delete", mPackageToDelete); + } +} \ No newline at end of file -- cgit v1.1