Return null from compat when resolveActivity returns null.
Fixes bug that LauncherAppsCompatVL.resolveActivity was wrapping
a null in a compat class when LauncherApps.resolveActivity returns
null.
Bug: 14891460
Change-Id: I0364b198486f14393e51ac383a9d10b89e466bdf
diff --git a/src/com/android/launcher3/compat/LauncherAppsCompatVL.java b/src/com/android/launcher3/compat/LauncherAppsCompatVL.java
index c933712..21f2659 100644
--- a/src/com/android/launcher3/compat/LauncherAppsCompatVL.java
+++ b/src/com/android/launcher3/compat/LauncherAppsCompatVL.java
@@ -110,8 +110,13 @@
}
public LauncherActivityInfoCompat resolveActivity(Intent intent, UserHandleCompat user) {
- return new LauncherActivityInfoCompatVL(ReflectUtils.invokeMethod(mLauncherApps,
- mResolveActivity, intent, user.getUser()));
+ Object activity = ReflectUtils.invokeMethod(mLauncherApps, mResolveActivity,
+ intent, user.getUser());
+ if (activity != null) {
+ return new LauncherActivityInfoCompatVL(activity);
+ } else {
+ return null;
+ }
}
public void startActivityForProfile(ComponentName component, Rect sourceBounds,