void UpdateSessionToken() { var freshToken = Service.SessionToken; if (freshToken == null || sessionToken == freshToken) { return; } controller?.UnregisterCallback(callback); sessionToken = freshToken; controller = new MediaControllerCompat(Service, sessionToken); transportControls = controller.GetTransportControls(); if (started) { controller.RegisterCallback(callback); } }
void UpdateSessionToken() { var freshToken = service.SessionToken; if (sessionToken == null && freshToken != null || sessionToken != null && sessionToken != freshToken) { controller?.UnregisterCallback(mCb); sessionToken = freshToken; if (sessionToken != null) { controller = new MediaControllerCompat(service, sessionToken); transportControls = controller.GetTransportControls(); if (started) { controller.RegisterCallback(mCb); } } } }