Skip to content

Commit c358f89

Browse files
committed
Update NativeActivity
1 parent eef10d3 commit c358f89

1 file changed

Lines changed: 1 addition & 36 deletions

File tree

Sources/AndroidNativeActivity/NativeActivity.swift

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import SystemPackage
1919
/// It is created by the framework, and handed to the application's native code as it is being launched.
2020
///
2121
/// [See Also](https://developer.android.com/ndk/reference/group/native-activity#anativeactivity)
22-
@MainActor
2322
public final class NativeActivity {
2423

2524
// MARK: - Properties
@@ -45,18 +44,6 @@ public final class NativeActivity {
4544
pointer.pointee.callbacks
4645
}
4746

48-
/// The global handle on the process's Java VM.
49-
public var javaVM: JavaVM {
50-
JavaVM(pointer.pointee.vm)
51-
}
52-
53-
/// JNI context for the main thread of the app.
54-
///
55-
/// Note that this field can ONLY be used from the main thread of the process; that is, the thread that calls into the ANativeActivityCallbacks.
56-
public var javaEnvironment: JNIEnvironment {
57-
JNIEnvironment(pointer.pointee.env)
58-
}
59-
6047
/// The NativeActivity object handle.
6148
///
6249
/// This is the native instance of the android.app.NativeActivity Java class.
@@ -84,7 +71,7 @@ public final class NativeActivity {
8471
/// It is not used by the framework, but can be set by the application to its own instance state.
8572
public var instance: UnsafeMutableRawPointer? {
8673
get { pointer.pointee.instance }
87-
nonmutating set { pointer.pointee.instance = newValue }
74+
set { pointer.pointee.instance = newValue }
8875
}
8976

9077
/// Pointer to the Asset Manager instance for the application.
@@ -105,28 +92,6 @@ public final class NativeActivity {
10592
}
10693
}
10794

108-
// MARK: - JavaVM
109-
110-
public struct JavaVM: ~Copyable, Sendable {
111-
112-
internal let pointer: UnsafeMutablePointer<JavaVM_>
113-
114-
internal init(_ pointer: UnsafeMutablePointer<JavaVM_>) {
115-
self.pointer = pointer
116-
}
117-
}
118-
119-
// MARK: - JNI Environment
120-
121-
public struct JNIEnvironment: ~Copyable, Sendable {
122-
123-
internal let pointer: UnsafeMutablePointer<JNIEnv>
124-
125-
internal init(_ pointer: UnsafeMutablePointer<JNIEnv>) {
126-
self.pointer = pointer
127-
}
128-
}
129-
13095
// MARK: - Native Activity Callbacks
13196

13297
/// These are the callbacks the framework makes into a native application.

0 commit comments

Comments
 (0)