Bug 794188: Check the fmradio permission at process boundaries. r=jlebar
authorChris Jones <jones.chris.g@gmail.com>
Sat, 29 Sep 2012 15:09:19 -0700
changeset 108771 ffa6a1423baf065501f94ab84f18b64597c1dccb
parent 108758 72e03ee74f40c90f4d646000b0983ec3f3724efb
child 108772 6676711a510bed4692e70a2516546952689977ae
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersjlebar
bugs794188
milestone18.0a1
Bug 794188: Check the fmradio permission at process boundaries. r=jlebar
hal/sandbox/SandboxHal.cpp
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -731,77 +731,104 @@ public:
   void Notify(const SystemTimeChange& aReason)
   {
     unused << SendNotifySystemTimeChange(aReason);
   }
 
   virtual bool
   RecvEnableFMRadio(const hal::FMRadioSettings& aSettings)
   {
+    if (!AssertAppProcessPermission(this, "fmradio")) {
+      return false;
+    }
     hal::EnableFMRadio(aSettings);
     return true;
   }
 
   virtual bool
   RecvDisableFMRadio()
   {
+    if (!AssertAppProcessPermission(this, "fmradio")) {
+      return false;
+    }
     hal::DisableFMRadio();
     return true;
   }
 
   virtual bool
   RecvFMRadioSeek(const hal::FMRadioSeekDirection& aDirection)
   {
+    if (!AssertAppProcessPermission(this, "fmradio")) {
+      return false;
+    }
     hal::FMRadioSeek(aDirection);
     return true;
   }
 
   virtual bool
   RecvGetFMRadioSettings(hal::FMRadioSettings* aSettings)
   {
+    if (!AssertAppProcessPermission(this, "fmradio")) {
+      return false;
+    }
     hal::GetFMRadioSettings(aSettings);
     return true;
   }
 
   virtual bool
   RecvSetFMRadioFrequency(const uint32_t& aFrequency)
   {
+    if (!AssertAppProcessPermission(this, "fmradio")) {
+      return false;
+    }
     hal::SetFMRadioFrequency(aFrequency);
     return true;
   }
 
   virtual bool
   RecvGetFMRadioFrequency(uint32_t* aFrequency)
   {
+    if (!AssertAppProcessPermission(this, "fmradio")) {
+      return false;
+    }
     *aFrequency = hal::GetFMRadioFrequency();
     return true;
   }
 
   void Notify(const hal::FMRadioOperationInformation& aRadioStatus)
   {
     unused << SendNotifyFMRadioStatus(aRadioStatus);
   }
 
   virtual bool
   RecvIsFMRadioOn(bool* radioOn)
   {
+    if (!AssertAppProcessPermission(this, "fmradio")) {
+      return false;
+    }
     *radioOn = hal::IsFMRadioOn();
     return true;
   }
 
   virtual bool
   RecvGetFMRadioSignalStrength(uint32_t* strength)
   {
+    if (!AssertAppProcessPermission(this, "fmradio")) {
+      return false;
+    }
     *strength = hal::GetFMRadioSignalStrength();
     return true;
   }
 
   virtual bool
   RecvCancelFMRadioSeek()
   {
+    if (!AssertAppProcessPermission(this, "fmradio")) {
+      return false;
+    }
     hal::CancelFMRadioSeek();
     return true;
   }
 };
 
 class HalChild : public PHalChild {
 public:
   virtual bool