Set foreground service type to SIM contact import
Bug: 257270313
Test: Manual test, importing a sim contact
SIM contact can be created with:
$ adb shell content insert --uri content://icc/adn --bind 'tag:s:SimContact'-$RANDOM --bind number:s:1555555555
Make sure the following logs were printed:
I ActivityManager: Short FGS started: ServiceRecord{5d3dc75 u0 com.android.contacts/.vcard.VCardService}
I ActivityManager: Stop short FGS timeout: ServiceRecord{5d3dc75 u0 com.android.contacts/.vcard.VCardService}
Note they show up because ActiveServices.DEBUG_SHORT_SERVICE is true.
Then wait for two minutes and make sure the app wouldn't get ANRed.
Change-Id: I111760ca57e7b02ccc29c6a1081e704d8f610aec
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 0e59458..e161556 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -474,7 +474,8 @@
<!-- Service to import contacts from the SIM card -->
<service
android:name=".SimImportService"
- android:exported="false"/>
+ android:exported="false"
+ android:foregroundServiceType="shortService" />
<!-- Attaches a photo to a contact. Started from external applications -->
<activity