diff --git a/sources/engine/Stride.Games/Starter/StrideActivity.cs b/sources/engine/Stride.Games/Starter/StrideActivity.cs index 0e0cb383b0..f8ee6d0b2b 100644 --- a/sources/engine/Stride.Games/Starter/StrideActivity.cs +++ b/sources/engine/Stride.Games/Starter/StrideActivity.cs @@ -40,7 +40,15 @@ protected override void OnRun() { // set up a listener to the android ringer mode (Normal/Silent/Vibrate) ringerModeIntentReceiver = new RingerModeIntentReceiver((AudioManager)GetSystemService(AudioService)); - RegisterReceiver(ringerModeIntentReceiver, new IntentFilter(AudioManager.RingerModeChangedAction)); + if (OperatingSystem.IsAndroidVersionAtLeast(34)) + { + RegisterReceiver(ringerModeIntentReceiver, new IntentFilter(AudioManager.RingerModeChangedAction), ReceiverFlags.Exported); + } + else + { + RegisterReceiver(ringerModeIntentReceiver, new IntentFilter(AudioManager.RingerModeChangedAction)); + } + // Set the android global context if (PlatformAndroid.Context == null) @@ -70,7 +78,14 @@ protected override void OnResume() { base.OnResume(); - RegisterReceiver(ringerModeIntentReceiver, new IntentFilter(AudioManager.RingerModeChangedAction)); + if (OperatingSystem.IsAndroidVersionAtLeast(34)) + { + RegisterReceiver(ringerModeIntentReceiver, new IntentFilter(AudioManager.RingerModeChangedAction), ReceiverFlags.Exported); + } + else + { + RegisterReceiver(ringerModeIntentReceiver, new IntentFilter(AudioManager.RingerModeChangedAction)); + } } ///