Loading packages/SystemUI/aconfig/systemui.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -1558,6 +1558,16 @@ flag { } } flag { name: "hide_ringer_button_in_single_volume_mode" namespace: "systemui" description: "When the device is in single volume mode, hide the ringer button because it doesn't work" bug: "374870615" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "qs_tile_detailed_view" namespace: "systemui" Loading packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +31 −2 Original line number Diff line number Diff line Loading @@ -64,6 +64,8 @@ import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.RotateDrawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.RoundRectShape; import android.media.AudioManager; import android.media.AudioSystem; import android.os.Debug; Loading Loading @@ -115,6 +117,7 @@ import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.view.RotationPolicy; import com.android.settingslib.Utils; import com.android.systemui.Dumpable; import com.android.systemui.Flags; import com.android.systemui.Prefs; import com.android.systemui.dump.DumpManager; import com.android.systemui.haptics.slider.HapticSliderViewBinder; Loading Loading @@ -656,6 +659,11 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable, mRingerIcon = mRinger.findViewById(R.id.ringer_icon); } if (Flags.hideRingerButtonInSingleVolumeMode() && AudioSystem.isSingleVolume(mContext)) { mRingerAndDrawerContainer.setVisibility(INVISIBLE); mRinger.setVisibility(INVISIBLE); } mSelectedRingerIcon = mDialog.findViewById(R.id.volume_new_ringer_active_icon); mSelectedRingerContainer = mDialog.findViewById( R.id.volume_new_ringer_active_icon_container); Loading Loading @@ -2341,10 +2349,31 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable, return; } LayerDrawable background; // mRingerAndDrawerContainer has rounded corner. // But when it's not visible, mTopContainer needs to have rounded corner. if (Flags.hideRingerButtonInSingleVolumeMode() && mRingerAndDrawerContainer.getVisibility() != VISIBLE ) { float[] radius = new float[] { mDialogCornerRadius, mDialogCornerRadius, // Top-left corner mDialogCornerRadius, mDialogCornerRadius, // Top-right corner 0, 0, // Bottom-right corner 0, 0 // Bottom-left corner }; ShapeDrawable roundedDrawable = new ShapeDrawable( new RoundRectShape(radius, null, null)); roundedDrawable.getPaint().setColor(Utils.getColorAttrDefaultColor( mContext, com.android.internal.R.attr.colorSurface)); background = new LayerDrawable(new Drawable[] { roundedDrawable }); } else { final ColorDrawable solidDrawable = new ColorDrawable( Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.colorSurface)); final LayerDrawable background = new LayerDrawable(new Drawable[] { solidDrawable }); background = new LayerDrawable(new Drawable[] { solidDrawable }); } // Size the solid color to match the primary volume row. In landscape, extend it upwards // slightly so that it fills in the bottom corners of the ringer icon, whose background is Loading Loading
packages/SystemUI/aconfig/systemui.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -1558,6 +1558,16 @@ flag { } } flag { name: "hide_ringer_button_in_single_volume_mode" namespace: "systemui" description: "When the device is in single volume mode, hide the ringer button because it doesn't work" bug: "374870615" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "qs_tile_detailed_view" namespace: "systemui" Loading
packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +31 −2 Original line number Diff line number Diff line Loading @@ -64,6 +64,8 @@ import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.graphics.drawable.LayerDrawable; import android.graphics.drawable.RotateDrawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.RoundRectShape; import android.media.AudioManager; import android.media.AudioSystem; import android.os.Debug; Loading Loading @@ -115,6 +117,7 @@ import com.android.internal.jank.InteractionJankMonitor; import com.android.internal.view.RotationPolicy; import com.android.settingslib.Utils; import com.android.systemui.Dumpable; import com.android.systemui.Flags; import com.android.systemui.Prefs; import com.android.systemui.dump.DumpManager; import com.android.systemui.haptics.slider.HapticSliderViewBinder; Loading Loading @@ -656,6 +659,11 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable, mRingerIcon = mRinger.findViewById(R.id.ringer_icon); } if (Flags.hideRingerButtonInSingleVolumeMode() && AudioSystem.isSingleVolume(mContext)) { mRingerAndDrawerContainer.setVisibility(INVISIBLE); mRinger.setVisibility(INVISIBLE); } mSelectedRingerIcon = mDialog.findViewById(R.id.volume_new_ringer_active_icon); mSelectedRingerContainer = mDialog.findViewById( R.id.volume_new_ringer_active_icon_container); Loading Loading @@ -2341,10 +2349,31 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable, return; } LayerDrawable background; // mRingerAndDrawerContainer has rounded corner. // But when it's not visible, mTopContainer needs to have rounded corner. if (Flags.hideRingerButtonInSingleVolumeMode() && mRingerAndDrawerContainer.getVisibility() != VISIBLE ) { float[] radius = new float[] { mDialogCornerRadius, mDialogCornerRadius, // Top-left corner mDialogCornerRadius, mDialogCornerRadius, // Top-right corner 0, 0, // Bottom-right corner 0, 0 // Bottom-left corner }; ShapeDrawable roundedDrawable = new ShapeDrawable( new RoundRectShape(radius, null, null)); roundedDrawable.getPaint().setColor(Utils.getColorAttrDefaultColor( mContext, com.android.internal.R.attr.colorSurface)); background = new LayerDrawable(new Drawable[] { roundedDrawable }); } else { final ColorDrawable solidDrawable = new ColorDrawable( Utils.getColorAttrDefaultColor(mContext, com.android.internal.R.attr.colorSurface)); final LayerDrawable background = new LayerDrawable(new Drawable[] { solidDrawable }); background = new LayerDrawable(new Drawable[] { solidDrawable }); } // Size the solid color to match the primary volume row. In landscape, extend it upwards // slightly so that it fills in the bottom corners of the ringer icon, whose background is Loading