Skip to content

Commit

Permalink
battery optimization; remove aod permission
Browse files Browse the repository at this point in the history
  • Loading branch information
alicescfernandes committed Jan 19, 2021
1 parent 36db9f0 commit 3e6ac36
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 11 deletions.
Binary file added .DS_Store
Binary file not shown.
23 changes: 12 additions & 11 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,27 @@ function renderFace() {

hrm.start();
} else {
weather_element.style.display = 'none';
heart_rate_element.style.display = 'none';
if (display.aodActive) {
weather_element.style.display = 'none';
heart_rate_element.style.display = 'none';

battery_level_element.x = 90;
battery_level_element.y = 32;
battery_level_element.x = 90;
battery_level_element.y = 32;

messaging.peerSocket.removeEventListener('open', startCompanionConnection);
messaging.peerSocket.removeEventListener('message', parseWeatherData);
closeCompanionConnection();
}

messaging.peerSocket.removeEventListener('open', startCompanionConnection);
messaging.peerSocket.removeEventListener('message', parseWeatherData);
closeCompanionConnection();
hrm.stop();
}
}

if (display.aodAvailable && me.permissions.granted('access_aod')) {
display.aodAllowed = true;
renderFace();
display.addEventListener('change', renderFace);
}

//Events
renderFace();
display.addEventListener('change', renderFace);

//Change heart rate sensor
hrm.addEventListener('reading', () => {
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
"iconFile": "resources/icon.png",
"wipeColor": "",
"requestedPermissions": [
"access_internet",
"run_background",
"access_heart_rate",
"access_location"
],
"requestedPermissions2": [
"access_internet",
"run_background",
"access_heart_rate",
Expand Down
Binary file added resources/images/13d.ol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/13d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/13n.ol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/13n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/50d.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/images/50n.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3e6ac36

Please sign in to comment.