CarUxRestrictionsHelper

public class CarUxRestrictionsHelper
extends Object

java.lang.Object
   ↳ androidx.car.util.CarUxRestrictionsHelper


Helps registering OnUxRestrictionsChangedListener and managing car connection.

Summary

Public constructors

CarUxRestrictionsHelper(Context context, OnUxRestrictionsChangedListener listener)

Public methods

void start()

Starts monitoring any changes in CarUxRestrictions.

void stop()

Stops monitoring any changes in CarUxRestrictions.

Inherited methods

Public constructors

CarUxRestrictionsHelper

public CarUxRestrictionsHelper (Context context, 
                OnUxRestrictionsChangedListener listener)

Parameters
context Context

listener OnUxRestrictionsChangedListener

Public methods

start

public void start ()

Starts monitoring any changes in CarUxRestrictions.

This method can be called from Activity's Activity.onStart(), or at the time of construction.

This method must be accompanied with a matching stop() to avoid leak.

stop

public void stop ()

Stops monitoring any changes in CarUxRestrictions.

This method should be called from Activity's Activity.onStop(), or at the time of being discarded.

After stop() has been called, start() can be called again to resume monitoring car ux restrictions change.