Bug 1839366 - Add is exported flag when registering receivers.

fenix/117.0
mcarare 11 months ago committed by mergify[bot]
parent 6038b8da8c
commit b942d17b73

@ -8,7 +8,9 @@ import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.BatteryManager
import androidx.core.content.ContextCompat
import mozilla.components.support.base.log.logger.Logger
import mozilla.components.support.utils.ext.registerReceiverCompat
import org.mozilla.fenix.ext.components
import org.mozilla.fenix.onboarding.FenixOnboarding
import android.provider.Settings as AndroidSettings
@ -48,7 +50,12 @@ object Performance {
return false
}
val batteryStatus = context.registerReceiver(null, IntentFilter(Intent.ACTION_BATTERY_CHANGED))
val batteryStatus = context.registerReceiverCompat(
null,
IntentFilter(Intent.ACTION_BATTERY_CHANGED),
ContextCompat.RECEIVER_NOT_EXPORTED,
)
batteryStatus?.let {
// We only run perf tests when the device is connected to USB. However, AC may be reported
// instead if the device is connected through a USB hub so we check both states.

Loading…
Cancel
Save