欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Android修改系统闹铃的持续时间 博客分类: Android android

程序员文章站 2024-03-02 11:56:28
...
直接上Patch
--- AlarmKlaxon.java.bk	2012-08-28 10:50:19.737235871 +0800
+++ AlarmKlaxon.java	2012-08-28 10:50:12.167235883 +0800
@@ -49,7 +49,7 @@
  */
 public class AlarmKlaxon extends Service {
     // Default of 10 minutes until alarm is silenced.
-    private static final String DEFAULT_ALARM_TIMEOUT = "10";
+    private static final String DEFAULT_ALARM_TIMEOUT = "1";
     /* Retry to play rintone after 1 seconds if power off alarm can not find external resource. */
     private static final int MOUNT_TIMEOUT_SECONDS = 1;


--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -198,6 +198,7 @@
          preference. -->
     <string-array name="auto_silence_entries">
       <item>Off</item>
+      <item>1 minutes</item>
       <item>5 minutes</item>
       <item>10 minutes</item>
       <item>15 minutes</item>
@@ -210,6 +211,7 @@
          the auto_silence_entries above. -->
     <string-array name="auto_silence_values" translatable="false">
       <item>-1</item> <!-- Off -->
+      <item>1</item>
       <item>5</item>
       <item>10</item>
       <item>15</item>
diff --git a/res/xml/settings.xml b/res/xml/settings.xml
index df85055..14eac94 100644
--- a/res/xml/settings.xml
+++ b/res/xml/settings.xml
@@ -35,7 +35,7 @@
         android:title="@string/snooze_duration_title"
         android:entries="@array/snooze_duration_entries"
         android:entryValues="@array/snooze_duration_values"
-        android:defaultValue="10"
+        android:defaultValue="5"
         android:dialogTitle="@string/snooze_duration_title" />

     <ListPreference
@@ -43,7 +43,7 @@
         android:title="@string/auto_silence_title"
         android:entries="@array/auto_silence_entries"
         android:entryValues="@array/auto_silence_values"
-        android:defaultValue="10"
+        android:defaultValue="1"
         android:dialogTitle="@string/auto_silence_title" />

     <ListPreference
相关标签: android