Fix ModifierShortcutManagerTests on AOSP build.

Stub PackageManager.resolveActivity() in the tests to always return
an activity, even if there isn't something installed that could handle
it. This makes the test independent of the state of the device which
may have some typical apps for handling the shortcuts missing.

Fixes: 356277860
Flag: TEST_ONLY
Test: atest WmTests:com.android.server.policy.ModifierShortcutManagerTests
Change-Id: Ie7d41a29f33d4c095f71472327523ddbe2bb7efe
diff --git a/services/tests/wmtests/src/com/android/server/policy/ModifierShortcutManagerTests.java b/services/tests/wmtests/src/com/android/server/policy/ModifierShortcutManagerTests.java
index 50041d0..d147325 100644
--- a/services/tests/wmtests/src/com/android/server/policy/ModifierShortcutManagerTests.java
+++ b/services/tests/wmtests/src/com/android/server/policy/ModifierShortcutManagerTests.java
@@ -35,6 +35,7 @@
 import android.content.pm.ActivityInfo;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
 import android.content.res.Resources;
 import android.content.res.XmlResourceParser;
 import android.os.Handler;
@@ -89,9 +90,12 @@
             testActivityInfo.applicationInfo = new ApplicationInfo();
             testActivityInfo.packageName =
                     testActivityInfo.applicationInfo.packageName = "com.test";
+            ResolveInfo testResolveInfo = new ResolveInfo();
+            testResolveInfo.activityInfo = testActivityInfo;
 
             doReturn(testActivityInfo).when(mPackageManager).getActivityInfo(
                     eq(new ComponentName("com.test", "com.test.BookmarkTest")), anyInt());
+            doReturn(testResolveInfo).when(mPackageManager).resolveActivity(anyObject(), anyInt());
             doThrow(new PackageManager.NameNotFoundException("com.test3")).when(mPackageManager)
                     .getActivityInfo(eq(new ComponentName("com.test3", "com.test.BookmarkTest")),
                         anyInt());