File tree Expand file tree Collapse file tree 3 files changed +22
-27
lines changed
packages/react-native/ReactAndroid/src/main/java/com/facebook/react Expand file tree Collapse file tree 3 files changed +22
-27
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
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.bridge
9
+
10
+ import android.content.Context
11
+
12
+ /* *
13
+ * A context wrapper that always wraps Android Application [Context] and [CatalystInstance] by
14
+ * extending [ReactContext].
15
+ */
16
+ public abstract class ReactApplicationContext (context : Context ) :
17
+ // We want to wrap ApplicationContext, since there is no easy way to verify that application
18
+ // context is passed as a param, we use [Context.getApplicationContext] to ensure that
19
+ // the context we're wrapping is in fact an application context.
20
+ ReactContext (context.applicationContext)
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ package com.facebook.react.modules.clipboard
9
9
10
10
import android.content.ClipData
11
11
import android.content.ClipboardManager
12
+ import android.content.Context
12
13
import com.facebook.fbreact.specs.NativeClipboardSpec
13
14
import com.facebook.react.bridge.Promise
14
15
import com.facebook.react.bridge.ReactApplicationContext
@@ -20,8 +21,7 @@ internal class ClipboardModule(context: ReactApplicationContext) : NativeClipboa
20
21
21
22
private val clipboardService: ClipboardManager
22
23
get() =
23
- getReactApplicationContext().getSystemService(ReactApplicationContext .CLIPBOARD_SERVICE )
24
- as ClipboardManager
24
+ getReactApplicationContext().getSystemService(Context .CLIPBOARD_SERVICE ) as ClipboardManager
25
25
26
26
override fun getString (promise : Promise ) {
27
27
try {
You can’t perform that action at this time.
0 commit comments