From 11ae8642dc06f5d9cbacda7199c849141fc691d6 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Fri, 30 Aug 2019 16:53:29 -0700 Subject: [PATCH] Adding flickerlib test Bug: 140244969 Change-Id: I45edfbbfb85fa371435ad0940cd939ed3d28c374 --- .../android/launcher3/ui/AbstractLauncherUiTest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java b/tests/src/com/android/launcher3/ui/AbstractLauncherUiTest.java index 761253dcfc..960ff8e030 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; @@ -356,11 +357,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() {