android - Stop GPS on phone if not activated inside 3 seconds after boot

pull/2473/head
Martin Boonk 2023-01-06 18:37:38 +01:00
parent 46dca3a686
commit 539ea48824
1 changed files with 4 additions and 0 deletions

View File

@ -227,6 +227,10 @@
Bangle.isGPSOn = () => {
return Bangle._PWR && Bangle._PWR.GPS && Bangle._PWR.GPS.length>0;
}
// stop GPS on boot if not activated
setTimeout(()=>{
if (!Bangle.isGPSOn()) gbSend({ t: "gps_power", status: false });
},3000);
}
// remove settings object so it's not taking up RAM