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

Commit 452837fb authored by Caitlin Shkuratov's avatar Caitlin Shkuratov Committed by Android (Google) Code Review
Browse files

Merge changes I8d284f63,Ib8b32313 into main

* changes:
  [SB] Remove unused StatusBarIconController#setIconA11yLiveRegion.
  [SB][Chip] Always announce the screen record countdown chip for a11y.
parents 7d26a4ad b0fd51c9
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -38,7 +38,9 @@ import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.layout.layout
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.semantics.LiveRegionMode
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.liveRegion
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
@@ -110,6 +112,9 @@ fun OngoingActivityChip(
                    if (contentDescription != null) {
                        this.contentDescription = contentDescription
                    }
                    if (model.content is OngoingActivityChipModel.Content.Countdown) {
                        liveRegion = LiveRegionMode.Assertive
                    }
                }
                .widthIn(min = minWidth)
                // For non-privacy-related chips, only show the chip if there's enough space for at
+0 −9
Original line number Diff line number Diff line
@@ -88,15 +88,6 @@ public interface StatusBarIconController {
    /** Sets whether the icon in the given slot should be visible or not. */
    void setIconVisibility(String slot, boolean b);

    /**
     * Sets the live region mode for the icon
     *
     * @param slot                    Icon slot to set region for
     * @param accessibilityLiveRegion live region mode for the icon
     * @see android.view.View#setAccessibilityLiveRegion(int)
     */
    void setIconAccessibilityLiveRegion(String slot, int accessibilityLiveRegion);

    /**
     * If you don't know what to pass for `tag`, either remove all icons for slot, or use
     * TAG_PRIMARY to refer to the first icon at a given slot.
+0 −16
Original line number Diff line number Diff line
@@ -391,22 +391,6 @@ public class StatusBarIconControllerImpl implements Tunable,
        handleSet(slot, holder);
    }

    /** */
    @Override
    public void setIconAccessibilityLiveRegion(String slotName, int accessibilityLiveRegion) {
        Slot slot = mStatusBarIconList.getSlot(slotName);
        if (!slot.hasIconsInSlot()) {
            return;
        }

        List<StatusBarIconHolder> iconsToUpdate = slot.getHolderListInViewOrder();
        for (StatusBarIconHolder holder : iconsToUpdate) {
            int viewIndex = mStatusBarIconList.getViewIndex(slotName, holder.getTag());
            mIconGroups.forEach(l -> l.mGroup.getChildAt(viewIndex)
                    .setAccessibilityLiveRegion(accessibilityLiveRegion));
        }
    }

    /** */
    @Override
    public void removeIcon(String slot, int tag) {
+0 −5
Original line number Diff line number Diff line
@@ -82,9 +82,4 @@ public class FakeStatusBarIconController extends BaseLeakChecker<IconManager>
    @Override
    public void removeIcon(String slot, int tag) {
    }

    @Override
    public void setIconAccessibilityLiveRegion(String slot, int mode) {
    }

}