# CarHardwareLocation

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/hardware/info/CarHardwareLocation "View this page in Java")

<br />

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

<br />

*** ** * ** ***

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

## Summary

|                                                                                                                                                                                                                                                                                 ### Public constructors                                                                                                                                                                                                                                                                                  |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [CarHardwareLocation](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/CarHardwareLocation#CarHardwareLocation(androidx.car.app.hardware.common.CarValue<android.location.Location>))`(location: `[CarValue](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/common/CarValue)`<`[Location](https://developer.android.com/reference/android/location/Location.html)`!>)` Creates an[CarHardwareLocation](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/CarHardwareLocation)with the given raw data. |

|                                                                                     ### Public functions                                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                           | [equals](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/CarHardwareLocation#equals(java.lang.Object))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| [CarValue](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/common/CarValue)`<`[Location](https://developer.android.com/reference/android/location/Location.html)`!>` | [getLocation](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/CarHardwareLocation#getLocation())`()` Returns the raw location data from the car sensor.                                         |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                                   | [hashCode](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/CarHardwareLocation#hashCode())`()`                                                                                                  |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                             | [toString](https://developer.android.com/reference/kotlin/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)  

```
CarHardwareLocation(location: CarValue<Location!>)
```

Creates an[CarHardwareLocation](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/CarHardwareLocation)with the given raw data.  

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

## Public functions

### equals

```
fun equals(other: Any?): Boolean
```  

### getLocation

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

```
fun getLocation(): CarValue<Location!>
```

Returns the raw location data from the car sensor.  

### hashCode

```
fun hashCode(): Int
```  

### toString

```
fun toString(): String
```