I am attempting to write a fitness application that incorporates Google Fit. The app is related to a wearable that tracks basic step count. In our test harness in Android Studio we have the following related service that is started automatically by the Android OS.
From manifest of Android Studio Project Test-App:
<service android:name=".lggfit.LgGoogleFitSensor"
android:label="LgGoogleFitSensor"
android:exported="true"
android:enabled="true"
android:process=":sensor">
<intent-filter>
<action android:name="com.google.android.gms.fitness.service.FitnessSensorService" />
<data android:mimeType="vnd.google.fitness.data_type/com.google.step_count.delta" />
</intent-filter>
</service>
This does start the service which is then used by the app in other code to send step counts to the Google Fit app (FitnessSensorService). However, attempting to start the same service from the Unity App results in the service not being started.
From manifest of Unity Project:
<service android:name="com.sensorstar.stephen.lgbluetoothlib.lggfit.LgGoogleFitSensor"
android:label="LgGoogleFitSensorService"
android:enabled="true"
android:exported="true"
android:process=":sensor">
<intent-filter>
<action android:name="com.google.android.gms.fitness.service.FitnessSensorService" />
<data android:mimeType="vnd.google.fitness.data_type/com.google.step_count.delta" />
</intent-filter>
</service>
After poking around a few days, attempting to do what I can to rule out various components, even going as far as generating a Unity-Android Studio project and ripping out everything but a few key files; I am still at a lost as to why the service is not being started.
My question: Is there something with Unity that prevents OS-started services from running? Or something incompatible between Unity and the way the FitnessSensorService works?