Add wakeUp and unlock functions

This commit is contained in:
Sebastián Katzer
2017-02-10 13:10:46 +01:00
parent ff9f06382f
commit 0f94708c7a
6 changed files with 162 additions and 27 deletions

View File

@@ -196,6 +196,28 @@ exports.isScreenOff = function (fn) {
}
};
/**
* Wake up the device.
*
* @return [ Void ]
*/
exports.wakeUp = function () {
if (this._isAndroid) {
cordova.exec(null, null, 'BackgroundMode', 'wakeup', []);
}
};
/**
* Wake up and unlock the device.
*
* @return [ Void ]
*/
exports.unlock = function () {
if (this._isAndroid) {
cordova.exec(null, null, 'BackgroundMode', 'unlock', []);
}
};
/**
* If the mode is enabled or disabled.
*