diff --git a/core/java/android/service/notification/ZenModeConfig.java b/core/java/android/service/notification/ZenModeConfig.java index 14e947ce328b7..dc8f3ea65c3cf 100644 --- a/core/java/android/service/notification/ZenModeConfig.java +++ b/core/java/android/service/notification/ZenModeConfig.java @@ -62,7 +62,7 @@ public class ZenModeConfig implements Parcelable { Calendar.WEDNESDAY, Calendar.THURSDAY }; public static final int[] WEEKEND_DAYS = { Calendar.FRIDAY, Calendar.SATURDAY }; - public static final int[] MINUTE_BUCKETS = new int[] { 15, 30, 45, 60, 120, 180, 240, 480 }; + public static final int[] MINUTE_BUCKETS = generateMinuteBuckets(); private static final int SECONDS_MS = 1000; private static final int MINUTES_MS = 60 * SECONDS_MS; private static final int ZERO_VALUE_MS = 10 * SECONDS_MS; @@ -201,6 +201,18 @@ public class ZenModeConfig implements Parcelable { } } + private static int[] generateMinuteBuckets() { + final int maxHrs = 12; + final int[] buckets = new int[maxHrs + 3]; + buckets[0] = 15; + buckets[1] = 30; + buckets[2] = 45; + for (int i = 1; i <= maxHrs; i++) { + buckets[2 + i] = 60 * i; + } + return buckets; + } + public static String sourceToString(int source) { switch (source) { case SOURCE_ANYONE: @@ -298,10 +310,10 @@ public class ZenModeConfig implements Parcelable { throw new IndexOutOfBoundsException("bad source in config:" + rt.allowFrom); } } else if (MANUAL_TAG.equals(tag)) { - rt.manualRule = readRuleXml(parser); + rt.manualRule = readRuleXml(parser, false /*conditionRequired*/); } else if (AUTOMATIC_TAG.equals(tag)) { final String id = parser.getAttributeValue(null, RULE_ATT_ID); - final ZenRule automaticRule = readRuleXml(parser); + final ZenRule automaticRule = readRuleXml(parser, true /*conditionRequired*/); if (id != null && automaticRule != null) { rt.automaticRules.put(id, automaticRule); } @@ -341,7 +353,7 @@ public class ZenModeConfig implements Parcelable { out.endTag(null, ZEN_TAG); } - public static ZenRule readRuleXml(XmlPullParser parser) { + public static ZenRule readRuleXml(XmlPullParser parser, boolean conditionRequired) { final ZenRule rt = new ZenRule(); rt.enabled = safeBoolean(parser, RULE_ATT_ENABLED, true); rt.snoozing = safeBoolean(parser, RULE_ATT_SNOOZING, false); @@ -355,7 +367,7 @@ public class ZenModeConfig implements Parcelable { rt.conditionId = safeUri(parser, RULE_ATT_CONDITION_ID); rt.component = safeComponentName(parser, RULE_ATT_COMPONENT); rt.condition = readConditionXml(parser); - return rt.condition != null ? rt : null; + return rt.condition != null || !conditionRequired ? rt : null; } public static void writeRuleXml(ZenRule rule, XmlSerializer out) throws IOException { diff --git a/media/java/android/media/AudioManagerInternal.java b/media/java/android/media/AudioManagerInternal.java index abb4257668b99..a7219231b5e54 100644 --- a/media/java/android/media/AudioManagerInternal.java +++ b/media/java/android/media/AudioManagerInternal.java @@ -51,5 +51,7 @@ public abstract class AudioManagerInternal { /** Called when internal ringer mode is evaluated, returns the new external ringer mode */ int onSetRingerModeInternal(int ringerModeOld, int ringerModeNew, String caller, int ringerModeExternal, VolumePolicy policy); + + boolean canVolumeDownEnterSilent(); } } diff --git a/packages/SystemUI/res/layout/qs_detail.xml b/packages/SystemUI/res/layout/qs_detail.xml index 2eb99ba67066a..ddff0f031fb66 100644 --- a/packages/SystemUI/res/layout/qs_detail.xml +++ b/packages/SystemUI/res/layout/qs_detail.xml @@ -18,7 +18,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/qs_detail_background" - android:paddingBottom="16dp" + android:paddingBottom="8dp" android:orientation="vertical"> + android:textAppearance="@style/TextAppearance.QS.SegmentedButton" + android:minHeight="64dp" /> diff --git a/packages/SystemUI/res/layout/volume_dialog.xml b/packages/SystemUI/res/layout/volume_dialog.xml index c86e9dc71265e..0ed1e2ac4cdbb 100644 --- a/packages/SystemUI/res/layout/volume_dialog.xml +++ b/packages/SystemUI/res/layout/volume_dialog.xml @@ -21,40 +21,31 @@ android:layout_marginBottom="4dp" android:layout_marginLeft="@dimen/notification_side_padding" android:layout_marginRight="@dimen/notification_side_padding" - android:layout_marginTop="4dp" android:background="@drawable/volume_dialog_background" android:translationZ="4dp" > + android:src="@drawable/ic_volume_collapse_animation" + tools:ignore="RtlHardcoded" /> + android:paddingBottom="8dp" + android:paddingTop="8dp" > - - - - - - + \ No newline at end of file diff --git a/packages/SystemUI/res/layout/volume_dialog_row.xml b/packages/SystemUI/res/layout/volume_dialog_row.xml index b51aa962c485d..53ae61bca438f 100644 --- a/packages/SystemUI/res/layout/volume_dialog_row.xml +++ b/packages/SystemUI/res/layout/volume_dialog_row.xml @@ -16,16 +16,15 @@ + android:clipChildren="false" + android:paddingEnd="8dp" + android:paddingStart="8dp" > diff --git a/packages/SystemUI/res/layout/volume_text_footer.xml b/packages/SystemUI/res/layout/volume_text_footer.xml deleted file mode 100644 index 7436488da6800..0000000000000 --- a/packages/SystemUI/res/layout/volume_text_footer.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - -