From e065f7c5a9ad4e47f5490793401445660af37624 Mon Sep 17 00:00:00 2001 From: Mark Renouf Date: Tue, 1 Nov 2016 11:48:24 -0400 Subject: [PATCH] Workaround for javac compilation issue of lambda code Since ag/32554459 some Robolectric tests are compiling framework code with javac. For reasons unclear so far this code fails to compile with javac: > ShortcutService.java:408: error: variable ri might not have been initialized https://android-build.googleplex.com/builds/submitted/3416256/angelfish-userdebug/latest/logs Removing the lambda expressions corrects the issue. BUG: 32554459 Change-Id: I189c8ef02dc93b46ef6418c1ff14f2312097898a --- .../core/java/com/android/server/pm/ShortcutService.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/pm/ShortcutService.java b/services/core/java/com/android/server/pm/ShortcutService.java index 13f558e3dd13..500af0ca73d3 100644 --- a/services/core/java/com/android/server/pm/ShortcutService.java +++ b/services/core/java/com/android/server/pm/ShortcutService.java @@ -238,10 +238,19 @@ public class ShortcutService extends IShortcutService.Stub { private static List EMPTY_RESOLVE_INFO = new ArrayList<>(0); - private static Predicate ACTIVITY_NOT_EXPORTED = - ri -> !ri.activityInfo.exported; + // Temporarily reverted to anonymous inner class form due to: b/32554459 + private static Predicate ACTIVITY_NOT_EXPORTED = new Predicate() { + public boolean test(ResolveInfo ri) { + return !ri.activityInfo.exported; + } + }; - private static Predicate PACKAGE_NOT_INSTALLED = pi -> !isInstalled(pi); + // Temporarily reverted to anonymous inner class form due to: b/32554459 + private static Predicate PACKAGE_NOT_INSTALLED = new Predicate() { + public boolean test(PackageInfo pi) { + return !isInstalled(pi); + } + }; private final Handler mHandler; -- 2.11.0