react-native-webrtc / react-native-webrtc/react-native-callkeep

Android: RNCallKeepModule onHostDestroy crashes Android instrumentation test runner

Open
#797 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
511
Avg merge
9h 12m
Merged PRs (30d)
2

Description

Bug report

  • Reproduced on:
  • Android

Description

The following code in RNCallKeepModule.java for onHostDestroy causes the Android instrumentation test runner to crash:

   Log.d(TAG, "[RNCallKeepModule] onHostDestroy executed");
   // This line will kill the android process after ending all calls
   android.os.Process.killProcess(android.os.Process.myPid());

Proposed Solution

The following code would cleanly close the app without crashing the Android instrumentation test runner:

   Log.d(TAG, "[RNCallKeepModule] onHostDestroy executed");
   // This line will cleanly close the app after ending all calls
   getCurrentReactActivity().finishAffinity();

Steps to Reproduce

Create and run an Android Espresso UI Test

Versions

- Callkeep: 4.3.12
- React Native: 0.72.3
- Android: any
- Phone model: any

Logs

2024-07-19 10:06:37.970 12560-12560 RNCallKeep               D  [RNCallKeepModule] onHostDestroy called
2024-07-19 10:06:37.978 12560-12560 RNCallKeep               D  [RNCallKeepModule] stopListenToNativeCallsState
2024-07-19 10:06:37.978 12560-12560 RNCallKeep               D  [RNCallKeepModule] onHostDestroy executed
2024-07-19 10:06:37.978 12560-12560 Process                  I  Sending signal. PID: 12560 SIG: 9
2024-07-19 10:06:38.072 13142-13142 WindowOnBackDispatcher   W  sendCancelIfRunning: isInProgress=falsecallback=android.view.ViewRootImpl$$ExternalSyntheticLambda11@cf6b1b2
2024-07-19 10:06:38.097  1488-2809  ActivityManager          W  Crash of app com.xxxx.xxxx running instrumentation ComponentInfo{com.xxxx.xxxx.test/androidx.test.runner.AndroidJUnitRunner}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in RNCallKeepModule.java at onHostDestroy and reproduce the failure with an Android Espresso UI test. Check that the lifecycle cleanup no longer crashes the instrumentation runner and that the relevant Android test completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, react-native
Domain
mobile, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.