From 596d3309ba9bc078f3e4e7b8d369c5f22d55da3f Mon Sep 17 00:00:00 2001 From: Alexandros Schillings Date: Mon, 10 Mar 2014 13:52:05 +0000 Subject: [PATCH] Added classloaders to the Bundles --- src/uk/co/alt236/btlescan/containers/AdRecord.java | 4 ++-- src/uk/co/alt236/btlescan/containers/AdRecordStore.java | 2 +- src/uk/co/alt236/btlescan/containers/BluetoothLeDevice.java | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/uk/co/alt236/btlescan/containers/AdRecord.java b/src/uk/co/alt236/btlescan/containers/AdRecord.java index 74089d8..ca72dae 100644 --- a/src/uk/co/alt236/btlescan/containers/AdRecord.java +++ b/src/uk/co/alt236/btlescan/containers/AdRecord.java @@ -148,7 +148,7 @@ public final class AdRecord implements Parcelable{ } public AdRecord(Parcel in) { - final Bundle b = in.readBundle(); + final Bundle b = in.readBundle(getClass().getClassLoader()); mLength = b.getInt("record_length"); mType = b.getInt("record_type"); mData = b.getByteArray("record_data"); @@ -182,7 +182,7 @@ public final class AdRecord implements Parcelable{ @Override public void writeToParcel(Parcel parcel, int arg1) { - final Bundle b = new Bundle(); + final Bundle b = new Bundle(getClass().getClassLoader()); b.putInt("record_length", mLength); b.putInt("record_type", mType); diff --git a/src/uk/co/alt236/btlescan/containers/AdRecordStore.java b/src/uk/co/alt236/btlescan/containers/AdRecordStore.java index 9143e36..bbabcbb 100644 --- a/src/uk/co/alt236/btlescan/containers/AdRecordStore.java +++ b/src/uk/co/alt236/btlescan/containers/AdRecordStore.java @@ -26,7 +26,7 @@ public class AdRecordStore implements Parcelable{ }; public AdRecordStore(Parcel in) { - final Bundle b = in.readBundle(); + final Bundle b = in.readBundle(getClass().getClassLoader()); mAdRecords = b.getSparseParcelableArray("records_array"); mLocalNameComplete = b.getString("local_name_complete"); mLocalNameShort = b.getString("local_name_short"); diff --git a/src/uk/co/alt236/btlescan/containers/BluetoothLeDevice.java b/src/uk/co/alt236/btlescan/containers/BluetoothLeDevice.java index fa30452..9cde283 100644 --- a/src/uk/co/alt236/btlescan/containers/BluetoothLeDevice.java +++ b/src/uk/co/alt236/btlescan/containers/BluetoothLeDevice.java @@ -32,7 +32,8 @@ public class BluetoothLeDevice implements Parcelable{ } private BluetoothLeDevice(Parcel in) { - final Bundle b = in.readBundle(); + final Bundle b = in.readBundle(getClass().getClassLoader()); + mDevice = b.getParcelable("bluetooth_device"); mRecordStore = b.getParcelable("device_scanrecord_store"); mRssi = b.getInt("device_rssi"); @@ -111,7 +112,8 @@ public class BluetoothLeDevice implements Parcelable{ @Override public void writeToParcel(Parcel parcel, int arg1) { - final Bundle b = new Bundle(); + final Bundle b = new Bundle(getClass().getClassLoader()); + b.putByteArray("device_scanrecord", mScanRecord); b.putInt("device_rssi", mRssi); b.putParcelable("bluetooth_device", mDevice);