From 4f2be888568f01ca32db857acc9f1902899110e5 Mon Sep 17 00:00:00 2001 From: LIM Albert Date: Mon, 22 Jan 2024 05:19:28 -0800 Subject: [PATCH] Call super.onRequestPermissionsResult in ReactActivity (#42478) Summary: This change allows activities to handle onRequestPermissionsResult callbacks (eg: registerForActivityResult) Fixes #42403 [Android][Changed] - Call super.onRequestPermissionsResult in ReactActivity's onRequestPermissionsResult() Pull Request resolved: https://github.com/facebook/react-native/pull/42478 Test Plan: **Without super.onRequestPermissionsResult() call** ![before](https://github.com/facebook/react-native/assets/8672580/553ff597-c077-4831-a4d3-51846a253536) **With super.onRequestPermissionsResult() call** ![after](https://github.com/facebook/react-native/assets/8672580/c7d588d2-5846-4083-a02f-59b5f915442c) Reviewed By: cipolleschi Differential Revision: D52952198 Pulled By: cortinico fbshipit-source-id: 53b5dac65f6b5409d87b5fe7f8be659d7b48f70d --- .../src/main/java/com/facebook/react/ReactActivity.java | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java index 28b259596e5ded..c67d041787af30 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java @@ -113,6 +113,7 @@ public void requestPermissions( @Override public void onRequestPermissionsResult( int requestCode, String[] permissions, int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); mDelegate.onRequestPermissionsResult(requestCode, permissions, grantResults); }