diff options
author | David Christie <dnchrist@google.com> | 2022-03-21 23:13:42 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-03-21 23:13:42 +0000 |
commit | a0be1a586a546a42b38d34c3a005cf2e4639959d (patch) | |
tree | a00eb847db3d08a60db5cb163e7072d143a2b40b /core | |
parent | 3f0d2e8c2b7215337a501adbc520ab30bf938e18 (diff) | |
parent | e20d8ae7104f3235c8a2d72c85d19644e2ac8d86 (diff) |
Merge "Update GeofenceHardwareRequestParcelable to match parcel/unparcel format." into sc-v2-dev
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/hardware/location/GeofenceHardwareRequestParcelable.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/core/java/android/hardware/location/GeofenceHardwareRequestParcelable.java b/core/java/android/hardware/location/GeofenceHardwareRequestParcelable.java index df13ade2bf5e..bd25b8f2ad88 100644 --- a/core/java/android/hardware/location/GeofenceHardwareRequestParcelable.java +++ b/core/java/android/hardware/location/GeofenceHardwareRequestParcelable.java @@ -16,9 +16,9 @@ package android.hardware.location; +import android.os.BadParcelableException; import android.os.Parcel; import android.os.Parcelable; -import android.util.Log; /** * Geofence Hardware Request used for internal location services communication. @@ -139,11 +139,8 @@ public final class GeofenceHardwareRequestParcelable implements Parcelable { @Override public GeofenceHardwareRequestParcelable createFromParcel(Parcel parcel) { int geofenceType = parcel.readInt(); - if(geofenceType != GeofenceHardwareRequest.GEOFENCE_TYPE_CIRCLE) { - Log.e( - "GeofenceHardwareRequest", - String.format("Invalid Geofence type: %d", geofenceType)); - return null; + if (geofenceType != GeofenceHardwareRequest.GEOFENCE_TYPE_CIRCLE) { + throw new BadParcelableException("Invalid Geofence type: " + geofenceType); } GeofenceHardwareRequest request = GeofenceHardwareRequest.createCircularGeofence( |