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

Ringer mode issues #2

Open
gaelmarhic opened this issue May 21, 2017 · 3 comments
Open

Ringer mode issues #2

gaelmarhic opened this issue May 21, 2017 · 3 comments

Comments

@gaelmarhic
Copy link

gaelmarhic commented May 21, 2017

Hi!

When trying this solution final code on my phone (running with Android N), I ran into some issues which made the app crash:

  1. Some packages in the GeofenceBroadcastReceiver file have not been imported, so that it does not let compile.

  2. The permission for the ACCESS NOTIFICATION POLICY is not present in the Manifest.xml file.

  1. Since when we want to change the Ringer mode we want to make sure that Notification Policy Access is granted (in case our SDK is 24 or greater), I think the appropriate code should be:

if (android.os.Build.VERSION.SDK_INT < 24 ||
(android.os.Build.VERSION.SDK_INT >= 24 && nm.isNotificationPolicyAccessGranted()))
...

and not
if (android.os.Build.VERSION.SDK_INT < 24 ||
(android.os.Build.VERSION.SDK_INT >= 24 && !nm.isNotificationPolicyAccessGranted()))
...

I actually removed the "!", since in the current version of the code we try to change the Ringer mode status when the permission is not granted...

Thanks for your great tutorials guys!

Kind regards,

Gaël

@dharanad
Copy link

Add <uses-permission android:name="android.permission.ACCESS_NOTIFICATION_POLICY"/> in the manifest file.

@hrishikesh-kadam
Copy link

All bugs fixed in - #12

@moharidy
Copy link

moharidy commented Oct 8, 2018

thanks all but i still have an issue with the ringer issue, when the geofences switch is disabled the silent mode does not get disabled and the phone still continue on silent mode? any suggestion ?

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

No branches or pull requests

4 participants