aws-amplify / aws-sdk-android

AWS SDK for Android. For more information, see our web site:
https://docs.amplify.aws
Other
1.03k stars 549 forks source link

Set the ForegroundServiceType for TransferService #3620

Closed mattcreaser closed 4 months ago

mattcreaser commented 4 months ago

Issue #, if available:

3617

Description of changes: Starting on API 34, foreground services must supply a foreground service type. Our service type is data sync, which corresponds to a service that uploads or downloads data.

In addition to supplying this type in code, customers must make some changes to their application manifest:

The manifest should look something like this:

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC"/>

    <application>
        <service
            android:name="com.amazonaws.mobileconnectors.s3.transferutility.TransferService"
            android:foregroundServiceType="dataSync" />

    </application>

A corresponding docs PR is here.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.