From: Chris Wren Date: Thu, 4 Sep 2014 13:40:04 +0000 (+0000) Subject: Merge "Implement per-app sensitivity settings toggle." into lmp-dev X-Git-Tag: android-x86-6.0-r1~860^2~438^2~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=77fdc93b;p=android-x86%2Fpackages-apps-Settings.git Merge "Implement per-app sensitivity settings toggle." into lmp-dev --- 77fdc93bcdb3ae60fe617012c6c52aa274ed331e diff --cc src/com/android/settings/notification/AppNotificationSettings.java index 050008de0a,09271bfc31..1dd3bdca79 --- a/src/com/android/settings/notification/AppNotificationSettings.java +++ b/src/com/android/settings/notification/AppNotificationSettings.java @@@ -185,14 -186,18 +187,24 @@@ public class AppNotificationSettings ex } }); } + + // Users cannot block notifications from system/signature packages + if (Utils.isSystemPackage(pm, info)) { + getPreferenceScreen().removePreference(mBlock); + mPriority.setDependency(null); // don't have it depend on a preference that's gone + } } + private boolean getLockscreenNotificationsEnabled() { + return Settings.Secure.getInt(getContentResolver(), + Settings.Secure.LOCK_SCREEN_SHOW_NOTIFICATIONS, 0) != 0; + } + + private boolean getLockscreenAllowPrivateNotifications() { + return Settings.Secure.getInt(getContentResolver(), + Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 0) != 0; + } + private void toastAndFinish() { Toast.makeText(mContext, R.string.app_not_found_dlg_text, Toast.LENGTH_SHORT).show(); getActivity().finish();