зеркало из https://github.com/mozilla/gecko-dev.git
Bug 790393 - Add MozPower.factoryReset() for factory reset. r=cjones, r=vingtetun, sr=sicking
This commit is contained in:
Родитель
edf634a604
Коммит
e818a85bc7
|
@ -16,6 +16,10 @@
|
|||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsError.h"
|
||||
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
#include "b2g.h"
|
||||
#endif
|
||||
|
||||
DOMCI_DATA(MozPowerManager, mozilla::dom::power::PowerManager)
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -70,6 +74,21 @@ PowerManager::Reboot()
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PowerManager::FactoryReset()
|
||||
{
|
||||
#ifdef MOZ_WIDGET_GONK
|
||||
nsCOMPtr<nsIRecoveryService> recoveryService =
|
||||
do_GetService("@mozilla.org/recovery-service;1");
|
||||
NS_ENSURE_STATE(recoveryService);
|
||||
|
||||
recoveryService->FactoryReset();
|
||||
return NS_OK;
|
||||
#else
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PowerManager::PowerOff()
|
||||
{
|
||||
|
|
|
@ -10,11 +10,12 @@ interface nsIDOMMozWakeLockListener;
|
|||
/**
|
||||
* This interface implements navigator.mozPower
|
||||
*/
|
||||
[scriptable, uuid(256a3287-f528-45b5-9ba8-2b3650c056e6)]
|
||||
[scriptable, uuid(7b181fef-2757-4198-89a0-8c426b8439ea)]
|
||||
interface nsIDOMMozPowerManager : nsISupports
|
||||
{
|
||||
void powerOff();
|
||||
void reboot();
|
||||
void factoryReset();
|
||||
|
||||
/**
|
||||
* The listeners are notified when a resource changes its lock state to:
|
||||
|
|
|
@ -173,6 +173,11 @@ ifdef ENABLE_TESTS
|
|||
tier_platform_dirs += testing/specialpowers
|
||||
endif
|
||||
|
||||
# b2g headers need to be built before dom headers
|
||||
ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
|
||||
tier_platform_dirs += b2g
|
||||
endif
|
||||
|
||||
tier_platform_dirs += \
|
||||
uriloader \
|
||||
caps \
|
||||
|
|
Загрузка…
Ссылка в новой задаче