# Car.CarServiceLifecycleListener

# Car.CarServiceLifecycleListener


`
public
static


interface
Car.CarServiceLifecycleListener
`


`


`

|---------------------------------------------|
| android.car.Car.CarServiceLifecycleListener |

<br />

*** ** * ** ***

Callback to notify the Lifecycle of car service.

Access to car service should happen
after [CarServiceLifecycleListener#onLifecycleChanged(Car, boolean)](https://developer.android.com/reference/android/car/Car.CarServiceLifecycleListener#onLifecycleChanged(android.car.Car,%20boolean)) call with
`ready` set `true`.

When [CarServiceLifecycleListener#onLifecycleChanged(Car, boolean)](https://developer.android.com/reference/android/car/Car.CarServiceLifecycleListener#onLifecycleChanged(android.car.Car,%20boolean)) is
called with ready set to false, access to car service should stop until car service is ready
again from [CarServiceLifecycleListener#onLifecycleChanged(Car, boolean)](https://developer.android.com/reference/android/car/Car.CarServiceLifecycleListener#onLifecycleChanged(android.car.Car,%20boolean)) call
with `ready` set to `true`.

<br />

## Summary

|                                                                                                                                                ### Public methods                                                                                                                                                 ||
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[onLifecycleChanged](https://developer.android.com/reference/android/car/Car.CarServiceLifecycleListener#onLifecycleChanged(android.car.Car,%20boolean))`(`[Car](https://developer.android.com/reference/android/car/Car)` car, boolean ready) ` Car service has gone through status change. |

## Public methods

### onLifecycleChanged

```
public abstract void onLifecycleChanged (Car car, 
                boolean ready)
```

Car service has gone through status change.

This is always called in the main thread context.

<br />

<br />

|                                                                                                                                                                                       Parameters                                                                                                                                                                                        ||
|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `car`   | `Car`: `Car` object that was originally associated with this lister from [Car.createCar(android.content.Context, android.os.Handler, long, android.car.Car.CarServiceLifecycleListener)](https://developer.android.com/reference/android/car/Car#createCar(android.content.Context,%20android.os.Handler,%20long,%20android.car.Car.CarServiceLifecycleListener)) call. <br /> |
| `ready` | `boolean`: when `true`, car service is ready and all accesses are ok Otherwise car service has crashed or killed and will be restarted <br />                                                                                                                                                                                                                                  |