From 792dd77e8c6fed786ef95da0cd9f5c342c9f1f6b Mon Sep 17 00:00:00 2001 From: Kenny Guy Date: Wed, 14 May 2014 12:06:51 +0100 Subject: [PATCH] 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 --- .../android/launcher3/compat/LauncherAppsCompatVL.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/compat/LauncherAppsCompatVL.java b/src/com/android/launcher3/compat/LauncherAppsCompatVL.java index c933712a9c..21f2659ba5 100644 --- a/src/com/android/launcher3/compat/LauncherAppsCompatVL.java +++ b/src/com/android/launcher3/compat/LauncherAppsCompatVL.java @@ -110,8 +110,13 @@ public class LauncherAppsCompatVL extends LauncherAppsCompat { } 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,