summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk3
-rw-r--r--src/android/car/cluster/ClusterRenderingService.java6
2 files changed, 8 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index ef92d7e..8da51c3 100644
--- a/Android.mk
+++ b/Android.mk
@@ -36,7 +36,8 @@ LOCAL_USE_AAPT2 := true
LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
LOCAL_STATIC_JAVA_LIBRARIES := \
- android.car.cluster.navigation
+ android.car.cluster.navigation \
+ androidx.car_car-cluster
LOCAL_JAVA_LIBRARIES += android.car
LOCAL_STATIC_ANDROID_LIBRARIES += \
diff --git a/src/android/car/cluster/ClusterRenderingService.java b/src/android/car/cluster/ClusterRenderingService.java
index 6c924c4..5770773 100644
--- a/src/android/car/cluster/ClusterRenderingService.java
+++ b/src/android/car/cluster/ClusterRenderingService.java
@@ -40,6 +40,8 @@ import android.view.Display;
import android.view.InputDevice;
import android.view.KeyEvent;
+import androidx.versionedparcelable.ParcelUtils;
+
import com.google.protobuf.InvalidProtocolBufferException;
import java.io.FileDescriptor;
@@ -191,6 +193,10 @@ public class ClusterRenderingService extends InstrumentClusterRenderingService i
public void onEvent(int eventType, Bundle bundle) {
StringBuilder bundleSummary = new StringBuilder();
if (eventType == NAV_STATE_EVENT_ID) {
+ // Required to prevent backwards compatibility crash with old map providers
+ // sending androidx.versionedparcelables
+ bundle.setClassLoader(ParcelUtils.class.getClassLoader());
+
// Attempt to read proto byte array
byte[] protoBytes = bundle.getByteArray(NAV_STATE_PROTO_BUNDLE_KEY);
if (protoBytes != null) {