diff options
author | David Christie <dnchrist@google.com> | 2022-03-11 01:13:31 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-07-07 01:46:30 +0000 |
commit | 26c1e64343596759677a12a65fce84792165d87f (patch) | |
tree | 2a084763aec0bbb031942bff6f2311818690d1a3 | |
parent | 6f7fb3bc318ed913b12dbb035a3b2a567ecb8cee (diff) | |
download | base-26c1e64343596759677a12a65fce84792165d87f.tar.gz |
Update GeofenceHardwareRequestParcelable to match parcel/unparcel format.
Test: manual
Bug: 216631962
Change-Id: I3d6d1be9d6c312fe0bf98f600ff8fc9c617f8ec3
(cherry picked from commit e20d8ae7104f3235c8a2d72c85d19644e2ac8d86)
Merged-In: I3d6d1be9d6c312fe0bf98f600ff8fc9c617f8ec3
-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( |