diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index 86635edeca..ed5f299837 100644 --- a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java +++ b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java @@ -30,6 +30,7 @@ import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; +import android.content.pm.ActivityInfo; import android.content.pm.LauncherActivityInfo; import android.content.pm.PackageManager; import android.os.Process; @@ -368,11 +369,16 @@ public abstract class AbstractLauncherUiTest { mDevice.wait(Until.hasObject(selector), DEFAULT_UI_TIMEOUT)); } - public static String resolveSystemApp(String category) { + public static ActivityInfo resolveSystemAppInfo(String category) { return getInstrumentation().getContext().getPackageManager().resolveActivity( new Intent(Intent.ACTION_MAIN).addCategory(category), PackageManager.MATCH_SYSTEM_ONLY). - activityInfo.packageName; + activityInfo; + } + + + public static String resolveSystemApp(String category) { + return resolveSystemAppInfo(category).packageName; } protected void closeLauncherActivity() {