Zen: Tweak total silence new user message for non-voice devices.
Bug: 21953388
Change-Id: I395af64b175b22fc58d80529cdbb12ebd9e00115
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index 47c642d..5c9f866 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -751,8 +751,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 @@
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 @@
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 @@
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 @@
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 @@
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);
}