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

Update AGP to 8.1.1 #1656

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,28 @@

package com.datadog.android.core.internal.receiver

import android.annotation.SuppressLint
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Build
import java.util.concurrent.atomic.AtomicBoolean

internal abstract class ThreadSafeReceiver : BroadcastReceiver() {

val isRegistered = AtomicBoolean(false)

@SuppressLint("UnspecifiedRegisterReceiverFlag")
fun registerReceiver(
context: Context,
filter: IntentFilter
): Intent? {
val intent = context.registerReceiver(this, filter)
val intent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
context.registerReceiver(this, filter, Context.RECEIVER_NOT_EXPORTED)
} else {
context.registerReceiver(this, filter)
}
isRegistered.set(true)
return intent
}
Expand Down
1 change: 1 addition & 0 deletions detekt_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ datadog:
- "android.content.Context.getSystemService(kotlin.String)"
- "android.content.Context.registerComponentCallbacks(android.content.ComponentCallbacks)"
- "android.content.Context.registerReceiver(android.content.BroadcastReceiver?, android.content.IntentFilter)"
- "android.content.Context.registerReceiver(android.content.BroadcastReceiver?, android.content.IntentFilter, kotlin.Int)"
- "android.content.Context.unregisterReceiver(android.content.BroadcastReceiver)"
- "android.content.Intent.getBooleanExtra(kotlin.String, kotlin.Boolean)"
- "android.content.Intent.getIntExtra(kotlin.String, kotlin.Int)"
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ okHttp = "4.11.0"
kronosNTP = "0.0.1-alpha11"

# Android
androidToolsPlugin = "8.0.2"
androidToolsPlugin = "8.1.1"
androidXAnnotations = "1.1.0"
androidXAppCompat = "1.3.0"
androidXCore = "1.3.1"
Expand Down
Loading