With Android Wear 3.2 OS update, the Accelerometer Sensor Data gets paused when the Screen goes off.
- I have used Foreground Service and declared its permission in the manifest.
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
- 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.
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