Merge "creating a java7 target for car-lib so it can be used at compile time in google3" into nyc-car-dev
diff --git a/car-lib/Android.mk b/car-lib/Android.mk
index e1f4105..521b863 100644
--- a/car-lib/Android.mk
+++ b/car-lib/Android.mk
@@ -42,4 +42,13 @@
car_module_java_packages := android.car*
include $(CAR_API_CHECK)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := android.car7
+LOCAL_SRC_FILES := $(call all-java-files-under, src) $(call all-Iaidl-files-under, src)
+LOCAL_JAVA_LANGUAGE_VERSION := 1.7
+
+include $(BUILD_JAVA_LIBRARY)
+$(call dist-for-goals,dist_files,$(full_classes_jar):$(LOCAL_MODULE).jar)
+
endif #TARGET_BUILD_PDK
diff --git a/car-lib/src/android/car/cluster/renderer/ThreadSafeNavigationRenderer.java b/car-lib/src/android/car/cluster/renderer/ThreadSafeNavigationRenderer.java
index 1fcdbc0..94011a2 100644
--- a/car-lib/src/android/car/cluster/renderer/ThreadSafeNavigationRenderer.java
+++ b/car-lib/src/android/car/cluster/renderer/ThreadSafeNavigationRenderer.java
@@ -118,12 +118,19 @@
}
}
- private static <E> E runAndWaitResult(Handler handler, RunnableWithResult<E> runnable) {
+ private static <E> E runAndWaitResult(Handler handler, final RunnableWithResult<E> runnable) {
final CountDownLatch latch = new CountDownLatch(1);
- handler.post(() -> {
- runnable.run();
- latch.countDown();
- });
+
+ Runnable wrappedRunnable = new Runnable() {
+ @Override
+ public void run() {
+ runnable.run();
+ latch.countDown();
+ }
+ };
+
+ handler.post(wrappedRunnable);
+
try {
latch.await();
} catch (InterruptedException e) {