Remove ZEN notification visibility settings

Bug: 15286335
Change-Id: I927948458cfa4cddb8ebffda2f4c81fa003f8004
This commit is contained in:
Christoph Studer
2014-06-24 18:23:29 +02:00
parent 96debb5c96
commit 672e6ed50c
3 changed files with 0 additions and 50 deletions

View File

@@ -5193,15 +5193,6 @@
[CHAR LIMIT=50] -->
<string name="lock_screen_notifications_summary_disable">Don\'t show notifications at all</string>
<!-- Sound & notifications > Showing notifications: Title for the option managing notification display in zen mode. [CHAR LIMIT=30] -->
<string name="zen_mode_notifications_title">When do not disturb is on</string>
<!-- Sound & notifications > Showing notifications: Value for zen mode notifications: notifications will be suppressed in zen mode [CHAR LIMIT=50] -->
<string name="zen_mode_notifications_summary_hide">Hide new notifications from the list</string>
<!-- Sound & notifications > Showing notifications: Value for zen mode notifications: notifications will be displayed in zen mode [CHAR LIMIT=50] -->
<string name="zen_mode_notifications_summary_show">Show all notifications in the list</string>
<!-- Sound & notifications > Showing notifications: Title for the option managing notifications per application. [CHAR LIMIT=30] -->
<string name="app_notifications_title">App notifications</string>

View File

@@ -33,12 +33,6 @@
android:title="@string/lock_screen_notifications_title"
android:persistent="false" />
<!-- When do not disturb is on -->
<com.android.settings.notification.DropDownPreference
android:key="zen_mode_notifications"
android:title="@string/zen_mode_notifications_title"
android:persistent="false" />
<!-- App notifications -->
<PreferenceScreen
android:key="app_notifications"

View File

@@ -36,14 +36,12 @@ public class NotificationDisplaySettings extends SettingsPreferenceFragment {
private static final String KEY_NOTIFICATION_PULSE = "notification_pulse";
private static final String KEY_LOCK_SCREEN_NOTIFICATIONS = "lock_screen_notifications";
private static final String KEY_ZEN_MODE_NOTIFICATIONS = "zen_mode_notifications";
private final Handler mHandler = new Handler();
private final SettingsObserver mSettingsObserver = new SettingsObserver();
private TwoStatePreference mNotificationPulse;
private DropDownPreference mLockscreen;
private DropDownPreference mZenModeNotifications;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -54,7 +52,6 @@ public class NotificationDisplaySettings extends SettingsPreferenceFragment {
final PreferenceScreen root = getPreferenceScreen();
initPulse(root);
initLockscreenNotifications(root);
initZenModeNotifications(root);
}
@Override
@@ -148,32 +145,6 @@ public class NotificationDisplaySettings extends SettingsPreferenceFragment {
Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, 0) != 0;
}
// === Zen mode notifications ===
private void initZenModeNotifications(PreferenceScreen parent) {
mZenModeNotifications = (DropDownPreference)
parent.findPreference(KEY_ZEN_MODE_NOTIFICATIONS);
if (mZenModeNotifications == null) return;
mZenModeNotifications.addItem(R.string.zen_mode_notifications_summary_hide, 0);
mZenModeNotifications.addItem(R.string.zen_mode_notifications_summary_show, 1);
updateZenModeNotifications();
mZenModeNotifications.setCallback(new DropDownPreference.Callback() {
@Override
public boolean onItemSelected(int pos, Object value) {
final int val = (Integer) value;
Settings.Secure.putInt(getContentResolver(),
Settings.Secure.DISPLAY_INTERCEPTED_NOTIFICATIONS, val);
return true;
}
});
}
private void updateZenModeNotifications() {
if (mZenModeNotifications == null) return;
mZenModeNotifications.setSelectedValue(Settings.Secure.getInt(getContentResolver(),
Settings.Secure.DISPLAY_INTERCEPTED_NOTIFICATIONS, 0));
}
// === Callbacks ===
private final class SettingsObserver extends ContentObserver {
@@ -183,8 +154,6 @@ public class NotificationDisplaySettings extends SettingsPreferenceFragment {
Settings.Secure.getUriFor(Settings.Secure.LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS);
private final Uri LOCK_SCREEN_SHOW_URI =
Settings.Global.getUriFor(Settings.Global.LOCK_SCREEN_SHOW_NOTIFICATIONS);
private final Uri DISPLAY_INTERCEPTED_NOTIFICATIONS_URI =
Settings.Secure.getUriFor(Settings.Secure.DISPLAY_INTERCEPTED_NOTIFICATIONS);
public SettingsObserver() {
super(mHandler);
@@ -196,7 +165,6 @@ public class NotificationDisplaySettings extends SettingsPreferenceFragment {
cr.registerContentObserver(NOTIFICATION_LIGHT_PULSE_URI, false, this);
cr.registerContentObserver(LOCK_SCREEN_PRIVATE_URI, false, this);
cr.registerContentObserver(LOCK_SCREEN_SHOW_URI, false, this);
cr.registerContentObserver(DISPLAY_INTERCEPTED_NOTIFICATIONS_URI, false, this);
} else {
cr.unregisterContentObserver(this);
}
@@ -211,9 +179,6 @@ public class NotificationDisplaySettings extends SettingsPreferenceFragment {
if (LOCK_SCREEN_PRIVATE_URI.equals(uri) || LOCK_SCREEN_SHOW_URI.equals(uri)) {
updateLockscreenNotifications();
}
if (DISPLAY_INTERCEPTED_NOTIFICATIONS_URI.equals(uri)) {
updateZenModeNotifications();
}
}
}
}