Merge "Disconnect to car service in CarProxyActivity onDestroy()" into nyc-car-dev
diff --git a/car-lib/src/android/car/hardware/CarPropertyConfig.java b/car-lib/src/android/car/hardware/CarPropertyConfig.java
index dc7f887..a93f2bc 100644
--- a/car-lib/src/android/car/hardware/CarPropertyConfig.java
+++ b/car-lib/src/android/car/hardware/CarPropertyConfig.java
@@ -119,7 +119,7 @@
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         dest.writeInt(mPropertyId);
-        dest.writeSerializable(mType);
+        dest.writeString(mType.getName());
         dest.writeInt(mAreaType);
         dest.writeInt(mSupportedAreas.size());
         for (int i = 0; i < mSupportedAreas.size(); i++) {
@@ -131,7 +131,12 @@
     @SuppressWarnings("unchecked")
     private CarPropertyConfig(Parcel in) {
         mPropertyId = in.readInt();
-        mType = (Class<T>) in.readSerializable();
+        String className = in.readString();
+        try {
+            mType = (Class<T>) Class.forName(className);
+        } catch (ClassNotFoundException e) {
+            throw new IllegalArgumentException("Class not found: " + className);
+        }
         mAreaType = in.readInt();
         int areaSize = in.readInt();
         mSupportedAreas = new SparseArray<>(areaSize);