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

Android: RNCallKeepModule onHostDestroy crashes Android instrumentation test runner #797

Open
mleppanen-sorenson opened this issue Jul 19, 2024 · 0 comments

Comments

@mleppanen-sorenson
Copy link

mleppanen-sorenson commented Jul 19, 2024

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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant