displayManager.registerBacklightEventListener(object : BacklightEventListener {
* This callback is invoked when the backlight mode changes, and your app is in the foreground.
override fun onBacklightModeChanged(backlightMode: LeiaDisplayManager.BacklightMode?) {
// TODO: Change your application's rendering mode to 2D or 3D.
* This callback is called when the list of reasons why 3D may be disabled changes.
override fun onBacklightDisableReasonChanged(disableReasons: Set<BacklightDisableReason?>?) {
// TODO: Optionally perform some reason-specific action.