Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the ForegroundServiceType for TransferService #3620

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

mattcreaser
Copy link
Member

@mattcreaser mattcreaser commented Jul 26, 2024

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:

  • Add the service type permission
  • Add the service type to the service declaration

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.

@mattcreaser mattcreaser merged commit d46434f into main Jul 29, 2024
1 check passed
@mattcreaser mattcreaser deleted the mattcreaser/foreground-service-type branch July 29, 2024 12:50
@mattcreaser mattcreaser restored the mattcreaser/foreground-service-type branch July 29, 2024 12:50
@mattcreaser mattcreaser deleted the mattcreaser/foreground-service-type branch July 29, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants