From ee846f8828f9e2988e646af85da55f3d51c02f27 Mon Sep 17 00:00:00 2001 From: Chris Wren Date: Thu, 4 Sep 2014 13:41:08 +0000 Subject: [PATCH] missing dep. Revert "Implement per-app sensitivity settings toggle." This reverts commit 56131de7412edaab9f3e5834fe3888ac8588ec79. Change-Id: I409dbf4495f95ff37d2a47168cdbc4131a80d42e --- res/xml/app_notification_settings.xml | 1 + .../notification/AppNotificationSettings.java | 14 +---------- .../notification/NotificationAppList.java | 23 ++++--------------- 3 files changed, 6 insertions(+), 32 deletions(-) diff --git a/res/xml/app_notification_settings.xml b/res/xml/app_notification_settings.xml index a65b98dbbd0..1d8ae4561a6 100644 --- a/res/xml/app_notification_settings.xml +++ b/res/xml/app_notification_settings.xml @@ -39,6 +39,7 @@ android:key="sensitive" android:title="@string/app_notification_sensitive_title" android:summary="@string/app_notification_sensitive_summary" + android:enabled="false" android:persistent="false" /> diff --git a/src/com/android/settings/notification/AppNotificationSettings.java b/src/com/android/settings/notification/AppNotificationSettings.java index 1dd3bdca793..050008de0af 100644 --- a/src/com/android/settings/notification/AppNotificationSettings.java +++ b/src/com/android/settings/notification/AppNotificationSettings.java @@ -137,9 +137,7 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { mSensitive = (SwitchPreference) findPreference(KEY_SENSITIVE); final boolean secure = new LockPatternUtils(getActivity()).isSecure(); - final boolean enabled = getLockscreenNotificationsEnabled(); - final boolean allowPrivate = getLockscreenAllowPrivateNotifications(); - if (!secure || !enabled || !allowPrivate) { + if (!secure) { getPreferenceScreen().removePreference(mSensitive); } @@ -195,16 +193,6 @@ public class AppNotificationSettings extends SettingsPreferenceFragment { } } - 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(); diff --git a/src/com/android/settings/notification/NotificationAppList.java b/src/com/android/settings/notification/NotificationAppList.java index bfed92d03a7..ad6956bd6c1 100644 --- a/src/com/android/settings/notification/NotificationAppList.java +++ b/src/com/android/settings/notification/NotificationAppList.java @@ -568,28 +568,13 @@ public class NotificationAppList extends PinnedHeaderListFragment } public boolean getSensitive(String pkg, int uid) { - INotificationManager nm = INotificationManager.Stub.asInterface( - ServiceManager.getService(Context.NOTIFICATION_SERVICE)); - try { - return nm.getPackageVisibility(pkg, uid) == Notification.VISIBILITY_PRIVATE; - } catch (Exception e) { - Log.w(TAG, "Error calling NoMan", e); - return false; - } + // TODO get visibility state from NoMan + return false; } public boolean setSensitive(String pkg, int uid, boolean sensitive) { - INotificationManager nm = INotificationManager.Stub.asInterface( - ServiceManager.getService(Context.NOTIFICATION_SERVICE)); - try { - nm.setPackageVisibility(pkg, uid, - sensitive ? Notification.VISIBILITY_PRIVATE - : Notification.VISIBILITY_NO_OVERRIDE); - return true; - } catch (Exception e) { - Log.w(TAG, "Error calling NoMan", e); - return false; - } + // TODO save visibility state to NoMan + return true; } } }