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

Commit 0daa9708 authored by Fabian Kozynski's avatar Fabian Kozynski
Browse files

Add content description for ScreenRecordTile

Adds description with name and state for QQS.

Test: manual
Test: atest
Fixes: 153518955
Change-Id: Idc599d891c769791ee4ed2aec9f30db758846897
parent edaedb06
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -18,7 +18,9 @@ package com.android.systemui.qs.tiles;

import android.content.Intent;
import android.service.quicksettings.Tile;
import android.text.TextUtils;
import android.util.Log;
import android.widget.Switch;

import com.android.systemui.R;
import com.android.systemui.plugins.qs.QSTile;
@@ -88,6 +90,10 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState>
            state.icon = ResourceIcon.get(R.drawable.ic_qs_screenrecord);
            state.secondaryLabel = mContext.getString(R.string.quick_settings_screen_record_start);
        }
        state.contentDescription = TextUtils.isEmpty(state.secondaryLabel)
                ? state.label
                : TextUtils.concat(state.label, ", ", state.secondaryLabel);
        state.expandedAccessibilityClassName = Switch.class.getName();
    }

    @Override
+8 −0
Original line number Diff line number Diff line
@@ -133,4 +133,12 @@ public class ScreenRecordTileTest extends SysuiTestCase {

        verify(mController, times(1)).stopRecording();
    }

    @Test
    public void testContentDescriptionHasTileName() {
        mTile.refreshState();
        mTestableLooper.processAllMessages();

        assertTrue(mTile.getState().contentDescription.toString().contains(mTile.getState().label));
    }
}