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

Commit 9295c136 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/21091394',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/21091394', 'googleplex-android-review.googlesource.com/21116839'] into tm-qpr2-release.

Change-Id: I3a1a2ca5006b81b4c3bef31af915be727da22db6
parents cbd27dc9 cbcb3ba0
Loading
Loading
Loading
Loading
+7 −15
Original line number Diff line number Diff line
@@ -16,9 +16,7 @@

package android.preference;

import android.Manifest;
import android.annotation.NonNull;
import android.annotation.RequiresPermission;
import android.app.NotificationManager;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.BroadcastReceiver;
@@ -37,7 +35,6 @@ import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import android.preference.VolumePreference.VolumeStore;
import android.provider.DeviceConfig;
import android.provider.Settings;
import android.provider.Settings.Global;
import android.provider.Settings.System;
@@ -47,7 +44,6 @@ import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;

import com.android.internal.annotations.GuardedBy;
import com.android.internal.config.sysui.SystemUiDeviceConfigFlags;
import com.android.internal.os.SomeArgs;

import java.util.concurrent.TimeUnit;
@@ -119,6 +115,7 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
    private final int mMaxStreamVolume;
    private boolean mAffectedByRingerMode;
    private boolean mNotificationOrRing;
    private final boolean mNotifAliasRing;
    private final Receiver mReceiver = new Receiver();

    private Handler mHandler;
@@ -161,7 +158,6 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
        this(context, streamType, defaultUri, callback, true /* playSample */);
    }

    @RequiresPermission(Manifest.permission.READ_DEVICE_CONFIG)
    public SeekBarVolumizer(
            Context context,
            int streamType,
@@ -184,6 +180,8 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
        if (mNotificationOrRing) {
            mRingerMode = mAudioManager.getRingerModeInternal();
        }
        mNotifAliasRing = mContext.getResources().getBoolean(
                com.android.internal.R.bool.config_alias_ring_notif_stream_types);
        mZenMode = mNotificationManager.getZenMode();

        if (hasAudioProductStrategies()) {
@@ -290,9 +288,7 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
             * so that when user attempts to slide the notification seekbar out of vibrate the
             * seekbar doesn't wrongly snap back to 0 when the streams aren't aliased
             */
            if (!DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
                    SystemUiDeviceConfigFlags.VOLUME_SEPARATE_NOTIFICATION, false)
                    || mStreamType == AudioManager.STREAM_RING
            if (mNotifAliasRing || mStreamType == AudioManager.STREAM_RING
                    || (mStreamType == AudioManager.STREAM_NOTIFICATION && mMuted)) {
                mSeekBar.setProgress(0, true);
            }
@@ -369,9 +365,7 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
        // set the time of stop volume
        if ((mStreamType == AudioManager.STREAM_VOICE_CALL
                || mStreamType == AudioManager.STREAM_RING
                || (DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
                SystemUiDeviceConfigFlags.VOLUME_SEPARATE_NOTIFICATION, false)
                && mStreamType == AudioManager.STREAM_NOTIFICATION)
                || (!mNotifAliasRing && mStreamType == AudioManager.STREAM_NOTIFICATION)
                || mStreamType == AudioManager.STREAM_ALARM)) {
            sStopVolumeTime = java.lang.System.currentTimeMillis();
        }
@@ -649,10 +643,8 @@ public class SeekBarVolumizer implements OnSeekBarChangeListener, Handler.Callba
        }

        private void updateVolumeSlider(int streamType, int streamValue) {
            final boolean streamMatch =  !DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_SYSTEMUI,
                    SystemUiDeviceConfigFlags.VOLUME_SEPARATE_NOTIFICATION, false)
                    && mNotificationOrRing ? isNotificationOrRing(streamType) :
                    streamType == mStreamType;
            final boolean streamMatch = mNotifAliasRing && mNotificationOrRing
                    ? isNotificationOrRing(streamType) : streamType == mStreamType;
            if (mSeekBar != null && streamMatch && streamValue != -1) {
                final boolean muted = mAudioManager.isStreamMute(mStreamType)
                        || streamValue == 0;
+0 −5
Original line number Diff line number Diff line
@@ -561,11 +561,6 @@ public final class SystemUiDeviceConfigFlags {
    public static final String TASK_MANAGER_SHOW_USER_VISIBLE_JOBS =
            "task_manager_show_user_visible_jobs";

    /**
     * (boolean) Whether to show notification volume control slider separate from ring.
     */
    public static final String VOLUME_SEPARATE_NOTIFICATION = "volume_separate_notification";

    /**
     * (boolean) Whether the clipboard overlay is enabled.
     */
+4 −0
Original line number Diff line number Diff line
@@ -2074,6 +2074,10 @@
         STREAM_MUSIC as if it's on TV platform. -->
    <bool name="config_single_volume">false</bool>

    <!-- Flag indicating whether notification and ringtone volumes
         are controlled together (aliasing is true) or not. -->
    <bool name="config_alias_ring_notif_stream_types">true</bool>

    <!-- The number of volume steps for the notification stream -->
    <integer name="config_audio_notif_vol_steps">7</integer>

+1 −0
Original line number Diff line number Diff line
@@ -278,6 +278,7 @@
  <java-symbol type="attr" name="autofillSaveCustomSubtitleMaxHeight"/>
  <java-symbol type="bool" name="action_bar_embed_tabs" />
  <java-symbol type="bool" name="action_bar_expanded_action_views_exclusive" />
  <java-symbol type="bool" name="config_alias_ring_notif_stream_types" />
  <java-symbol type="integer" name="config_audio_notif_vol_default" />
  <java-symbol type="integer" name="config_audio_notif_vol_steps" />
  <java-symbol type="integer" name="config_audio_ring_vol_default" />
+0 −26
Original line number Diff line number Diff line
<!--
    Copyright (C) 2022 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24"
    android:tint="?android:attr/colorControlNormal">
  <path
      android:pathData="M11,7V2H13V7ZM17.6,9.85 L16.2,8.4 19.75,4.85 21.15,6.3ZM6.4,9.85 L2.85,6.3 4.25,4.85 7.8,8.4ZM12,12Q14.95,12 17.812,13.188Q20.675,14.375 22.9,16.75Q23.2,17.05 23.2,17.45Q23.2,17.85 22.9,18.15L20.6,20.4Q20.325,20.675 19.963,20.7Q19.6,20.725 19.3,20.5L16.4,18.3Q16.2,18.15 16.1,17.95Q16,17.75 16,17.5V14.65Q15.05,14.35 14.05,14.175Q13.05,14 12,14Q10.95,14 9.95,14.175Q8.95,14.35 8,14.65V17.5Q8,17.75 7.9,17.95Q7.8,18.15 7.6,18.3L4.7,20.5Q4.4,20.725 4.038,20.7Q3.675,20.675 3.4,20.4L1.1,18.15Q0.8,17.85 0.8,17.45Q0.8,17.05 1.1,16.75Q3.3,14.375 6.175,13.188Q9.05,12 12,12ZM6,15.35Q5.275,15.725 4.6,16.212Q3.925,16.7 3.2,17.3L4.2,18.3L6,16.9ZM18,15.4V16.9L19.8,18.3L20.8,17.35Q20.075,16.7 19.4,16.225Q18.725,15.75 18,15.4ZM6,15.35Q6,15.35 6,15.35Q6,15.35 6,15.35ZM18,15.4Q18,15.4 18,15.4Q18,15.4 18,15.4Z"
      android:fillColor="?android:attr/colorPrimary"/>

</vector>
 No newline at end of file
Loading