Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tv-casting-app: Handle uncaught exceptions before JNI crashes app and make iOS discoverCommissioners API callback based #24896

Merged
merged 3 commits into from
Feb 9, 2023

Conversation

sharadb-amazon
Copy link
Contributor

@sharadb-amazon sharadb-amazon commented Feb 7, 2023

Fixes #24895 and #24894

Problems fixed

  1. If one of the handlers in the tv-casting app for android, throws an exception that it does not handle, it leads to the exception being passed to JNI which crashes the application. This can be tested y temporarily adding a throw new RuntimeException(dummy exc) call in one of the handlers.
  2. In the darwin tv-casting-app, the discoverCommissioners API call must be followed by a getDiscoveredCommissioners call after a certain period of time. This is not ideal because the wait time is non-deterministic and leads to the implementation of polling behaviour on the client side. Change the API to be callback based so that the client is called whenever a new commissioner is discovered.

Testing

Tested with the android and iOS tv-casting-apps

@github-actions
Copy link

github-actions bot commented Feb 7, 2023

PR #24896: Size comparison from eaa7476 to eb71bf7

Decreases (1 build for cc32xx)
platform target config section eaa74766 eb71bf7 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 19915393 19915392 -1 -0.0
Full report (1 build for cc32xx)
platform target config section eaa74766 eb71bf7 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 639725 639725 0 0.0
(read/write) 204084 204084 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197488 197488 0 0.0
.comment 194 194 0 0.0
.data 1476 1476 0 0.0
.debug_abbrev 928401 928401 0 0.0
.debug_aranges 87336 87336 0 0.0
.debug_frame 299792 299792 0 0.0
.debug_info 19915393 19915392 -1 -0.0
.debug_line 2646819 2646819 0 0.0
.debug_loc 2781044 2781044 0 0.0
.debug_ranges 280656 280656 0 0.0
.debug_str 2978585 2978585 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105269 105269 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 375623 375623 0 0.0
.symtab 255664 255664 0 0.0
.text 532332 532332 0 0.0

@github-actions
Copy link

github-actions bot commented Feb 7, 2023

PR #24896: Size comparison from eaa7476 to 9602c19

Full report (1 build for cc32xx)
platform target config section eaa74766 9602c19 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 639725 639725 0 0.0
(read/write) 204084 204084 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197488 197488 0 0.0
.comment 194 194 0 0.0
.data 1476 1476 0 0.0
.debug_abbrev 928401 928401 0 0.0
.debug_aranges 87336 87336 0 0.0
.debug_frame 299792 299792 0 0.0
.debug_info 19915393 19915393 0 0.0
.debug_line 2646819 2646819 0 0.0
.debug_loc 2781044 2781044 0 0.0
.debug_ranges 280656 280656 0 0.0
.debug_str 2978585 2978585 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105269 105269 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 375623 375623 0 0.0
.symtab 255664 255664 0 0.0
.text 532332 532332 0 0.0

@yufengwangca yufengwangca merged commit bcdf9dd into project-chip:master Feb 9, 2023
lpbeliveau-silabs pushed a commit to lpbeliveau-silabs/connectedhomeip that referenced this pull request Feb 13, 2023
… make iOS discoverCommissioners API callback based (project-chip#24896)

* iOS tv-casting-app: Making discovery API callback based

* tv-casting-app: Handled uncaught exceptions and null pointer issues

* Changing catch-all to catch Throwable instead of just Exception
lecndav pushed a commit to lecndav/connectedhomeip that referenced this pull request Mar 22, 2023
… make iOS discoverCommissioners API callback based (project-chip#24896)

* iOS tv-casting-app: Making discovery API callback based

* tv-casting-app: Handled uncaught exceptions and null pointer issues

* Changing catch-all to catch Throwable instead of just Exception
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] android/tv-casting-app: Unhandled exceptions in client code lead to app crash
4 participants