Makes all custom caption settings unsearchable when custom captions are not active.

Unifies all custom caption controllers under a base controller, whose searchability is directly determined by CaptionHelper#getCustomCaptionAvailability().

Test: atest CaptionHelperTest
Bug: 353757664
Flag: com.android.settings.accessibility.fix_a11y_settings_search
Change-Id: If44e6eca4c72aa4413cd0a6e8735dbb22c7abe62
This commit is contained in:
Riley Jones
2024-11-21 19:55:28 +00:00
parent e39b2c18d8
commit 6f8e823e0e
24 changed files with 106 additions and 288 deletions

View File

@@ -23,22 +23,13 @@ import androidx.preference.PreferenceScreen;
import com.android.settings.R;
import com.android.settings.accessibility.ListDialogPreference.OnValueChangedListener;
import com.android.settings.core.BasePreferenceController;
/** Preference controller for captioning background opacity. */
public class CaptioningBackgroundOpacityController extends BasePreferenceController
public class CaptioningBackgroundOpacityController extends BaseCaptioningCustomController
implements OnValueChangedListener {
private final CaptionHelper mCaptionHelper;
public CaptioningBackgroundOpacityController(Context context, String preferenceKey) {
super(context, preferenceKey);
mCaptionHelper = new CaptionHelper(context);
}
@Override
public int getAvailabilityStatus() {
return AVAILABLE;
}
@Override