@tokamakdev/plugin-location 0.1.0-beta.114 → 0.1.0-beta.117
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.
- package/android/Bindings.kt +45 -45
- package/android/LocationEvents.kt +1 -1
- package/apple/Bindings.swift +185 -183
- package/package.json +2 -2
- package/src/index.ts +6 -19
package/android/Bindings.kt
CHANGED
|
@@ -62,7 +62,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
62
62
|
"CancellationSignal.OnCancelListener" -> callCancellationSignal_OnCancelListener(method, b)
|
|
63
63
|
"SystemClock" -> callSystemClock(method, b)
|
|
64
64
|
"Consumer" -> callConsumer(method, b)
|
|
65
|
-
else ->
|
|
65
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -188,7 +188,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
188
188
|
"Location#setMslAltitudeAccuracyMeters(F)V" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.target(android.location.Location::class.java).setMslAltitudeAccuracyMeters(b.float(b[0])); null }
|
|
189
189
|
"Location#hasMslAltitudeAccuracy()Z" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.Location::class.java).hasMslAltitudeAccuracy()) }
|
|
190
190
|
"Location#removeMslAltitudeAccuracy()V" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.target(android.location.Location::class.java).removeMslAltitudeAccuracy(); null }
|
|
191
|
-
else ->
|
|
191
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
192
192
|
}
|
|
193
193
|
|
|
194
194
|
private fun callAddress(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -232,7 +232,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
232
232
|
"Address#setSubThoroughfare(Ljava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 4) throw TokamakBinding.unavailable; b.target(android.location.Address::class.java).setSubThoroughfare(b.optional(b[0]) { x1 -> b.string(x1) }); null }
|
|
233
233
|
"Address#getPremises()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 4) throw TokamakBinding.unavailable; b.encode(b.target(android.location.Address::class.java).getPremises()) }
|
|
234
234
|
"Address#setPremises(Ljava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 4) throw TokamakBinding.unavailable; b.target(android.location.Address::class.java).setPremises(b.optional(b[0]) { x1 -> b.string(x1) }); null }
|
|
235
|
-
else ->
|
|
235
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
private fun callCriteria(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -261,7 +261,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
261
261
|
"Criteria#getSpeedAccuracy()I" -> b.run { if (Build.VERSION.SDK_INT < 9) throw TokamakBinding.unavailable; b.encode(b.target(android.location.Criteria::class.java).getSpeedAccuracy()) }
|
|
262
262
|
"Criteria#setBearingAccuracy(I)V" -> b.run { if (Build.VERSION.SDK_INT < 9) throw TokamakBinding.unavailable; b.target(android.location.Criteria::class.java).setBearingAccuracy(b.int(b[0])); null }
|
|
263
263
|
"Criteria#getBearingAccuracy()I" -> b.run { if (Build.VERSION.SDK_INT < 9) throw TokamakBinding.unavailable; b.encode(b.target(android.location.Criteria::class.java).getBearingAccuracy()) }
|
|
264
|
-
else ->
|
|
264
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
private fun callGeocoder(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -274,14 +274,14 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
274
274
|
"Geocoder#getFromLocation(DDILandroid/location/Geocoder\$GeocodeListener;)V" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.target(android.location.Geocoder::class.java).getFromLocation(b.double(b[0]), b.double(b[1]), b.int(b[2]), b.obj(b[3], android.location.Geocoder.GeocodeListener::class.java)); null }
|
|
275
275
|
"Geocoder#getFromLocationName(Ljava/lang/String;ILandroid/location/Geocoder\$GeocodeListener;)V" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.target(android.location.Geocoder::class.java).getFromLocationName(b.string(b[0]), b.int(b[1]), b.obj(b[2], android.location.Geocoder.GeocodeListener::class.java)); null }
|
|
276
276
|
"Geocoder#getFromLocationName(Ljava/lang/String;IDDDDLandroid/location/Geocoder\$GeocodeListener;)V" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.target(android.location.Geocoder::class.java).getFromLocationName(b.string(b[0]), b.int(b[1]), b.double(b[2]), b.double(b[3]), b.double(b[4]), b.double(b[5]), b.obj(b[6], android.location.Geocoder.GeocodeListener::class.java)); null }
|
|
277
|
-
else ->
|
|
277
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
private fun callGeocoder_GeocodeListener(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
281
281
|
when (method) {
|
|
282
282
|
"Geocoder.GeocodeListener#onGeocode(Ljava/util/List;)V" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.target(android.location.Geocoder.GeocodeListener::class.java).onGeocode(b.list(b[0]) { x1 -> b.optional(x1) { x2 -> b.obj(x2, android.location.Address::class.java) } }); null }
|
|
283
283
|
"Geocoder.GeocodeListener#onError(Ljava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.target(android.location.Geocoder.GeocodeListener::class.java).onError(b.optional(b[0]) { x1 -> b.string(x1) }); null }
|
|
284
|
-
else ->
|
|
284
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
285
285
|
}
|
|
286
286
|
|
|
287
287
|
private fun callGnssAntennaInfo(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -294,7 +294,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
294
294
|
"GnssAntennaInfo#toString()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAntennaInfo::class.java).toString()) }
|
|
295
295
|
"GnssAntennaInfo#equals(Ljava/lang/Object;)Z" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAntennaInfo::class.java).equals(b.optional(b[0]) { x1 -> b.any(x1) })) }
|
|
296
296
|
"GnssAntennaInfo#hashCode()I" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAntennaInfo::class.java).hashCode()) }
|
|
297
|
-
else ->
|
|
297
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
private fun callGnssAntennaInfo_Builder(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -307,13 +307,13 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
307
307
|
"GnssAntennaInfo.Builder#build()Landroid/location/GnssAntennaInfo;" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAntennaInfo.Builder::class.java).build()) }
|
|
308
308
|
"GnssAntennaInfo.Builder#<init>(DLandroid/location/GnssAntennaInfo\$PhaseCenterOffset;)V" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(android.location.GnssAntennaInfo.Builder(b.double(b[0]), b.obj(b[1], android.location.GnssAntennaInfo.PhaseCenterOffset::class.java))) }
|
|
309
309
|
"GnssAntennaInfo.Builder#<init>(Landroid/location/GnssAntennaInfo;)V" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(android.location.GnssAntennaInfo.Builder(b.obj(b[0], android.location.GnssAntennaInfo::class.java))) }
|
|
310
|
-
else ->
|
|
310
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
private fun callGnssAntennaInfo_Listener(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
314
314
|
when (method) {
|
|
315
315
|
"GnssAntennaInfo.Listener#onGnssAntennaInfoReceived(Ljava/util/List;)V" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.target(android.location.GnssAntennaInfo.Listener::class.java).onGnssAntennaInfoReceived(b.list(b[0]) { x1 -> b.optional(x1) { x2 -> b.obj(x2, android.location.GnssAntennaInfo::class.java) } }); null }
|
|
316
|
-
else ->
|
|
316
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
317
317
|
}
|
|
318
318
|
|
|
319
319
|
private fun callGnssAntennaInfo_PhaseCenterOffset(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -329,7 +329,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
329
329
|
"GnssAntennaInfo.PhaseCenterOffset#toString()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAntennaInfo.PhaseCenterOffset::class.java).toString()) }
|
|
330
330
|
"GnssAntennaInfo.PhaseCenterOffset#equals(Ljava/lang/Object;)Z" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAntennaInfo.PhaseCenterOffset::class.java).equals(b.optional(b[0]) { x1 -> b.any(x1) })) }
|
|
331
331
|
"GnssAntennaInfo.PhaseCenterOffset#hashCode()I" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAntennaInfo.PhaseCenterOffset::class.java).hashCode()) }
|
|
332
|
-
else ->
|
|
332
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
private fun callGnssAntennaInfo_SphericalCorrections(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -343,7 +343,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
343
343
|
"GnssAntennaInfo.SphericalCorrections#toString()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAntennaInfo.SphericalCorrections::class.java).toString()) }
|
|
344
344
|
"GnssAntennaInfo.SphericalCorrections#equals(Ljava/lang/Object;)Z" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAntennaInfo.SphericalCorrections::class.java).equals(b.optional(b[0]) { x1 -> b.any(x1) })) }
|
|
345
345
|
"GnssAntennaInfo.SphericalCorrections#hashCode()I" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAntennaInfo.SphericalCorrections::class.java).hashCode()) }
|
|
346
|
-
else ->
|
|
346
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
private fun callGnssAutomaticGainControl(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -355,7 +355,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
355
355
|
"GnssAutomaticGainControl#toString()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAutomaticGainControl::class.java).toString()) }
|
|
356
356
|
"GnssAutomaticGainControl#equals(Ljava/lang/Object;)Z" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAutomaticGainControl::class.java).equals(b.optional(b[0]) { x1 -> b.any(x1) })) }
|
|
357
357
|
"GnssAutomaticGainControl#hashCode()I" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAutomaticGainControl::class.java).hashCode()) }
|
|
358
|
-
else ->
|
|
358
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
359
359
|
}
|
|
360
360
|
|
|
361
361
|
private fun callGnssAutomaticGainControl_Builder(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -366,7 +366,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
366
366
|
"GnssAutomaticGainControl.Builder#setConstellationType(I)Landroid/location/GnssAutomaticGainControl\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAutomaticGainControl.Builder::class.java).setConstellationType(b.int(b[0]))) }
|
|
367
367
|
"GnssAutomaticGainControl.Builder#setCarrierFrequencyHz(J)Landroid/location/GnssAutomaticGainControl\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAutomaticGainControl.Builder::class.java).setCarrierFrequencyHz(b.long(b[0]))) }
|
|
368
368
|
"GnssAutomaticGainControl.Builder#build()Landroid/location/GnssAutomaticGainControl;" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssAutomaticGainControl.Builder::class.java).build()) }
|
|
369
|
-
else ->
|
|
369
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
private fun callGnssCapabilities(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -402,7 +402,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
402
402
|
"GnssCapabilities#hasPowerMultibandAcquisition()Z" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssCapabilities::class.java).hasPowerMultibandAcquisition()) }
|
|
403
403
|
"GnssCapabilities#hasPowerOtherModes()Z" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssCapabilities::class.java).hasPowerOtherModes()) }
|
|
404
404
|
"GnssCapabilities#getGnssSignalTypes()Ljava/util/List;" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssCapabilities::class.java).getGnssSignalTypes()) }
|
|
405
|
-
else ->
|
|
405
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
private fun callGnssCapabilities_Builder(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -436,7 +436,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
436
436
|
"GnssCapabilities.Builder#setHasPowerMultibandAcquisition(Z)Landroid/location/GnssCapabilities\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssCapabilities.Builder::class.java).setHasPowerMultibandAcquisition(b.boolean(b[0]))) }
|
|
437
437
|
"GnssCapabilities.Builder#setHasPowerOtherModes(Z)Landroid/location/GnssCapabilities\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssCapabilities.Builder::class.java).setHasPowerOtherModes(b.boolean(b[0]))) }
|
|
438
438
|
"GnssCapabilities.Builder#setGnssSignalTypes(Ljava/util/List;)Landroid/location/GnssCapabilities\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssCapabilities.Builder::class.java).setGnssSignalTypes(b.list(b[0]) { x1 -> b.optional(x1) { x2 -> b.obj(x2, android.location.GnssSignalType::class.java) } })) }
|
|
439
|
-
else ->
|
|
439
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
private fun callGnssClock(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -469,7 +469,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
469
469
|
"GnssClock#getReferenceCarrierFrequencyHzForIsb()D" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssClock::class.java).getReferenceCarrierFrequencyHzForIsb()) }
|
|
470
470
|
"GnssClock#hasReferenceCodeTypeForIsb()Z" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssClock::class.java).hasReferenceCodeTypeForIsb()) }
|
|
471
471
|
"GnssClock#getReferenceCodeTypeForIsb()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssClock::class.java).getReferenceCodeTypeForIsb()) }
|
|
472
|
-
else ->
|
|
472
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
473
473
|
}
|
|
474
474
|
|
|
475
475
|
private fun callGnssMeasurement(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -513,7 +513,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
513
513
|
"GnssMeasurement#getSatelliteInterSignalBiasNanos()D" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurement::class.java).getSatelliteInterSignalBiasNanos()) }
|
|
514
514
|
"GnssMeasurement#hasSatelliteInterSignalBiasUncertaintyNanos()Z" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurement::class.java).hasSatelliteInterSignalBiasUncertaintyNanos()) }
|
|
515
515
|
"GnssMeasurement#getSatelliteInterSignalBiasUncertaintyNanos()D" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurement::class.java).getSatelliteInterSignalBiasUncertaintyNanos()) }
|
|
516
|
-
else ->
|
|
516
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
517
517
|
}
|
|
518
518
|
|
|
519
519
|
private fun callGnssMeasurementRequest(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -524,7 +524,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
524
524
|
"GnssMeasurementRequest#hashCode()I" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementRequest::class.java).hashCode()) }
|
|
525
525
|
"GnssMeasurementRequest#describeContents()I" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementRequest::class.java).describeContents()) }
|
|
526
526
|
"GnssMeasurementRequest#getIntervalMillis()I" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementRequest::class.java).getIntervalMillis()) }
|
|
527
|
-
else ->
|
|
527
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
528
528
|
}
|
|
529
529
|
|
|
530
530
|
private fun callGnssMeasurementRequest_Builder(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -534,7 +534,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
534
534
|
"GnssMeasurementRequest.Builder#setFullTracking(Z)Landroid/location/GnssMeasurementRequest\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementRequest.Builder::class.java).setFullTracking(b.boolean(b[0]))) }
|
|
535
535
|
"GnssMeasurementRequest.Builder#build()Landroid/location/GnssMeasurementRequest;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementRequest.Builder::class.java).build()) }
|
|
536
536
|
"GnssMeasurementRequest.Builder#setIntervalMillis(I)Landroid/location/GnssMeasurementRequest\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementRequest.Builder::class.java).setIntervalMillis(b.int(b[0]))) }
|
|
537
|
-
else ->
|
|
537
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
538
538
|
}
|
|
539
539
|
|
|
540
540
|
private fun callGnssMeasurementsEvent(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -546,7 +546,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
546
546
|
"GnssMeasurementsEvent#getGnssAutomaticGainControls()Ljava/util/Collection;" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementsEvent::class.java).getGnssAutomaticGainControls()) }
|
|
547
547
|
"GnssMeasurementsEvent#isFullTracking()Z" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementsEvent::class.java).isFullTracking()) }
|
|
548
548
|
"GnssMeasurementsEvent#hasIsFullTracking()Z" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementsEvent::class.java).hasIsFullTracking()) }
|
|
549
|
-
else ->
|
|
549
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
550
550
|
}
|
|
551
551
|
|
|
552
552
|
private fun callGnssMeasurementsEvent_Builder(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -559,14 +559,14 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
559
559
|
"GnssMeasurementsEvent.Builder#build()Landroid/location/GnssMeasurementsEvent;" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementsEvent.Builder::class.java).build()) }
|
|
560
560
|
"GnssMeasurementsEvent.Builder#setIsFullTracking(Z)Landroid/location/GnssMeasurementsEvent\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementsEvent.Builder::class.java).setIsFullTracking(b.boolean(b[0]))) }
|
|
561
561
|
"GnssMeasurementsEvent.Builder#clearIsFullTracking()Landroid/location/GnssMeasurementsEvent\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssMeasurementsEvent.Builder::class.java).clearIsFullTracking()) }
|
|
562
|
-
else ->
|
|
562
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
563
563
|
}
|
|
564
564
|
|
|
565
565
|
private fun callGnssMeasurementsEvent_Callback(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
566
566
|
when (method) {
|
|
567
567
|
"GnssMeasurementsEvent.Callback#onGnssMeasurementsReceived(Landroid/location/GnssMeasurementsEvent;)V" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.target(android.location.GnssMeasurementsEvent.Callback::class.java).onGnssMeasurementsReceived(b.optional(b[0]) { x1 -> b.obj(x1, android.location.GnssMeasurementsEvent::class.java) }); null }
|
|
568
568
|
"GnssMeasurementsEvent.Callback#onStatusChanged(I)V" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.target(android.location.GnssMeasurementsEvent.Callback::class.java).onStatusChanged(b.int(b[0])); null }
|
|
569
|
-
else ->
|
|
569
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
570
570
|
}
|
|
571
571
|
|
|
572
572
|
private fun callGnssNavigationMessage(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -579,14 +579,14 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
579
579
|
"GnssNavigationMessage#getStatus()I" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssNavigationMessage::class.java).getStatus()) }
|
|
580
580
|
"GnssNavigationMessage#describeContents()I" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssNavigationMessage::class.java).describeContents()) }
|
|
581
581
|
"GnssNavigationMessage#toString()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssNavigationMessage::class.java).toString()) }
|
|
582
|
-
else ->
|
|
582
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
583
583
|
}
|
|
584
584
|
|
|
585
585
|
private fun callGnssNavigationMessage_Callback(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
586
586
|
when (method) {
|
|
587
587
|
"GnssNavigationMessage.Callback#onGnssNavigationMessageReceived(Landroid/location/GnssNavigationMessage;)V" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.target(android.location.GnssNavigationMessage.Callback::class.java).onGnssNavigationMessageReceived(b.optional(b[0]) { x1 -> b.obj(x1, android.location.GnssNavigationMessage::class.java) }); null }
|
|
588
588
|
"GnssNavigationMessage.Callback#onStatusChanged(I)V" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.target(android.location.GnssNavigationMessage.Callback::class.java).onStatusChanged(b.int(b[0])); null }
|
|
589
|
-
else ->
|
|
589
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
590
590
|
}
|
|
591
591
|
|
|
592
592
|
private fun callGnssSignalType(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -599,7 +599,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
599
599
|
"GnssSignalType#equals(Ljava/lang/Object;)Z" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssSignalType::class.java).equals(b.optional(b[0]) { x1 -> b.any(x1) })) }
|
|
600
600
|
"GnssSignalType#hashCode()I" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssSignalType::class.java).hashCode()) }
|
|
601
601
|
"GnssSignalType#describeContents()I" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssSignalType::class.java).describeContents()) }
|
|
602
|
-
else ->
|
|
602
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
603
603
|
}
|
|
604
604
|
|
|
605
605
|
private fun callGnssStatus(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -620,7 +620,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
620
620
|
"GnssStatus#getCarrierFrequencyHz(I)F" -> b.run { if (Build.VERSION.SDK_INT < 26) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssStatus::class.java).getCarrierFrequencyHz(b.int(b[0]))) }
|
|
621
621
|
"GnssStatus#hasBasebandCn0DbHz(I)Z" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssStatus::class.java).hasBasebandCn0DbHz(b.int(b[0]))) }
|
|
622
622
|
"GnssStatus#getBasebandCn0DbHz(I)F" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssStatus::class.java).getBasebandCn0DbHz(b.int(b[0]))) }
|
|
623
|
-
else ->
|
|
623
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
624
624
|
}
|
|
625
625
|
|
|
626
626
|
private fun callGnssStatus_Builder(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -629,7 +629,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
629
629
|
"GnssStatus.Builder#addSatellite(IIFFFZZZZFZF)Landroid/location/GnssStatus\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssStatus.Builder::class.java).addSatellite(b.int(b[0]), b.int(b[1]), b.float(b[2]), b.float(b[3]), b.float(b[4]), b.boolean(b[5]), b.boolean(b[6]), b.boolean(b[7]), b.boolean(b[8]), b.float(b[9]), b.boolean(b[10]), b.float(b[11]))) }
|
|
630
630
|
"GnssStatus.Builder#clearSatellites()Landroid/location/GnssStatus\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssStatus.Builder::class.java).clearSatellites()) }
|
|
631
631
|
"GnssStatus.Builder#build()Landroid/location/GnssStatus;" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GnssStatus.Builder::class.java).build()) }
|
|
632
|
-
else ->
|
|
632
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
633
633
|
}
|
|
634
634
|
|
|
635
635
|
private fun callGnssStatus_Callback(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -638,7 +638,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
638
638
|
"GnssStatus.Callback#onStopped()V" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.target(android.location.GnssStatus.Callback::class.java).onStopped(); null }
|
|
639
639
|
"GnssStatus.Callback#onFirstFix(I)V" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.target(android.location.GnssStatus.Callback::class.java).onFirstFix(b.int(b[0])); null }
|
|
640
640
|
"GnssStatus.Callback#onSatelliteStatusChanged(Landroid/location/GnssStatus;)V" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.target(android.location.GnssStatus.Callback::class.java).onSatelliteStatusChanged(b.obj(b[0], android.location.GnssStatus::class.java)); null }
|
|
641
|
-
else ->
|
|
641
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
642
642
|
}
|
|
643
643
|
|
|
644
644
|
private fun callGpsSatellite(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -650,7 +650,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
650
650
|
"GpsSatellite#hasEphemeris()Z" -> b.run { if (Build.VERSION.SDK_INT < 3) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GpsSatellite::class.java).hasEphemeris()) }
|
|
651
651
|
"GpsSatellite#hasAlmanac()Z" -> b.run { if (Build.VERSION.SDK_INT < 3) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GpsSatellite::class.java).hasAlmanac()) }
|
|
652
652
|
"GpsSatellite#usedInFix()Z" -> b.run { if (Build.VERSION.SDK_INT < 3) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GpsSatellite::class.java).usedInFix()) }
|
|
653
|
-
else ->
|
|
653
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
654
654
|
}
|
|
655
655
|
|
|
656
656
|
private fun callGpsStatus(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -658,19 +658,19 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
658
658
|
"GpsStatus#getTimeToFirstFix()I" -> b.run { if (Build.VERSION.SDK_INT < 3) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GpsStatus::class.java).getTimeToFirstFix()) }
|
|
659
659
|
"GpsStatus#getMaxSatellites()I" -> b.run { if (Build.VERSION.SDK_INT < 3) throw TokamakBinding.unavailable; b.encode(b.target(android.location.GpsStatus::class.java).getMaxSatellites()) }
|
|
660
660
|
"GpsStatus#create(Landroid/location/GnssStatus;I)Landroid/location/GpsStatus;" -> b.run { if (Build.VERSION.SDK_INT < 30) throw TokamakBinding.unavailable; b.encode(android.location.GpsStatus.create(b.obj(b[0], android.location.GnssStatus::class.java), b.int(b[1]))) }
|
|
661
|
-
else ->
|
|
661
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
662
662
|
}
|
|
663
663
|
|
|
664
664
|
private fun callGpsStatus_Listener(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
665
665
|
when (method) {
|
|
666
666
|
"GpsStatus.Listener#onGpsStatusChanged(I)V" -> b.run { if (Build.VERSION.SDK_INT < 3) throw TokamakBinding.unavailable; b.target(android.location.GpsStatus.Listener::class.java).onGpsStatusChanged(b.int(b[0])); null }
|
|
667
|
-
else ->
|
|
667
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
668
668
|
}
|
|
669
669
|
|
|
670
670
|
private fun callGpsStatus_NmeaListener(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
671
671
|
when (method) {
|
|
672
672
|
"GpsStatus.NmeaListener#onNmeaReceived(JLjava/lang/String;)V" -> b.run { if (Build.VERSION.SDK_INT < 5) throw TokamakBinding.unavailable; b.target(android.location.GpsStatus.NmeaListener::class.java).onNmeaReceived(b.long(b[0]), b.optional(b[1]) { x1 -> b.string(x1) }); null }
|
|
673
|
-
else ->
|
|
673
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
674
674
|
}
|
|
675
675
|
|
|
676
676
|
private fun callLocationListener(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -680,7 +680,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
680
680
|
"LocationListener#onProviderDisabled(Ljava/lang/String;)V" -> b.run { b.target(android.location.LocationListener::class.java).onProviderDisabled(b.string(b[0])); null }
|
|
681
681
|
"LocationListener#onLocationChanged(Ljava/util/List;)V" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.target(android.location.LocationListener::class.java).onLocationChanged(b.list(b[0]) { x1 -> b.optional(x1) { x2 -> b.obj(x2, android.location.Location::class.java) } }); null }
|
|
682
682
|
"LocationListener#onFlushComplete(I)V" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.target(android.location.LocationListener::class.java).onFlushComplete(b.int(b[0])); null }
|
|
683
|
-
else ->
|
|
683
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
684
684
|
}
|
|
685
685
|
|
|
686
686
|
private fun callLocationManager(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -733,7 +733,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
733
733
|
"LocationManager#hasProvider(Ljava/lang/String;)Z" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.LocationManager::class.java).hasProvider(b.string(b[0]))) }
|
|
734
734
|
"LocationManager#getGnssAntennaInfos()Ljava/util/List;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.LocationManager::class.java).getGnssAntennaInfos()) }
|
|
735
735
|
"LocationManager#registerGnssMeasurementsCallback(Landroid/location/GnssMeasurementRequest;Ljava/util/concurrent/Executor;Landroid/location/GnssMeasurementsEvent\$Callback;)Z" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.LocationManager::class.java).registerGnssMeasurementsCallback(b.obj(b[0], android.location.GnssMeasurementRequest::class.java), b.obj(b[1], java.util.concurrent.Executor::class.java), b.obj(b[2], android.location.GnssMeasurementsEvent.Callback::class.java))) }
|
|
736
|
-
else ->
|
|
736
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
737
737
|
}
|
|
738
738
|
|
|
739
739
|
private fun callLocationProvider(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -749,7 +749,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
749
749
|
"LocationProvider#supportsBearing()Z" -> b.run { b.encode(b.target(android.location.LocationProvider::class.java).supportsBearing()) }
|
|
750
750
|
"LocationProvider#getPowerRequirement()I" -> b.run { b.encode(b.target(android.location.LocationProvider::class.java).getPowerRequirement()) }
|
|
751
751
|
"LocationProvider#getAccuracy()I" -> b.run { b.encode(b.target(android.location.LocationProvider::class.java).getAccuracy()) }
|
|
752
|
-
else ->
|
|
752
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
753
753
|
}
|
|
754
754
|
|
|
755
755
|
private fun callLocationRequest(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -765,7 +765,7 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
765
765
|
"LocationRequest#equals(Ljava/lang/Object;)Z" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.LocationRequest::class.java).equals(b.optional(b[0]) { x1 -> b.any(x1) })) }
|
|
766
766
|
"LocationRequest#hashCode()I" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.LocationRequest::class.java).hashCode()) }
|
|
767
767
|
"LocationRequest#toString()Ljava/lang/String;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.LocationRequest::class.java).toString()) }
|
|
768
|
-
else ->
|
|
768
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
769
769
|
}
|
|
770
770
|
|
|
771
771
|
private fun callLocationRequest_Builder(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -781,19 +781,19 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
781
781
|
"LocationRequest.Builder#setMinUpdateDistanceMeters(F)Landroid/location/LocationRequest\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.LocationRequest.Builder::class.java).setMinUpdateDistanceMeters(b.float(b[0]))) }
|
|
782
782
|
"LocationRequest.Builder#setMaxUpdateDelayMillis(J)Landroid/location/LocationRequest\$Builder;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.LocationRequest.Builder::class.java).setMaxUpdateDelayMillis(b.long(b[0]))) }
|
|
783
783
|
"LocationRequest.Builder#build()Landroid/location/LocationRequest;" -> b.run { if (Build.VERSION.SDK_INT < 31) throw TokamakBinding.unavailable; b.encode(b.target(android.location.LocationRequest.Builder::class.java).build()) }
|
|
784
|
-
else ->
|
|
784
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
785
785
|
}
|
|
786
786
|
|
|
787
787
|
private fun callOnNmeaMessageListener(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
788
788
|
when (method) {
|
|
789
789
|
"OnNmeaMessageListener#onNmeaMessage(Ljava/lang/String;J)V" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.target(android.location.OnNmeaMessageListener::class.java).onNmeaMessage(b.optional(b[0]) { x1 -> b.string(x1) }, b.long(b[1])); null }
|
|
790
|
-
else ->
|
|
790
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
791
791
|
}
|
|
792
792
|
|
|
793
793
|
private fun callSettingInjectorService(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
794
794
|
when (method) {
|
|
795
795
|
"SettingInjectorService#refreshSettings(Landroid/content/Context;)V" -> b.run { if (Build.VERSION.SDK_INT < 29) throw TokamakBinding.unavailable; android.location.SettingInjectorService.refreshSettings(b.obj(b[0], android.content.Context::class.java)); null }
|
|
796
|
-
else ->
|
|
796
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
797
797
|
}
|
|
798
798
|
|
|
799
799
|
private fun callContext(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -839,13 +839,13 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
839
839
|
"Context#revokeSelfPermissionsOnKill(Ljava/util/Collection;)V" -> b.run { if (Build.VERSION.SDK_INT < 33) throw TokamakBinding.unavailable; b.target(android.content.Context::class.java).revokeSelfPermissionsOnKill(b.list(b[0]) { x1 -> b.optional(x1) { x2 -> b.string(x2) } }); null }
|
|
840
840
|
"Context#createDeviceContext(I)Landroid/content/Context;" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.content.Context::class.java).createDeviceContext(b.int(b[0]))) }
|
|
841
841
|
"Context#getDeviceId()I" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(b.target(android.content.Context::class.java).getDeviceId()) }
|
|
842
|
-
else ->
|
|
842
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
843
843
|
}
|
|
844
844
|
|
|
845
845
|
private fun callContext_BindServiceFlags(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
846
846
|
when (method) {
|
|
847
847
|
"Context.BindServiceFlags#of(J)Landroid/content/Context\$BindServiceFlags;" -> b.run { if (Build.VERSION.SDK_INT < 34) throw TokamakBinding.unavailable; b.encode(android.content.Context.BindServiceFlags.of(b.long(b[0]))) }
|
|
848
|
-
else ->
|
|
848
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
849
849
|
}
|
|
850
850
|
|
|
851
851
|
private fun callCancellationSignal(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -855,13 +855,13 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
855
855
|
"CancellationSignal#throwIfCanceled()V" -> b.run { if (Build.VERSION.SDK_INT < 16) throw TokamakBinding.unavailable; b.target(android.os.CancellationSignal::class.java).throwIfCanceled(); null }
|
|
856
856
|
"CancellationSignal#cancel()V" -> b.run { if (Build.VERSION.SDK_INT < 16) throw TokamakBinding.unavailable; b.target(android.os.CancellationSignal::class.java).cancel(); null }
|
|
857
857
|
"CancellationSignal#setOnCancelListener(Landroid/os/CancellationSignal\$OnCancelListener;)V" -> b.run { if (Build.VERSION.SDK_INT < 16) throw TokamakBinding.unavailable; b.target(android.os.CancellationSignal::class.java).setOnCancelListener(b.optional(b[0]) { x1 -> b.obj(x1, android.os.CancellationSignal.OnCancelListener::class.java) }); null }
|
|
858
|
-
else ->
|
|
858
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
859
859
|
}
|
|
860
860
|
|
|
861
861
|
private fun callCancellationSignal_OnCancelListener(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
862
862
|
when (method) {
|
|
863
863
|
"CancellationSignal.OnCancelListener#onCancel()V" -> b.run { if (Build.VERSION.SDK_INT < 16) throw TokamakBinding.unavailable; b.target(android.os.CancellationSignal.OnCancelListener::class.java).onCancel(); null }
|
|
864
|
-
else ->
|
|
864
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
865
865
|
}
|
|
866
866
|
|
|
867
867
|
private fun callSystemClock(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
@@ -873,14 +873,14 @@ class Bindings(private val host: TokamakHost) : TokamakPlugin {
|
|
|
873
873
|
"SystemClock#currentThreadTimeMillis()J" -> b.run { b.encode(android.os.SystemClock.currentThreadTimeMillis()) }
|
|
874
874
|
"SystemClock#elapsedRealtimeNanos()J" -> b.run { if (Build.VERSION.SDK_INT < 17) throw TokamakBinding.unavailable; b.encode(android.os.SystemClock.elapsedRealtimeNanos()) }
|
|
875
875
|
"SystemClock#uptimeNanos()J" -> b.run { if (Build.VERSION.SDK_INT < 35) throw TokamakBinding.unavailable; b.encode(android.os.SystemClock.uptimeNanos()) }
|
|
876
|
-
else ->
|
|
876
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
877
877
|
}
|
|
878
878
|
|
|
879
879
|
private fun callConsumer(method: String, b: TokamakBinding): (() -> Unit)? =
|
|
880
880
|
when (method) {
|
|
881
881
|
"Consumer#accept(Ljava/lang/Object;)V" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; (b.target(java.util.function.Consumer::class.java) as java.util.function.Consumer<Any?>).accept(b.optional(b[0]) { x1 -> b.any(x1) }); null }
|
|
882
882
|
"Consumer#andThen(Ljava/util/function/Consumer;)Ljava/util/function/Consumer;" -> b.run { if (Build.VERSION.SDK_INT < 24) throw TokamakBinding.unavailable; b.encode((b.target(java.util.function.Consumer::class.java) as java.util.function.Consumer<Any?>).andThen(b.optional(b[0]) { x1 -> (b.obj(x1, java.util.function.Consumer::class.java) as java.util.function.Consumer<Any?>) })) }
|
|
883
|
-
else ->
|
|
883
|
+
else -> throw TokamakPluginError.notSupported("$method is not supported")
|
|
884
884
|
}
|
|
885
885
|
|
|
886
886
|
@androidx.annotation.RequiresApi(33)
|
|
@@ -80,7 +80,7 @@ internal class LocationEvents(private val host: TokamakHost) {
|
|
|
80
80
|
private fun send(method: String, name: String, event: JSONObject, finish: () -> Unit) {
|
|
81
81
|
listeners[method].orEmpty().values.toList().forEach { it(Result.success(event)) }
|
|
82
82
|
Thread {
|
|
83
|
-
runCatching { host.emit(name, event
|
|
83
|
+
runCatching { host.emit(name, event, EVENT_DEADLINE_MILLIS) }
|
|
84
84
|
.onFailure { Log.w("tokamak", "location $name failed: ${it.message}") }
|
|
85
85
|
host.context.mainExecutor.execute(finish)
|
|
86
86
|
}.start()
|