From 45583d449f7cc6f144d8f7267693dee9760c9361 Mon Sep 17 00:00:00 2001 From: Jason Chiu Date: Wed, 13 Sep 2023 14:25:56 +0800 Subject: [PATCH] Enable the suggesiton test on disabled components The activity to test suggestions might be disabled by configuration. To avoid no component found for testing, just query activities including the disabled components. Fix: 300160935 Test: atest SettingsRoboTests:com.android.settings.suggestions Change-Id: I37718ea79480d16a90c67635666b8cdfa8be4dae --- .../android/settings/suggestions/SettingsSuggestionsTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/robotests/src/com/android/settings/suggestions/SettingsSuggestionsTest.java b/tests/robotests/src/com/android/settings/suggestions/SettingsSuggestionsTest.java index d686f50b9c3..9f02f1f762e 100644 --- a/tests/robotests/src/com/android/settings/suggestions/SettingsSuggestionsTest.java +++ b/tests/robotests/src/com/android/settings/suggestions/SettingsSuggestionsTest.java @@ -97,7 +97,8 @@ public class SettingsSuggestionsTest { final ComponentName componentName = new ComponentName(context, activityName); final ActivityInfo info; try { - info = pm.getActivityInfo(componentName, PackageManager.GET_META_DATA); + info = pm.getActivityInfo(componentName, PackageManager.GET_META_DATA + | PackageManager.MATCH_DISABLED_COMPONENTS); } catch (NameNotFoundException e) { throw new RuntimeException(e); }