Skip to content

Commit

Permalink
fix: Handle errors in dumpCaptureAllowlistLog more gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
timschneeb committed Oct 11, 2022
1 parent 1dd7a85 commit 638926d
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down

0 comments on commit 638926d

Please sign in to comment.