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 StrideActivity.cs #2351

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update StrideActivity.cs #2351

wants to merge 1 commit into from

Conversation

Rif009
Copy link

@Rif009 Rif009 commented Jun 24, 2024

PR Details

🐞 Bug Fixes

Related Issue

#2349

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@Rif009
Copy link
Author

Rif009 commented Jun 24, 2024

@Rif009 please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@dotnet-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"

Contributor License Agreement

@dotnet-policy-service agree

@MeharDT
Copy link
Contributor

MeharDT commented Jun 24, 2024

Nice work! I think this is a useful workaround but it might be best to keep the PR open and eventually work in the updated Silk.NET binaries as they contain fixes for this and other Android bugs,

dotnet/Silk.NET#2232

@Basewq
Copy link
Contributor

Basewq commented Jun 24, 2024

I suspect this might only require a NotExported flag rather than a Exported flag.
As per google's docs:
https://developer.android.com/develop/background-work/background-tasks/broadcasts#java

If you flag your receiver with RECEIVER_NOT_EXPORTED, the receiver is able to receive some system broadcasts and broadcasts from your app, but not broadcasts from the highly privileged apps.

I think AudioManager does not fall under 'highly privileged apps', but will definitely test to see if this is the case.

@Eideren Eideren marked this pull request as draft July 6, 2024 11:23
@Rif009 Rif009 marked this pull request as ready for review July 22, 2024 13:03
RegisterReceiver(ringerModeIntentReceiver, new IntentFilter(AudioManager.RingerModeChangedAction));
if (OperatingSystem.IsAndroidVersionAtLeast(34))
{
RegisterReceiver(ringerModeIntentReceiver, new IntentFilter(AudioManager.RingerModeChangedAction), ReceiverFlags.Exported);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have tested this and it looks like it only needs to be ReceiverFlags.NotExported

I suggest you also this whole if-else logic in a single method (eg. something like RegisterRingerReceiver()) so this logic only needs to be modified in one place.

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