# CarHardwareLocation

Artifact: [androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app) [View Source](https://cs.android.com/search?q=file:androidx/car/app/hardware/info/CarHardwareLocation.java+class:androidx.car.app.hardware.info.CarHardwareLocation) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

*** ** * ** ***


```
@CarProtocol
@RequiresCarApi(value = 3)
public final class CarHardwareLocation
```

<br />

*** ** * ** ***

Information about car specific car location available from the car hardware.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/car/app/hardware/info/CarHardwareLocation#CarHardwareLocation(androidx.car.app.hardware.common.CarValue<android.location.Location>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/common/CarValue<https://developer.android.com/reference/android/location/Location.html> location)` Creates an `https://developer.android.com/reference/androidx/car/app/hardware/info/CarHardwareLocation` with the given raw data. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/hardware/info/CarHardwareLocation#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/common/CarValue<https://developer.android.com/reference/android/location/Location.html>` | `https://developer.android.com/reference/androidx/car/app/hardware/info/CarHardwareLocation#getLocation()()` Returns the raw location data from the car sensor. |
| `int` | `https://developer.android.com/reference/androidx/car/app/hardware/info/CarHardwareLocation#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/car/app/hardware/info/CarHardwareLocation#toString()()` |

## Public constructors

### CarHardwareLocation

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

```
public CarHardwareLocation(@NonNull CarValue<Location> location)
```

Creates an `https://developer.android.com/reference/androidx/car/app/hardware/info/CarHardwareLocation` with the given raw data.

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/NullPointerException.html` | if `location` is `null` |

## Public methods

### equals

```
public boolean equals(@Nullable Object other)
```

### getLocation

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

```
public @NonNull CarValue<Location> getLocation()
```

Returns the raw location data from the car sensor.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```