Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Minidoro crashes when overriding silent mode #5

Open
philkoch opened this issue Jan 6, 2022 · 2 comments
Open

Minidoro crashes when overriding silent mode #5

philkoch opened this issue Jan 6, 2022 · 2 comments
Assignees
Milestone

Comments

@philkoch
Copy link

philkoch commented Jan 6, 2022

I'm using Minidoro on a Fairphone 3 with LineageOS 17 (Android 10 based with micro-G) and when the phone is in silent mode the app crashes silently when the timer runs out. I have the Override Silent Mode option turned on.
It works fine when the Option is turned off.

@MartinX3
Copy link

MartinX3 commented Jan 7, 2022

Same with LineageOS 18.1 (Android 11)

  1. it crashes if the screen is disabled
  2. It crashes if I minimize the app and look at the home screen
    (Switched to homescreen 6 seconds before alarm)
  3. It crashes if I left the app open
01-08 11:37:51.890  7079  7079 D AndroidRuntime: Shutting down VM
--------- beginning of crash
01-08 11:37:51.891  7079  7079 E AndroidRuntime: FATAL EXCEPTION: main
01-08 11:37:51.891  7079  7079 E AndroidRuntime: Process: com.github.ympavlov.minidoro, PID: 7079
01-08 11:37:51.891  7079  7079 E AndroidRuntime: java.lang.SecurityException: Not allowed to change Do Not Disturb state
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.os.Parcel.createExceptionOrNull(Parcel.java:2373)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.os.Parcel.createException(Parcel.java:2357)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:2340)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.os.Parcel.readException(Parcel.java:2282)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.media.IAudioService$Stub$Proxy.setRingerModeExternal(IAudioService.java:2998)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.media.AudioManager.setRingerMode(AudioManager.java:1150)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at com.github.ympavlov.minidoro.dnd.e.a(Unknown Source:13)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at com.github.ympavlov.minidoro.dnd.e.a(Unknown Source:18)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at com.github.ympavlov.minidoro.b.update(Unknown Source:56)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at java.util.Observable.notifyObservers(Observable.java:163)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at java.util.Observable.notifyObservers(Observable.java:115)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at com.github.ympavlov.minidoro.d.n(Unknown Source:38)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at com.github.ympavlov.minidoro.d.a(Unknown Source:14)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at com.github.ympavlov.minidoro.CountDownView.update(Unknown Source:8)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at java.util.Observable.notifyObservers(Observable.java:163)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at com.github.ympavlov.minidoro.g$1.run(Unknown Source:23)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:938)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:223)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7664)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: Caused by: android.os.RemoteException: Remote stack trace:
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at com.android.server.audio.AudioService.setRingerModeExternal(AudioService.java:3485)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.media.IAudioService$Stub.onTransact(IAudioService.java:1322)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.os.Binder.execTransactInternal(Binder.java:1154)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 	at android.os.Binder.execTransact(Binder.java:1123)
01-08 11:37:51.891  7079  7079 E AndroidRuntime: 
01-08 11:37:51.931  7079  7079 I Process : Sending signal. PID: 7079 SIG: 9

The solution is to add the android.permission.ACCESS_NOTIFICATION_POLICY permission in the manifest and to ask and check the permissions at runtime.
https://developer.android.com/training/permissions/requesting

And please start using android jetpack and kotlin instead of java.

@ympavlov ympavlov self-assigned this Jan 9, 2022
@ympavlov ympavlov added this to the 1.14 milestone Aug 22, 2023
@ympavlov ympavlov modified the milestones: 1.14, 1.15 Aug 29, 2023
@ivanruvalcaba
Copy link

Any news on the release of the version that fixes this problem?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants