Skip to content

Commit 99238d2

Browse files
GijsWeteringsfacebook-github-bot
authored andcommitted
Configure ViewHierarchy dump for RNTester
Summary: Changelog: [Android][Added] add FBEndToEndDumpsysHelper stub to RNTester Android to be able to dump ViewHierarcies internally. Reviewed By: makovkastar Differential Revision: D54662739 fbshipit-source-id: 5236ae84ed648d431a8f01558f8f84049480ba39
1 parent 417ff5f commit 99238d2

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
package com.facebook.react
9+
10+
import java.io.PrintWriter
11+
12+
object FBEndToEndDumpsysHelper {
13+
fun maybeDump(prefix: String, writer: PrintWriter, args: Array<String>?) {
14+
// no-op This is an empty implementation to stub out Meta's internal dumpsys helper.
15+
}
16+
}

packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterActivity.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@
88
package com.facebook.react.uiapp
99

1010
import android.os.Bundle
11+
import com.facebook.react.FBEndToEndDumpsysHelper
1112
import com.facebook.react.ReactActivity
1213
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
1314
import com.facebook.react.defaults.DefaultReactActivityDelegate
15+
import java.io.FileDescriptor
16+
import java.io.PrintWriter
1417

1518
class RNTesterActivity : ReactActivity() {
1619
class RNTesterActivityDelegate(val activity: ReactActivity, mainComponentName: String) :
@@ -37,4 +40,13 @@ class RNTesterActivity : ReactActivity() {
3740
override fun createReactActivityDelegate() = RNTesterActivityDelegate(this, mainComponentName)
3841

3942
override fun getMainComponentName() = "RNTesterApp"
43+
44+
override fun dump(
45+
prefix: String,
46+
fd: FileDescriptor?,
47+
writer: PrintWriter,
48+
args: Array<String>?
49+
) {
50+
FBEndToEndDumpsysHelper.maybeDump(prefix, writer, args)
51+
}
4052
}

0 commit comments

Comments
 (0)