Skip to content

Commit

Permalink
FOREGROUND_SERVICE_DATA_SYNCパーミッションの宣言と使用
Browse files Browse the repository at this point in the history
  • Loading branch information
tateisu committed Aug 17, 2023
1 parent 56f18e3 commit 3e5ba6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@

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

<!-- CAMERAパーミッションをつけるとPlayストアにプライバシーポリシーを記載する必要がある -->
<!--<uses-permission android:name="android.permission.CAMERA"/>-->
Expand Down Expand Up @@ -411,5 +412,11 @@
</intent-filter>
</receiver>
<receiver android:name="jp.juggler.subwaytooter.notification.NotificationDeleteReceiver" />

<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="dataSync"
tools:node="merge" />

</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ enum class NotificationChannels(
setWhen(System.currentTimeMillis())
setOngoing(true)
}
val useForegroundServiceType = false
return if (useForegroundServiceType && Build.VERSION.SDK_INT >= 34) {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
ForegroundInfo(
nc.notificationId,
builder.build(),
Expand Down

0 comments on commit 3e5ba6b

Please sign in to comment.