Loading hal/Hal.cpp +14 −13 Original line number Diff line number Diff line Loading @@ -406,37 +406,38 @@ bool GetLight(LightType light, hal::LightConfiguration* aConfig) RETURN_PROXY_IF_SANDBOXED(GetLight(light, aConfig)); } static StaticAutoPtr<ObserverList<SystemTimeChange> > sSystemTimeObservers; static void InitializeSystemTimeChangeObserver() class SystemTimeObserversManager : public ObserversManager<SystemTimeChange> { if (!sSystemTimeObservers) { sSystemTimeObservers = new ObserverList<SystemTimeChange>; ClearOnShutdown(&sSystemTimeObservers); protected: void EnableNotifications() { PROXY_IF_SANDBOXED(EnableSystemTimeChangeNotifications()); } void DisableNotifications() { PROXY_IF_SANDBOXED(DisableSystemTimeChangeNotifications()); } }; static SystemTimeObserversManager sSystemTimeObservers; void RegisterSystemTimeChangeObserver(SystemTimeObserver *aObserver) { AssertMainThread(); InitializeSystemTimeChangeObserver(); sSystemTimeObservers->AddObserver(aObserver); sSystemTimeObservers.AddObserver(aObserver); } void UnregisterSystemTimeChangeObserver(SystemTimeObserver *aObserver) { AssertMainThread(); sSystemTimeObservers->RemoveObserver(aObserver); sSystemTimeObservers.RemoveObserver(aObserver); } void NotifySystemTimeChange(const hal::SystemTimeChange& aReason) { InitializeSystemTimeChangeObserver(); sSystemTimeObservers->Broadcast(aReason); sSystemTimeObservers.BroadcastInformation(aReason); } void Loading hal/HalInternal.h +10 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,16 @@ bool EnableAlarm(); */ void DisableAlarm(); /** * Enable system time change notifications from the backend. */ void EnableSystemTimeChangeNotifications(); /** * Disable system time change notifications from the backend. */ void DisableSystemTimeChangeNotifications(); } // namespace MOZ_HAL_NAMESPACE } // namespace mozilla Loading hal/fallback/FallbackTime.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -24,5 +24,14 @@ GetTimezone() return EmptyCString(); } void EnableSystemTimeChangeNotifications() { } void DisableSystemTimeChangeNotifications() { } } // namespace hal_impl } // namespace mozilla hal/gonk/GonkHal.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -670,6 +670,16 @@ GetTimezone() return nsCString(timezone); } void EnableSystemTimeChangeNotifications() { } void DisableSystemTimeChangeNotifications() { } // Nothing to do here. Gonk widgetry always listens for screen // orientation changes. void Loading hal/sandbox/PHal.ipdl +2 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,8 @@ parent: SetTimezone(nsCString aTimezoneSpec); sync GetTimezone() returns (nsCString aTimezoneSpec); EnableSystemTimeChangeNotifications(); DisableSystemTimeChangeNotifications(); sync SetLight(LightType light, LightConfiguration aConfig) returns (bool status); Loading Loading
hal/Hal.cpp +14 −13 Original line number Diff line number Diff line Loading @@ -406,37 +406,38 @@ bool GetLight(LightType light, hal::LightConfiguration* aConfig) RETURN_PROXY_IF_SANDBOXED(GetLight(light, aConfig)); } static StaticAutoPtr<ObserverList<SystemTimeChange> > sSystemTimeObservers; static void InitializeSystemTimeChangeObserver() class SystemTimeObserversManager : public ObserversManager<SystemTimeChange> { if (!sSystemTimeObservers) { sSystemTimeObservers = new ObserverList<SystemTimeChange>; ClearOnShutdown(&sSystemTimeObservers); protected: void EnableNotifications() { PROXY_IF_SANDBOXED(EnableSystemTimeChangeNotifications()); } void DisableNotifications() { PROXY_IF_SANDBOXED(DisableSystemTimeChangeNotifications()); } }; static SystemTimeObserversManager sSystemTimeObservers; void RegisterSystemTimeChangeObserver(SystemTimeObserver *aObserver) { AssertMainThread(); InitializeSystemTimeChangeObserver(); sSystemTimeObservers->AddObserver(aObserver); sSystemTimeObservers.AddObserver(aObserver); } void UnregisterSystemTimeChangeObserver(SystemTimeObserver *aObserver) { AssertMainThread(); sSystemTimeObservers->RemoveObserver(aObserver); sSystemTimeObservers.RemoveObserver(aObserver); } void NotifySystemTimeChange(const hal::SystemTimeChange& aReason) { InitializeSystemTimeChangeObserver(); sSystemTimeObservers->Broadcast(aReason); sSystemTimeObservers.BroadcastInformation(aReason); } void Loading
hal/HalInternal.h +10 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,16 @@ bool EnableAlarm(); */ void DisableAlarm(); /** * Enable system time change notifications from the backend. */ void EnableSystemTimeChangeNotifications(); /** * Disable system time change notifications from the backend. */ void DisableSystemTimeChangeNotifications(); } // namespace MOZ_HAL_NAMESPACE } // namespace mozilla Loading
hal/fallback/FallbackTime.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -24,5 +24,14 @@ GetTimezone() return EmptyCString(); } void EnableSystemTimeChangeNotifications() { } void DisableSystemTimeChangeNotifications() { } } // namespace hal_impl } // namespace mozilla
hal/gonk/GonkHal.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -670,6 +670,16 @@ GetTimezone() return nsCString(timezone); } void EnableSystemTimeChangeNotifications() { } void DisableSystemTimeChangeNotifications() { } // Nothing to do here. Gonk widgetry always listens for screen // orientation changes. void Loading
hal/sandbox/PHal.ipdl +2 −0 Original line number Diff line number Diff line Loading @@ -135,6 +135,8 @@ parent: SetTimezone(nsCString aTimezoneSpec); sync GetTimezone() returns (nsCString aTimezoneSpec); EnableSystemTimeChangeNotifications(); DisableSystemTimeChangeNotifications(); sync SetLight(LightType light, LightConfiguration aConfig) returns (bool status); Loading