diff options
Diffstat (limited to 'packages/SystemUI/src/com')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/Util.java | 7 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/volume/ZenModePanel.java | 4 |
2 files changed, 11 insertions, 0 deletions
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); } |