Settings: Remove zenswitch from DND settings page.

- Remove the ability to view/modify zen mode/condition from
   the Settings app.

Bug: 20064962
Change-Id: I8757780e5e9ef578e05203577871b9f513997798
This commit is contained in:
John Spurlock
2015-05-05 07:32:31 -04:00
parent 0ab13b8326
commit beff087b3a
3 changed files with 24 additions and 131 deletions

View File

@@ -21,6 +21,7 @@ import static android.service.notification.ZenModeConfig.ALL_DAYS;
import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.ServiceInfo;
import android.content.res.Resources;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
@@ -181,7 +182,7 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase {
private String computeRuleSummary(ZenRule rule) {
if (rule == null || !rule.enabled) return getString(R.string.switch_off_text);
final String mode = ZenModeSettings.computeZenModeCaption(getResources(), rule.zenMode);
final String mode = computeZenModeCaption(getResources(), rule.zenMode);
String summary = getString(R.string.switch_on_text);
final ScheduleInfo schedule = ZenModeConfig.tryParseScheduleConditionId(rule.conditionId);
final EventInfo event = ZenModeConfig.tryParseEventConditionId(rule.conditionId);
@@ -298,6 +299,19 @@ public class ZenModeAutomationSettings extends ZenModeSettingsBase {
return c;
}
private static String computeZenModeCaption(Resources res, int zenMode) {
switch (zenMode) {
case Global.ZEN_MODE_ALARMS:
return res.getString(R.string.zen_mode_option_alarms);
case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS:
return res.getString(R.string.zen_mode_option_important_interruptions);
case Global.ZEN_MODE_NO_INTERRUPTIONS:
return res.getString(R.string.zen_mode_option_no_interruptions);
default:
return null;
}
}
private final ServiceListing.Callback mServiceListingCallback = new ServiceListing.Callback() {
@Override
public void onServicesReloaded(List<ServiceInfo> services) {