registerOnStateChangedCallback