The Google doc says there is no longer a length restriction on AccessibilityEvent so there is no need to check the length of bearingStr nor to truncate it.
Code:
if (isShown()) {
String bearingStr = String.valueOf(bearing);
event.getText().add(bearingStr);
return true;
}