@tokamakdev/platform-android-arm64 0.1.1-beta.89 → 0.1.1-beta.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
[diffend] Oversized file quarantined before diffing.
|
|
2
2
|
name: package/android-arm64/lib/TokamakRuntime/libtokamak.a
|
|
3
|
-
size:
|
|
4
|
-
sha256:
|
|
3
|
+
size: 34956692 bytes
|
|
4
|
+
sha256: 42525d9c924594e28bf647865917eaf20f5123b3a05a5b30995aeece7132a969
|
|
@@ -111,6 +111,12 @@ class TokamakApplication : Application(), TokamakPlugins {
|
|
|
111
111
|
|
|
112
112
|
override fun emit(name: String, event: String, timeoutMillis: Long): String =
|
|
113
113
|
emitEvent("$id.$name", event, timeoutMillis)
|
|
114
|
+
|
|
115
|
+
override fun fetch(path: String, timeoutMillis: Long): ByteArray {
|
|
116
|
+
val deadline = SystemClock.elapsedRealtime() + timeoutMillis
|
|
117
|
+
val started = runtime
|
|
118
|
+
return started.fetch(path, deadline - SystemClock.elapsedRealtime())
|
|
119
|
+
}
|
|
114
120
|
}
|
|
115
121
|
|
|
116
122
|
/** The activity to show UI in; throws `NeedsUIError` while the app is in the background. */
|
|
@@ -30,6 +30,9 @@ internal class TokamakRuntime private constructor(private val handle: Long) {
|
|
|
30
30
|
fun emit(name: String, event: String, timeoutMillis: Long): String =
|
|
31
31
|
nativeEmit(handle, name, event, timeoutMillis)
|
|
32
32
|
|
|
33
|
+
/** What the app serves at [path], blocking until it arrives or [timeoutMillis] passes. */
|
|
34
|
+
fun fetch(path: String, timeoutMillis: Long): ByteArray = nativeFetch(handle, path, timeoutMillis)
|
|
35
|
+
|
|
33
36
|
/**
|
|
34
37
|
* Records whether the app is in the foreground, which the Worker's `getLifecycleStage()`
|
|
35
38
|
* reports from then on, and returns whether that changed.
|
|
@@ -136,6 +139,9 @@ internal class TokamakRuntime private constructor(private val handle: Long) {
|
|
|
136
139
|
timeoutMillis: Long,
|
|
137
140
|
): String
|
|
138
141
|
|
|
142
|
+
@JvmStatic
|
|
143
|
+
private external fun nativeFetch(handle: Long, path: String, timeoutMillis: Long): ByteArray
|
|
144
|
+
|
|
139
145
|
@JvmStatic
|
|
140
146
|
private external fun nativeServerAuthority(handle: Long, host: String): ByteArray?
|
|
141
147
|
|
|
@@ -86,6 +86,13 @@ interface TokamakHost {
|
|
|
86
86
|
* throws unless the listeners return within [timeoutMillis], which includes runtime startup.
|
|
87
87
|
*/
|
|
88
88
|
fun emit(name: String, event: String, timeoutMillis: Long): String
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* What the app serves at [path], as its WebView would load it: a file the app ships or the
|
|
92
|
+
* Worker's response. Starts the runtime when it is not running. Blocks, so call it off the main
|
|
93
|
+
* thread; throws unless it arrives within [timeoutMillis].
|
|
94
|
+
*/
|
|
95
|
+
fun fetch(path: String, timeoutMillis: Long): ByteArray
|
|
89
96
|
}
|
|
90
97
|
|
|
91
98
|
/** The app's plugins. The app's [android.app.Application] is one. */
|