@@ -70,16 +70,26 @@ public ParseGeoPoint(ParseGeoPoint point) {
7070 this (point .getLatitude (), point .getLongitude ());
7171 }
7272
73-
7473 /**
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
7675 * ParseGeoPoint. Subclasses that need Parcelable behavior should provide their own
7776 * {@link android.os.Parcelable.Creator} and override this constructor.
7877 *
79- * @param source
80- * The recovered parcel.
78+ * @param source The recovered parcel.
8179 */
8280 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 ) {
8393 setLatitude (source .readDouble ());
8494 setLongitude (source .readDouble ());
8595 }
@@ -292,14 +302,18 @@ public int describeContents() {
292302
293303 @ Override
294304 public void writeToParcel (Parcel dest , int flags ) {
305+ writeToParcel (dest , ParseParcelEncoder .get ());
306+ }
307+
308+ void writeToParcel (Parcel dest , ParseParcelEncoder encoder ) {
295309 dest .writeDouble (latitude );
296310 dest .writeDouble (longitude );
297311 }
298312
299313 public final static Creator <ParseGeoPoint > CREATOR = new Creator <ParseGeoPoint >() {
300314 @ Override
301315 public ParseGeoPoint createFromParcel (Parcel source ) {
302- return new ParseGeoPoint (source );
316+ return new ParseGeoPoint (source , ParseParcelDecoder . get () );
303317 }
304318
305319 @ Override
0 commit comments