Update GeofenceHardwareRequestParcelable to match parcel/unparcel format. am: 3e1ffdb294

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17185256

Change-Id: Ibe74e45782650c3d972306d5e43b4f646be78c79
This commit is contained in:
David Christie
2022-03-22 05:10:37 +00:00
committed by Automerger Merge Worker

View File

@@ -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(