Zen: New behavior for built-in downtime + nextalarm conditions.

 - Downtime: Allow user to enter downtime early, offer as an end
   condition four hours before downtime starts.  Available in
   either none or priority, regardless of settings configuration.
 - Downtime: Always exit before next alarm if zen=none.
 - Downtime: Make more like any other condition provider, remove
   special status (mostly).
 - Downtime: New auto-triggering rules, allow triggering after a
   manual condition ends, once.
 - Decouple NextAlarm + Downtime providers, allow them to offer
   their conditions at the same time.
 - Downtime/NextAlarm: Update conditions if they change while being
   requested, even if unsubscribed.
 - Make all three built-in condition providers optional, via config.
 - New internal helper for runtime config.
 - Don't follow changes to next alarm, consider the condition false.
 - Isolate downtime calendar logic into separate class (for testing).
 - Allow a:bb -> a:bb as a valid downtime range (all day).
 - Volume dialog: configuration establishes maximum number of visible
   conditions, including built-ins.
 - Zen mode panel: avoid widget updates during layout transition.
 - Zen mode panel: move controller callers to background thread.
 - Zen mode panel: hide/show/rebind rows instead of adding/removing.
 - ZenLog: Add downtime autotrigger results.
 - Volume panel: Smarter refresh on ringer/zen changes.

Bug: 16373455

Change-Id: I4f801018ddb0beb6eb9fa03a81c79f7949888a3f
diff --git a/services/core/java/com/android/server/notification/PropConfig.java b/services/core/java/com/android/server/notification/PropConfig.java
new file mode 100644
index 0000000..97bf90d
--- /dev/null
+++ b/services/core/java/com/android/server/notification/PropConfig.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2014 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.server.notification;
+
+import android.content.Context;
+import android.os.SystemProperties;
+
+public class PropConfig {
+    private static final String UNSET = "UNSET";
+
+    public static int getInt(Context context, String propName, int resId) {
+        return SystemProperties.getInt(propName, context.getResources().getInteger(resId));
+    }
+
+    public static String[] getStringArray(Context context, String propName, int resId) {
+        final String prop = SystemProperties.get(propName, UNSET);
+        return !UNSET.equals(prop) ? prop.split(",") : context.getResources().getStringArray(resId);
+    }
+}