ignore false positive warning wrt foreground service

This commit is contained in:
Daniel Gultsch 2023-10-20 20:57:44 +02:00
parent 35c8d31d42
commit e83a0af277
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
2 changed files with 4 additions and 1 deletions

View file

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

View file

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