3

With Android Wear 3.2 OS update, the Accelerometer Sensor Data gets paused when the Screen goes off.

  1. I have used Foreground Service and declared its permission in the manifest.

<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

  1. I have also used Partial Wake Lock and declared its permission in the manifest.

<uses-permission android:name="android.permission.WAKE_LOCK"/>

Until Android Wear OS 3.0, Sensor data was coming up continuously in all cases including Screen Off.

But after updating Wear OS to 3.2, it broke and it works only when the screen is ON. I also observed below logs: A) When Screen goes OFF: PARTIAL_WAKE_LOCK 'MyApp::Monitoring' DISABLED disabled -> true

B) When Screen goes ON, sensor data comes through: PARTIAL_WAKE_LOCK 'MyApp::Monitoring' DISABLED disabled -> false

Please suggest the solution.

I have checked Sensor documentation and as per that, Foreground Service should be enough to get continuous data.

  • Having the same problem, thank you for clearing that it happens since version 3.2. I'd suggest adding tags like wear-os, wakelock, power-management – Luke B. Apr 05 '22 at 08:39
  • Thanks for the suggestion. It allows only 5 tags. Could you please share what all things you have tried for continuous sensor data? – user7352767 Apr 06 '22 at 09:41
  • Unfortunately I have nothing more than what you said to add. I started this issue, if you have something to add or want to make them know you have the same issue, you're welcome: https://issuetracker.google.com/u/1/issues/228086086 – Luke B. Apr 13 '22 at 11:48

2 Answers2

0

A coworker of mine found something that seems to work, open the 'Wear' app on the smartphone connected to the watch and activate this: Watch settings > Apps > your app > Allow background activity

Luke B.
  • 127
  • 7
0

WakeLock's not working was a bug, and has been fixed by Google. Here was the issue tracker: https://issuetracker.google.com/issues/228086086

WiscoApps
  • 1
  • 3