Added in API level 30

Car.CarServiceLifecycleListener

public static interface Car.CarServiceLifecycleListener

android.car.Car.CarServiceLifecycleListener


Callback to notify the Lifecycle of car service.

Access to car service should happen after CarServiceLifecycleListener#onLifecycleChanged(Car, boolean) call with ready set true.

When CarServiceLifecycleListener#onLifecycleChanged(Car, boolean) is called with ready set to false, access to car service should stop until car service is ready again from CarServiceLifecycleListener#onLifecycleChanged(Car, boolean) call with ready set to true.

Summary

Public methods

abstract void onLifecycleChanged(Car car, boolean ready)

Car service has gone through status change.

Public methods

onLifecycleChanged

Added in API level 30
public abstract void onLifecycleChanged (Car car, 
                boolean ready)

Car service has gone through status change.

This is always called in the main thread context.

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) call.

ready boolean: when true, car service is ready and all accesses are ok Otherwise car service has crashed or killed and will be restarted