Use full wakelock instead of partial
This commit is contained in:
parent
4c5a999f34
commit
6b1f3a1486
@ -74,10 +74,10 @@ function initCordova() {
|
|||||||
|
|
||||||
document.addEventListener("deviceready", function () {
|
document.addEventListener("deviceready", function () {
|
||||||
if (localStorage.getItem("wakelock") == "true") {
|
if (localStorage.getItem("wakelock") == "true") {
|
||||||
window.powerManagement.dim(function () {
|
window.powerManagement.acquire(function () {
|
||||||
console.log('Partial wakelock acquired');
|
console.log('Wakelock acquired');
|
||||||
}, function () {
|
}, function () {
|
||||||
console.log('Failed to acquire partial wakelock');
|
console.log('Failed to acquire wakelock');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
window.powerManagement.release(function () {
|
window.powerManagement.release(function () {
|
||||||
|
@ -24,10 +24,10 @@ $('.item-content[data-setting=wakelock] .toggle input').on("change", function ()
|
|||||||
|
|
||||||
if (platform_type == "cordova") {
|
if (platform_type == "cordova") {
|
||||||
if (localStorage.getItem("wakelock") == "true") {
|
if (localStorage.getItem("wakelock") == "true") {
|
||||||
window.powerManagement.dim(function () {
|
window.powerManagement.acquire(function () {
|
||||||
console.log('Partial wakelock acquired');
|
console.log('Wakelock acquired');
|
||||||
}, function () {
|
}, function () {
|
||||||
console.log('Failed to acquire partial wakelock');
|
console.log('Failed to acquire wakelock');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
window.powerManagement.release(function () {
|
window.powerManagement.release(function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user