ignore false positive warning wrt foreground service

This commit is contained in:
Daniel Gultsch 2023-10-20 20:57:44 +02:00 committed by Arne
parent 8b7d140b94
commit 3da22a8b1b
2 changed files with 11 additions and 1 deletions

View file

@ -141,7 +141,16 @@
android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc" />
<service android:name=".services.XmppConnectionService" />
<!-- The warning that systemExempted requires alarm permission is incorrect because doze white list is sufficient -->
<service
android:name=".services.XmppConnectionService"
android:exported="false"
android:foregroundServiceType="specialUse|systemExempted|microphone|camera"
tools:ignore="ForegroundServicePermission">
<property
android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="im" />
</service>
<receiver android:name=".services.EventReceiver"
android:exported="false">

View file

@ -1914,6 +1914,7 @@ public class XmppConnectionService extends Service {
foregroundServiceType = ServiceInfo.FOREGROUND_SERVICE_TYPE_CAMERA;
} else {
foregroundServiceType = ServiceInfo.FOREGROUND_SERVICE_TYPE_SPECIAL_USE;
Log.w(Config.LOGTAG,"falling back to special use foreground service type");
}
startForeground(id, notification, foregroundServiceType);
} else {