From 638926d3f594e8e8a8a764ead6768a1a8ca10aad Mon Sep 17 00:00:00 2001 From: Tim Schneeberger Date: Tue, 11 Oct 2022 15:17:26 +0200 Subject: [PATCH] fix: Handle errors in dumpCaptureAllowlistLog more gracefully --- .../rootlessjamesdsp/session/dump/DumpManager.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/me/timschneeberger/rootlessjamesdsp/session/dump/DumpManager.kt b/app/src/main/java/me/timschneeberger/rootlessjamesdsp/session/dump/DumpManager.kt index cb36bed2e..4b07dc851 100644 --- a/app/src/main/java/me/timschneeberger/rootlessjamesdsp/session/dump/DumpManager.kt +++ b/app/src/main/java/me/timschneeberger/rootlessjamesdsp/session/dump/DumpManager.kt @@ -88,7 +88,15 @@ class DumpManager private constructor(val context: Context) { fun dumpCaptureAllowlistLog(): ISessionPolicyInfoDump? { // Only AudioPolicyService contains this data - return (availableDumpMethods[Method.AudioPolicyService]?.dump(context) as? AudioPolicyServiceDump) + var dump: ISessionPolicyInfoDump? = null + try { + dump = (availableDumpMethods[Method.AudioPolicyService]?.dump(context) as? AudioPolicyServiceDump) + } + catch (ex: Exception) { + Timber.e("Exception raised while dumping allowlist info using method ${Method.AudioPolicyService.name}") + Timber.e(ex) + } + return dump } private fun loadFromPreferences(key: String){