@@ -70,16 +70,26 @@ public ParseGeoPoint(ParseGeoPoint point) {
70
70
this (point .getLatitude (), point .getLongitude ());
71
71
}
72
72
73
-
74
73
/**
75
- * Creates a new point instance from a Parcel {@code source} . This is used when unparceling a
74
+ * Creates a new point instance from a {@link Parcel} source . This is used when unparceling a
76
75
* ParseGeoPoint. Subclasses that need Parcelable behavior should provide their own
77
76
* {@link android.os.Parcelable.Creator} and override this constructor.
78
77
*
79
- * @param source
80
- * The recovered parcel.
78
+ * @param source The recovered parcel.
81
79
*/
82
80
protected ParseGeoPoint (Parcel source ) {
81
+ this (source , ParseParcelDecoder .get ());
82
+ }
83
+
84
+ /**
85
+ * Creates a new point instance from a {@link Parcel} using the given {@link ParseParcelDecoder}.
86
+ * The decoder is currently unused, but it might be in the future, plus this is the pattern we
87
+ * are using in parcelable classes.
88
+ *
89
+ * @param source the parcel
90
+ * @param decoder the decoder
91
+ */
92
+ ParseGeoPoint (Parcel source , ParseParcelDecoder decoder ) {
83
93
setLatitude (source .readDouble ());
84
94
setLongitude (source .readDouble ());
85
95
}
@@ -292,14 +302,18 @@ public int describeContents() {
292
302
293
303
@ Override
294
304
public void writeToParcel (Parcel dest , int flags ) {
305
+ writeToParcel (dest , ParseParcelEncoder .get ());
306
+ }
307
+
308
+ void writeToParcel (Parcel dest , ParseParcelEncoder encoder ) {
295
309
dest .writeDouble (latitude );
296
310
dest .writeDouble (longitude );
297
311
}
298
312
299
313
public final static Creator <ParseGeoPoint > CREATOR = new Creator <ParseGeoPoint >() {
300
314
@ Override
301
315
public ParseGeoPoint createFromParcel (Parcel source ) {
302
- return new ParseGeoPoint (source );
316
+ return new ParseGeoPoint (source , ParseParcelDecoder . get () );
303
317
}
304
318
305
319
@ Override
0 commit comments