summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorJohn Spurlock <jspurlock@google.com>2015-06-21 14:52:48 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-21 14:52:50 +0000
commit3953b5a1f935369b016894ed9e8cbb387fb17338 (patch)
treea6c524edd0ad93f110d9b888b16d2becf16a50c6 /packages/SystemUI
parent3ac465a7d830a973096b4f69ef4531f09dcdf07c (diff)
parentcbd7a31a4440eea6d1f648a9e54e55677547ab7b (diff)
downloadframeworks_base-3953b5a1f935369b016894ed9e8cbb387fb17338.zip
frameworks_base-3953b5a1f935369b016894ed9e8cbb387fb17338.tar.gz
frameworks_base-3953b5a1f935369b016894ed9e8cbb387fb17338.tar.bz2
Merge "Zen: Tweak total silence new user message for non-voice devices." into mnc-dev
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/res/values/strings.xml7
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/Util.java7
-rw-r--r--packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java4
3 files changed, 16 insertions, 2 deletions
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index e2a318a..d32ce55 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -755,8 +755,11 @@
<!-- Zen mode: Priority only customization button label -->
<string name="zen_priority_customize_button">Customize</string>
- <!-- Zen mode: Total silence introduction message on first use -->
- <string name="zen_silence_introduction">This blocks ALL sounds and vibrations, including from alarms, music, videos, and games. You’ll still be able to make phone calls.</string>
+ <!-- Zen mode: Total silence introduction message on first use (voice capable devices) -->
+ <string name="zen_silence_introduction_voice">This blocks ALL sounds and vibrations, including from alarms, music, videos, and games. You’ll still be able to make phone calls.</string>
+
+ <!-- Zen mode: Total silence introduction message on first use (non-voice capable devices) -->
+ <string name="zen_silence_introduction">This blocks ALL sounds and vibrations, including from alarms, music, videos, and games.</string>
<!-- Text for overflow card on Keyguard when there is not enough space for all notifications on Keyguard. [CHAR LIMIT=1] -->
<string name="keyguard_more_overflow_text">+<xliff:g id="number_of_notifications" example="5">%d</xliff:g></string>
diff --git a/packages/SystemUI/src/com/android/systemui/volume/Util.java b/packages/SystemUI/src/com/android/systemui/volume/Util.java
index 4214091..a46a44d 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/Util.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/Util.java
@@ -16,11 +16,13 @@
package com.android.systemui.volume;
+import android.content.Context;
import android.media.AudioManager;
import android.media.MediaMetadata;
import android.media.VolumeProvider;
import android.media.session.MediaController.PlaybackInfo;
import android.media.session.PlaybackState;
+import android.telephony.TelephonyManager;
import android.view.View;
import android.widget.TextView;
@@ -164,4 +166,9 @@ class Util {
v.setVisibility(vis ? View.VISIBLE : View.INVISIBLE);
}
+ public static boolean isVoiceCapable(Context context) {
+ final TelephonyManager telephony =
+ (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
+ return telephony != null && telephony.isVoiceCapable();
+ }
}
diff --git a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
index a0eb61f..8035cd3 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java
@@ -118,6 +118,7 @@ public class ZenModePanel extends LinearLayout {
private Condition mSessionExitCondition;
private Condition[] mConditions;
private Condition mTimeCondition;
+ private boolean mVoiceCapable;
public ZenModePanel(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -127,6 +128,7 @@ public class ZenModePanel extends LinearLayout {
mIconPulser = new IconPulser(mContext);
mForeverId = Condition.newId(mContext).appendPath("forever").build();
mSpTexts = new SpTexts(mContext);
+ mVoiceCapable = Util.isVoiceCapable(mContext);
if (DEBUG) Log.d(mTag, "new ZenModePanel");
}
@@ -144,6 +146,7 @@ public class ZenModePanel extends LinearLayout {
pw.println(mPrefs.mConfirmedPriorityIntroduction);
pw.print(" mConfirmedSilenceIntroduction=");
pw.println(mPrefs.mConfirmedSilenceIntroduction);
+ pw.print(" mVoiceCapable="); pw.println(mVoiceCapable);
mTransitionHelper.dump(fd, pw, args);
}
@@ -444,6 +447,7 @@ public class ZenModePanel extends LinearLayout {
mZenIntroduction.setVisibility(introduction ? VISIBLE : GONE);
if (introduction) {
mZenIntroductionMessage.setText(zenImportant ? R.string.zen_priority_introduction
+ : mVoiceCapable ? R.string.zen_silence_introduction_voice
: R.string.zen_silence_introduction);
mZenIntroductionCustomize.setVisibility(zenImportant ? VISIBLE : GONE);
}