Fix unbundled accessibility features settings crash when launched

Root cause: The ag/19938064 introduces Settings Core change preference value changed metrics log format. It tries to lookupMetricsCategory() at Fragment#instantiate() stage. It has not onAttach() to activity by FragmentManager#add() or #replace(). The features were added by ag/15824482.
Solution: PutInt new MATRICS_CATEGORY extra in previous class to avoid giving context for FeatureFactory.getFactory to custom 1P accessibility services for SettingsGoogle overlay.

Bug: 259355675
Test: manual test
Change-Id: Ic37d41be6a54fe388f211c1c397d0b9b87b5fb56
This commit is contained in:
menghanli
2022-11-17 20:39:37 +08:00
committed by Menghan Li
parent 1436b66e14
commit f76e31fe48
5 changed files with 19 additions and 23 deletions

View File

@@ -87,6 +87,7 @@ public class AccessibilitySettings extends DashboardFragment {
static final String EXTRA_ANIMATED_IMAGE_RES = "animated_image_res";
static final String EXTRA_HTML_DESCRIPTION = "html_description";
static final String EXTRA_TIME_FOR_LOGGING = "start_time_to_log_a11y_tool";
static final String EXTRA_METRICS_CATEGORY = "metrics_category";
// Timeout before we update the services if packages are added/removed
// since the AccessibilityManagerService has to do that processing first