Merge "Add content description for ScreenRecordTile" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
cc14ed08f5
@@ -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
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user