From e5f6ea674f880520784a3040cf32d9b7a06eb06c Mon Sep 17 00:00:00 2001 From: Martin Boonk Date: Sat, 14 Jan 2023 09:25:05 +0100 Subject: [PATCH] android - Use handler method to switch to internal GPS when Serial is accessed --- apps/android/boot.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/android/boot.js b/apps/android/boot.js index 412f27a69..fa1beacd2 100644 --- a/apps/android/boot.js +++ b/apps/android/boot.js @@ -225,12 +225,12 @@ let wrap = function(f){ return (s)=>{ if (serialTimeout) clearTimeout(serialTimeout); - origSetGPSPower(1,"android_gpsserial"); + handleConnection(1); f(s); serialTimeout = setTimeout(()=>{ serialTimeout = undefined; - origSetGPSPower(0,"android_gpsserial"); - },5000); + if (NRF.getSecurityStatus().connected) handleConnection(0); + }, 10000); }; }; Serial1.println = wrap(Serial1.println); @@ -238,7 +238,6 @@ // Replace set GPS power logic to suppress activation of gps (and instead request it from the phone) Bangle.setGPSPower = (isOn, appID) => { - // disable our own request for GPS power first and always // if not connected use internal GPS power function if (!NRF.getSecurityStatus().connected) return origSetGPSPower(isOn, appID); if (!Bangle._PWR) Bangle._PWR={};