void UnregisterSwitchObserver(hal::SwitchDevice aDevice, hal::SwitchObserver *aObserver) { AssertMainThread(); SwitchObserverList& observer = GetSwitchObserverList(aDevice); observer.RemoveObserver(aObserver); if (observer.Length() == 0) { DisableSwitchNotifications(aDevice); ReleaseObserversIfNeeded(); } }
void UnregisterSwitchObserver(SwitchDevice aDevice, SwitchObserver *aObserver) { AssertMainThread(); if (!sSwitchObserverLists) { return; } SwitchObserverList& observer = GetSwitchObserverList(aDevice); if (!observer.RemoveObserver(aObserver) || observer.Length() > 0) { return; } DisableSwitchNotifications(aDevice); ReleaseObserversIfNeeded(); }
void DisableSwitchNotifications(hal::SwitchDevice aDevice) { AssertMainThread(); PROXY_IF_SANDBOXED(DisableSwitchNotifications(aDevice)); }