From 865cde52fe62a8ede8cb0330dc98c658389ff6bb Mon Sep 17 00:00:00 2001 From: Max Bassett Date: Tue, 9 Aug 2016 11:02:15 -0400 Subject: [PATCH] [Android Only] Added 'isDeviceIdleMode' function --- www/powermanagement.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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();