diff --git a/android/app/src/main/java/app/organicmaps/bookmarks/OperationStatus.java b/android/app/src/main/java/app/organicmaps/bookmarks/OperationStatus.java index ae672bcae3..86cf3a4601 100644 --- a/android/app/src/main/java/app/organicmaps/bookmarks/OperationStatus.java +++ b/android/app/src/main/java/app/organicmaps/bookmarks/OperationStatus.java @@ -4,6 +4,7 @@ import android.os.Parcel; import android.os.Parcelable; import androidx.annotation.Nullable; +import androidx.core.os.ParcelCompat; import app.organicmaps.bookmarks.data.Error; import app.organicmaps.bookmarks.data.Result; @@ -23,8 +24,8 @@ public class OperationStatus implements Parcelable private OperationStatus(Parcel in) { - mResult = in.readParcelable(Result.class.getClassLoader()); - mError = in.readParcelable(Error.class.getClassLoader()); + mResult = ParcelCompat.readParcelable(in, Result.class.getClassLoader(), Result.class); + mError = ParcelCompat.readParcelable(in, Error.class.getClassLoader(), Error.class); } public static final Creator CREATOR = new Creator() diff --git a/android/app/src/main/java/app/organicmaps/bookmarks/data/Bookmark.java b/android/app/src/main/java/app/organicmaps/bookmarks/data/Bookmark.java index 8846fc4625..e5323d040f 100644 --- a/android/app/src/main/java/app/organicmaps/bookmarks/data/Bookmark.java +++ b/android/app/src/main/java/app/organicmaps/bookmarks/data/Bookmark.java @@ -7,6 +7,7 @@ import androidx.annotation.IntRange; import androidx.annotation.Keep; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.os.ParcelCompat; import app.organicmaps.Framework; import app.organicmaps.routing.RoutePointInfo; @@ -71,7 +72,7 @@ public class Bookmark extends MapObject super(type, source); mCategoryId = source.readLong(); mBookmarkId = source.readLong(); - mIcon = source.readParcelable(Icon.class.getClassLoader()); + mIcon = ParcelCompat.readParcelable(source, Icon.class.getClassLoader(), Icon.class); mMerX = source.readDouble(); mMerY = source.readDouble(); initXY(); diff --git a/android/app/src/main/java/app/organicmaps/bookmarks/data/MapObject.java b/android/app/src/main/java/app/organicmaps/bookmarks/data/MapObject.java index 692a0d521c..acc9335471 100644 --- a/android/app/src/main/java/app/organicmaps/bookmarks/data/MapObject.java +++ b/android/app/src/main/java/app/organicmaps/bookmarks/data/MapObject.java @@ -7,6 +7,7 @@ import androidx.annotation.IntDef; import androidx.annotation.Keep; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.os.ParcelCompat; import app.organicmaps.routing.RoutePointInfo; import app.organicmaps.search.Popularity; @@ -110,8 +111,7 @@ public class MapObject implements PlacePageData protected MapObject(@MapObjectType int type, Parcel source) { - //noinspection ResourceType - this(source.readParcelable(FeatureId.class.getClassLoader()), // FeatureId + this(ParcelCompat.readParcelable(source, FeatureId.class.getClassLoader(), FeatureId.class), // FeatureId type, // MapObjectType source.readString(), // Title source.readString(), // SecondaryTitle @@ -119,11 +119,11 @@ public class MapObject implements PlacePageData source.readString(), // Address source.readDouble(), // Lat source.readDouble(), // Lon - source.readParcelable(Metadata.class.getClassLoader()), + ParcelCompat.readParcelable(source, Metadata.class.getClassLoader(), Metadata.class), source.readString(), // ApiId; - source.readParcelable(RoutePointInfo.class.getClassLoader()), // RoutePointInfo + ParcelCompat.readParcelable(source, RoutePointInfo.class.getClassLoader(), RoutePointInfo.class), // RoutePointInfo source.readInt(), // mOpeningMode - source.readParcelable(Popularity.class.getClassLoader()), + ParcelCompat.readParcelable(source, Popularity.class.getClassLoader(), Popularity.class), source.readString(), source.readInt(), null // mRawTypes