Search code examples
androiddolby-audio-api

NullPointerException in DsClientManager on Android


I have an app that uses com.dolby.dap.DsClientManager. When running on some Lenovo, Acer and ZTE devices I randomly get a NullPointerException

com.dolby.dap.DsClientManager$DsClientHandlerThread.handleMessage (DsClientManager.java:372)
android.os.Handler.dispatchMessage (Handler.java:106)
android.os.Looper.loop (Looper.java:193)
android.os.HandlerThread.run (HandlerThread.java:61)

Has anyone else seen this issue? Is there a way to fix it?

Please also notice that the exception is not thrown when I call one of the dolby APIs since I'm catching all the Runtime exceptions every time. The exception is thrown asynchronously.


Solution

  • It seems to be a bug in the dolby audio processing library. Apparently there are some devices (e.g., Acer A3-A20 and Lenovo B8000) where the dolby.ds.state system property is present, but nevertheless the dolby audio processing library fails to instantiate the client? When this occurs, the library assumes DS is available, but subsequently fails to instantiate the client and then tries to invoke the .init() method on a null instance.