diff options
author | Adnan Begovic <adnan@cyngn.com> | 2016-05-20 12:28:25 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-06-15 12:47:11 -0700 |
commit | be7d45fd0d063cff25f186a7ca45fa485ebdf048 (patch) | |
tree | 74f7e24d84b489452a95d18eb37589a9cc2e59f9 /src | |
parent | 6c6d0e68be18a61d20ead5a01297425839118f8c (diff) | |
download | packages_apps_Settings-be7d45fd0d063cff25f186a7ca45fa485ebdf048.zip packages_apps_Settings-be7d45fd0d063cff25f186a7ca45fa485ebdf048.tar.gz packages_apps_Settings-be7d45fd0d063cff25f186a7ca45fa485ebdf048.tar.bz2 |
Settings: Dissallow privacy guarding system apps on overlay.
Bandaid fix for google play services inundating the permission
dialog request queue within AppOps service and causing watchdog
to consistently kill the system server's activity manager service
which is deadlocked retrieving dialogs from the queue.
Change-Id: I10c432cebe6a4199517839598046eee7d19dcf72
TICKET: CYNGNOS-2869
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/applications/AppOpsSummary.java | 10 | ||||
-rw-r--r-- | src/com/android/settings/privacyguard/PrivacyGuardManager.java | 11 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/com/android/settings/applications/AppOpsSummary.java b/src/com/android/settings/applications/AppOpsSummary.java index be153de..31641e2 100644 --- a/src/com/android/settings/applications/AppOpsSummary.java +++ b/src/com/android/settings/applications/AppOpsSummary.java @@ -26,6 +26,7 @@ import android.content.Context; import android.content.DialogInterface; import android.content.res.Resources; import android.content.SharedPreferences; +import android.os.Build; import android.os.Bundle; import android.preference.PreferenceFrameLayout; import android.support.v13.app.FragmentPagerAdapter; @@ -186,7 +187,8 @@ public class AppOpsSummary extends InstrumentedFragment { } private boolean shouldShowSystemApps() { - return mPreferences.getBoolean("show_system_apps", true); + return mPreferences.getBoolean("show_system_apps", true) && + mActivity.getResources().getBoolean(R.bool.config_showBuiltInAppsForPG); } @Override @@ -204,7 +206,11 @@ public class AppOpsSummary extends InstrumentedFragment { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.appops_manager, menu); menu.findItem(R.id.show_user_apps).setChecked(shouldShowUserApps()); - menu.findItem(R.id.show_system_apps).setChecked(shouldShowSystemApps()); + if (!mActivity.getResources().getBoolean(R.bool.config_showBuiltInAppsForPG)) { + menu.removeItem(R.id.show_system_apps); + } else { + menu.findItem(R.id.show_system_apps).setChecked(shouldShowSystemApps()); + } } private void resetCounters() { diff --git a/src/com/android/settings/privacyguard/PrivacyGuardManager.java b/src/com/android/settings/privacyguard/PrivacyGuardManager.java index adbe8cc..c2f485a 100644 --- a/src/com/android/settings/privacyguard/PrivacyGuardManager.java +++ b/src/com/android/settings/privacyguard/PrivacyGuardManager.java @@ -17,6 +17,7 @@ package com.android.settings.privacyguard; import android.app.FragmentTransaction; +import android.os.Build; import android.view.animation.AnimationUtils; import android.app.Activity; import android.app.AlertDialog; @@ -297,9 +298,9 @@ public class PrivacyGuardManager extends Fragment return true; } - private boolean shouldShowSystemApps() { - return mPreferences.getBoolean("show_system_apps", false); + return mPreferences.getBoolean("show_system_apps", true) && + mActivity.getResources().getBoolean(R.bool.config_showBuiltInAppsForPG); } public static class HelpDialogFragment extends DialogFragment { @@ -372,7 +373,11 @@ public class PrivacyGuardManager extends Fragment public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.privacy_guard_manager, menu); - menu.findItem(R.id.show_system_apps).setChecked(shouldShowSystemApps()); + if (!mActivity.getResources().getBoolean(R.bool.config_showBuiltInAppsForPG)) { + menu.removeItem(R.id.show_system_apps); + } else { + menu.findItem(R.id.show_system_apps).setChecked(shouldShowSystemApps()); + } } @Override |