Bug 1382955 (part 3) - Remove a bunch of unused HAL stuff. r=gsvelto,kanru.

This commit is contained in:
Nicholas Nethercote
2017-08-02 10:09:32 +10:00
parent 52785864e7
commit a017a9b988
14 changed files with 6 additions and 660 deletions

View File

@@ -388,58 +388,6 @@ NotifyBatteryChange(const BatteryInformation& aInfo)
BatteryObservers().BroadcastCachedInformation();
}
bool GetScreenEnabled()
{
AssertMainThread();
RETURN_PROXY_IF_SANDBOXED(GetScreenEnabled(), false);
}
void SetScreenEnabled(bool aEnabled)
{
AssertMainThread();
PROXY_IF_SANDBOXED(SetScreenEnabled(aEnabled));
}
bool GetKeyLightEnabled()
{
AssertMainThread();
RETURN_PROXY_IF_SANDBOXED(GetKeyLightEnabled(), false);
}
void SetKeyLightEnabled(bool aEnabled)
{
AssertMainThread();
PROXY_IF_SANDBOXED(SetKeyLightEnabled(aEnabled));
}
bool GetCpuSleepAllowed()
{
// Generally for interfaces that are accessible by normal web content
// we should cache the result and be notified on state changes, like
// what the battery API does. But since this is only used by
// privileged interface, the synchronous getter is OK here.
AssertMainThread();
RETURN_PROXY_IF_SANDBOXED(GetCpuSleepAllowed(), true);
}
void SetCpuSleepAllowed(bool aAllowed)
{
AssertMainThread();
PROXY_IF_SANDBOXED(SetCpuSleepAllowed(aAllowed));
}
double GetScreenBrightness()
{
AssertMainThread();
RETURN_PROXY_IF_SANDBOXED(GetScreenBrightness(), 0);
}
void SetScreenBrightness(double aBrightness)
{
AssertMainThread();
PROXY_IF_SANDBOXED(SetScreenBrightness(clamped(aBrightness, 0.0, 1.0)));
}
class SystemClockChangeObserversManager : public ObserversManager<int64_t>
{
protected:
@@ -527,27 +475,6 @@ AdjustSystemClock(int64_t aDeltaMilliseconds)
PROXY_IF_SANDBOXED(AdjustSystemClock(aDeltaMilliseconds));
}
void
SetTimezone(const nsCString& aTimezoneSpec)
{
AssertMainThread();
PROXY_IF_SANDBOXED(SetTimezone(aTimezoneSpec));
}
int32_t
GetTimezoneOffset()
{
AssertMainThread();
RETURN_PROXY_IF_SANDBOXED(GetTimezoneOffset(), 0);
}
nsCString
GetTimezone()
{
AssertMainThread();
RETURN_PROXY_IF_SANDBOXED(GetTimezone(), nsCString(""));
}
void
EnableSensorNotifications(SensorType aSensor) {
AssertMainThread();
@@ -745,18 +672,6 @@ DisableSwitchNotifications(SwitchDevice aDevice) {
PROXY_IF_SANDBOXED(DisableSwitchNotifications(aDevice));
}
SwitchState GetCurrentSwitchState(SwitchDevice aDevice)
{
AssertMainThread();
RETURN_PROXY_IF_SANDBOXED(GetCurrentSwitchState(aDevice), SWITCH_STATE_UNKNOWN);
}
void NotifySwitchStateFromInputDevice(SwitchDevice aDevice, SwitchState aState)
{
AssertMainThread();
PROXY_IF_SANDBOXED(NotifySwitchStateFromInputDevice(aDevice, aState));
}
typedef mozilla::ObserverList<SwitchEvent> SwitchObserverList;
static SwitchObserverList *sSwitchObserverLists = nullptr;
@@ -905,35 +820,5 @@ StopDiskSpaceWatcher()
PROXY_IF_SANDBOXED(StopDiskSpaceWatcher());
}
uint32_t
GetTotalSystemMemory()
{
return hal_impl::GetTotalSystemMemory();
}
bool IsHeadphoneEventFromInputDev()
{
AssertMainThread();
RETURN_PROXY_IF_SANDBOXED(IsHeadphoneEventFromInputDev(), false);
}
nsresult StartSystemService(const char* aSvcName, const char* aArgs)
{
AssertMainThread();
RETURN_PROXY_IF_SANDBOXED(StartSystemService(aSvcName, aArgs), NS_ERROR_FAILURE);
}
void StopSystemService(const char* aSvcName)
{
AssertMainThread();
PROXY_IF_SANDBOXED(StopSystemService(aSvcName));
}
bool SystemServiceIsRunning(const char* aSvcName)
{
AssertMainThread();
RETURN_PROXY_IF_SANDBOXED(SystemServiceIsRunning(aSvcName), false);
}
} // namespace hal
} // namespace mozilla