diff --git a/www/powermanagement.js b/www/powermanagement.js index 35e0a1f..e9c93fc 100644 --- a/www/powermanagement.js +++ b/www/powermanagement.js @@ -58,4 +58,16 @@ PowerManagement.prototype.dim = function(successCallback,failureCallback) { cordova.exec(successCallback, failureCallback, 'PowerManagement', 'acquire', [true]); } +/** + * Checks the device's idle state. Android Only. + * *** Requires minimum API level 23 *** + * + * @param successCallback function to be called when the device's idle state returns successfully + * @param errorCallback function to be called when there was a problem with checking the device's idle state + */ + +PowerManagement.prototype.isDeviceIdleMode = function(successCallback,failureCallback) { + cordova.exec(successCallback, failureCallback, 'PowerManagement', 'isDeviceIdleMode', []); +} + module.exports = new PowerManagement();