diff --git a/apps/android/ChangeLog b/apps/android/ChangeLog index e20b30304..1e62173dc 100644 --- a/apps/android/ChangeLog +++ b/apps/android/ChangeLog @@ -37,4 +37,5 @@ 0.35: Implement API to enable/disable acceleration data tracking. 0.36: Move from wrapper function to {} and let - faster execution at boot Allow `calendar-` to take an array of items to remove -0.37: Support Gadgetbridge canned responses \ No newline at end of file +0.37: Support Gadgetbridge canned responses +0.38: Don't rewrite settings file on every boot! \ No newline at end of file diff --git a/apps/android/boot.js b/apps/android/boot.js index 17d4033b1..53cf51ff2 100644 --- a/apps/android/boot.js +++ b/apps/android/boot.js @@ -10,19 +10,15 @@ let gpsState = {}; // keep information on GPS via Gadgetbridge // this settings var is deleted after this executes to save memory - let settings = require("Storage").readJSON("android.settings.json",1)||{}; - //default alarm settings - if (settings.rp == undefined) settings.rp = true; - if (settings.as == undefined) settings.as = true; - if (settings.vibrate == undefined) settings.vibrate = ".."; - require('Storage').writeJSON("android.settings.json", settings); + let settings = Object.assign({rp:true,as:true,vibrate:".."}, + require("Storage").readJSON("android.settings.json",1)||{} + ); let _GB = global.GB; let fetchRecInterval; global.GB = (event) => { // feed a copy to other handlers if there were any if (_GB) setTimeout(_GB,0,Object.assign({},event)); - /* TODO: Call handling, fitness */ var HANDLERS = { // {t:"notify",id:int, src,title,subject,body,sender,tel:string} add diff --git a/apps/android/metadata.json b/apps/android/metadata.json index 210e711f2..b1c3ecfaa 100644 --- a/apps/android/metadata.json +++ b/apps/android/metadata.json @@ -2,7 +2,7 @@ "id": "android", "name": "Android Integration", "shortName": "Android", - "version": "0.37", + "version": "0.38", "description": "Display notifications/music/etc sent from the Gadgetbridge app on Android. This replaces the old 'Gadgetbridge' Bangle.js widget.", "icon": "app.png", "tags": "tool,system,messages,notifications,gadgetbridge",