Android Question Get Ringer Mode don't go fine

CapReed

Member
Licensed User
Good afternoon,

I have a somewhat strange problem. The application I'm developing capture phone calls. When a call immediately the phone is muted, then see who calls and the volume should vary depending on who is calling.

That's what I want, but all I get is silence that is put in to receive the call, but can not get the volume as the top goes down, if necessary.

This is a piece of my code


B4X:
Sub PE_PhoneStateChanged(State As String, IncomingNumber As String, Intent As Intent)
'Call Incoming
ModoAntiguo = P.GetRingerMode
Log("Modo Actual: " &  P.GetRingerMode)
p.setringermode (p.RINGER_SILENT)
.'analyze callers
.
.
.
.
' if a good caller then ...
P.SetRingerMode(ModoAntiguo) ' Restore ringer volume ' THIS IS DONT GO.
DoEvents

Can you help?

Thank you very much!
 
Last edited:

CapReed

Member
Licensed User
Thanks for answering.

I have verified that the code runs correctly. Everything works perfectly if the phone is on the active screen. A call is received, the volume is muted, check if you have to change or not change the volume, and do it correctly.

But if the phone has the screen off, the process does not work. First off the volume, it checks the caller, but below the volume is NOT active.

Also, if you have the screen off, I get this error in the log:

ProcessState dead: name=com.android.systemui pkg=com.android.keyguard uid=10007 common.name=com.android.systemui


android.util.Log$TerribleFailure: ProcessState dead: name=com.android.systemui pkg=com.android.keyguard uid=10007 common.name=com.android.systemui
at android.util.Log.wtf(Log.java:290)
at android.util.Slog.wtfStack(Slog.java:86)
at com.android.internal.app.ProcessStats$ProcessState.ensureNotDead(ProcessStats.java:2495)
at com.android.internal.app.ProcessStats$ProcessState.setState(ProcessStats.java:2593)
at com.android.internal.app.ProcessStats$ProcessState.setState(ProcessStats.java:2578)
at com.android.server.am.ActivityManagerService.setProcessTrackerState(ActivityManagerService.java:15348)
at com.android.server.am.ActivityManagerService.updateOomAdjLocked(ActivityManagerService.java:15722)
at com.android.server.am.ActivityStack.destroyActivityLocked(ActivityStack.java:2803)
at com.android.server.am.ActivityStack.finishCurrentActivityLocked(ActivityStack.java:2517)
at com.android.server.am.ActivityStackSupervisor.activityIdleInternalLocked(ActivityStackSupervisor.java:1906)


at com.android.server.am.ActivityStackSupervisor$ActivityStackSupervisorHandler.activityIdleInternal(ActivityStackSupervisor.java:2592)
at com.android.server.am.ActivityStackSupervisor$ActivityStackSupervisorHandler.handleMessage(ActivityStackSupervisor.java:2614)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1870)

With what I think the problem stems from here. (maybe it has nothing to do ...)

;) I really am very concerned to read TerribleFailure ... had never had a terrible failure ... :p

Thank you for your atention.
 
Last edited:
Upvote 0
Top