Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10264b76 authored by John Spurlock's avatar John Spurlock Committed by Android Git Automerger
Browse files

am 3953b5a1: Merge "Zen: Tweak total silence new user message for non-voice devices." into mnc-dev

* commit '3953b5a1':
  Zen: Tweak total silence new user message for non-voice devices.
parents eea83944 3953b5a1
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -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>
+7 −0
Original line number Diff line number Diff line
@@ -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();
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -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);
        }