SipManager cannot create SipService. Cannot Bind Context.SIP_SERVICE in Nougat

别来无恙 提交于 2019-12-11 05:11:51

问题


I have an application that uses SipManager to open a SIP profile. I have no difficulties opening the SIP profile on my older(KitKat) device, but my new(Nougat) device throws the a SipException "SipService is dead and is restarting..."

Stepping through the SipManager reveals that 'createSipService' is not binding 'Context.SIP_SERVICE'.

I found this post, which seems to be the same issue.

Does anyone know what changed between KitKat and Nougat that would cause such an error, and what I can do to resolve it?

UPDATE

This is the Exception I get when trying to run mySipManager.open(mSipProfile, pendingIntent, null);

`

W/System.err: android.net.sip.SipException: SipService is dead and is restarting...
W/System.err:     at android.net.sip.SipManager.checkSipServiceConnection(SipManager.java:183)
                  at android.net.sip.SipManager.open(SipManager.java:244)
W/System.err:     at com.example.angrinord.myApplication.MyApplication.refreshSipManager(MyApplication.java:59)
                  at com.example.angrinord.myApplication.MyApplication.onCreate(MyApplication.java:41)
W/System.err:     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1032)
                  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6017)
W/System.err:     at android.app.ActivityThread.-wrap3(ActivityThread.java)
W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1727)
                  at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err:     at android.os.Looper.loop(Looper.java:154)
                  at android.app.ActivityThread.main(ActivityThread.java:6823)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1557)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445

)`

This happens on running .open() and .close().

UPDATE 2

I just bought a Pixel 3 (Android 9) and it does not have the issue. I can't speak for 5,6, or 8, but this maybe a bug with 7, as both 4 and 9 do not have the issue.


回答1:


Is Wifi Calling enabled (or can be enabled) on your device?

I have the same issue with an Asus (model X00PD), android is 8.0.

SipManager.IsApiSupported() and SipManager.IsVoipSupported() both return true, however, if I view services under Developer options, Wifi Calling is not running, and the Asus ui disables the option to enable it.

To contrast the Wifi-Calling service is running on my S8 (also 8.0), by default. Same with an older S6(7.0) and a Nokia 6.1(8.1).



来源:https://stackoverflow.com/questions/52844496/sipmanager-cannot-create-sipservice-cannot-bind-context-sip-service-in-nougat

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!