Fix search test

The broken test is because the activityInfo has no package name.
Set a random package name to fix it.

Test: run robo test
Fix: 214945263
Change-Id: I5ae5a0021f1473e6eadbad5f6e1f22840a44d592
This commit is contained in:
Tsung-Mao Fang
2022-01-18 20:02:46 +08:00
parent aa19771a37
commit 8b0e4018e1

View File

@@ -68,7 +68,9 @@ public class SearchFeatureProviderImplTest {
final Intent searchIntent = new Intent(Settings.ACTION_APP_SEARCH_SETTINGS) final Intent searchIntent = new Intent(Settings.ACTION_APP_SEARCH_SETTINGS)
.setPackage(mActivity.getString(R.string.config_settingsintelligence_package_name)); .setPackage(mActivity.getString(R.string.config_settingsintelligence_package_name));
final ResolveInfo info = new ResolveInfo(); final ResolveInfo info = new ResolveInfo();
info.activityInfo = new ActivityInfo(); final ActivityInfo activityInfo = new ActivityInfo();
activityInfo.packageName = "com.android.example";
info.activityInfo = activityInfo;
mPackageManager.addResolveInfoForIntent(searchIntent, info); mPackageManager.addResolveInfoForIntent(searchIntent, info);
// Should not crash. // Should not crash.