diff --git a/.github/actions/coverage/action.yml b/.github/actions/coverage/action.yml index 793488f143..d0167ffa2e 100644 --- a/.github/actions/coverage/action.yml +++ b/.github/actions/coverage/action.yml @@ -33,4 +33,4 @@ runs: with: path: './${{ inputs.directory }}/coverage/lcov.info' min_coverage: ${{ inputs.min-coverage }} - exclude: 'lib/src/native/cocoa/binding.dart' + exclude: 'lib/src/native/**/binding.dart lib/src/native/java/android_replay_recorder.dart' diff --git a/.github/file-filters.yml b/.github/file-filters.yml index 4da3356a47..7280ac9201 100644 --- a/.github/file-filters.yml +++ b/.github/file-filters.yml @@ -7,3 +7,4 @@ high_risk_code: &high_risk_code - "flutter/ios/Classes/SentryFlutterPluginApple.swift" - "flutter/lib/src/screenshot/recorder.dart" - "flutter/lib/src/screenshot/widget_filter.dart" + - "flutter/lib/src/native/java/android_replay_recorder.dart" diff --git a/CHANGELOG.md b/CHANGELOG.md index 76a3f7f93b..3cdad9b465 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased 9.0.0 +### Breaking changes + - Remove `SentryDisplayWidget` and manual TTID implementation ([#2668](https://github.com/getsentry/sentry-dart/pull/2668)) - Increase minimum SDK version requirements to Dart v3.5.0 and Flutter v3.24.0 ([#2643](https://github.com/getsentry/sentry-dart/pull/2643)) - Remove screenshot option `attachScreenshotOnlyWhenResumed` ([#2664](https://github.com/getsentry/sentry-dart/pull/2664)) @@ -12,6 +14,10 @@ - Add hint for transactions ([#2675](https://github.com/getsentry/sentry-dart/pull/2675)) - `BeforeSendTransactionCallback` now has a `Hint` parameter +### Enhancements + +- Replay: improve Android native interop performance by using JNI ([#2670](https://github.com/getsentry/sentry-dart/pull/2670)) + ### Dependencies - Bump Android SDK from v7.20.1 to v8.1.0 ([#2650](https://github.com/getsentry/sentry-dart/pull/2650)) diff --git a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt index 3634d151bd..6feda34795 100644 --- a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt +++ b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt @@ -1,5 +1,6 @@ package io.sentry.flutter +import android.annotation.SuppressLint import android.app.Activity import android.content.Context import android.content.res.Configuration @@ -35,7 +36,6 @@ import io.sentry.protocol.DebugImage import io.sentry.protocol.SentryId import io.sentry.protocol.User import io.sentry.transport.CurrentDateProvider -import java.io.File import java.lang.ref.WeakReference import kotlin.math.roundToInt @@ -49,7 +49,6 @@ class SentryFlutterPlugin : private lateinit var channel: MethodChannel private lateinit var context: Context private lateinit var sentryFlutter: SentryFlutter - private lateinit var replay: ReplayIntegration // Note: initial config because we don't yet have the numbers of the actual Flutter widget. // See how SentryFlutterReplayRecorder.start() handles it. New settings will be set by setReplayConfig() method below. @@ -103,7 +102,6 @@ class SentryFlutterPlugin : "displayRefreshRate" -> displayRefreshRate(result) "nativeCrash" -> crash() "setReplayConfig" -> setReplayConfig(call, result) - "addReplayScreenshot" -> addReplayScreenshot(call.argument("path"), call.argument("timestamp"), result) "captureReplay" -> captureReplay(call.argument("isCrash"), result) else -> result.notImplemented() } @@ -164,15 +162,13 @@ class SentryFlutterPlugin : private fun setupReplay(options: SentryAndroidOptions) { // Replace the default ReplayIntegration with a Flutter-specific recorder. options.integrations.removeAll { it is ReplayIntegration } - val cacheDirPath = options.cacheDirPath val replayOptions = options.sessionReplay - val isReplayEnabled = replayOptions.isSessionReplayEnabled || replayOptions.isSessionReplayForErrorsEnabled - if (cacheDirPath != null && isReplayEnabled) { + if (replayOptions.isSessionReplayEnabled || replayOptions.isSessionReplayForErrorsEnabled) { replay = ReplayIntegration( - context, + context.applicationContext, dateProvider = CurrentDateProvider.getInstance(), - recorderProvider = { SentryFlutterReplayRecorder(channel, replay) }, + recorderProvider = { SentryFlutterReplayRecorder(channel, replay!!) }, recorderConfigProvider = { Log.i( "Sentry", @@ -187,8 +183,8 @@ class SentryFlutterPlugin : }, replayCacheProvider = null, ) - replay.breadcrumbConverter = SentryFlutterReplayBreadcrumbConverter() - options.addIntegration(replay) + replay!!.breadcrumbConverter = SentryFlutterReplayBreadcrumbConverter() + options.addIntegration(replay!!) options.setReplayController(replay) } else { options.setReplayController(null) @@ -517,8 +513,13 @@ class SentryFlutterPlugin : } companion object { + @SuppressLint("StaticFieldLeak") + private var replay: ReplayIntegration? = null + private const val NATIVE_CRASH_WAIT_TIME = 500L + @JvmStatic fun privateSentryGetReplayIntegration(): ReplayIntegration? = replay + private fun crash() { val exception = RuntimeException("FlutterSentry Native Integration: Sample RuntimeException") val mainThread = Looper.getMainLooper().thread @@ -552,19 +553,6 @@ class SentryFlutterPlugin : result.success(serializedScope) } - private fun addReplayScreenshot( - path: String?, - timestamp: Long?, - result: Result, - ) { - if (path == null || timestamp == null) { - result.error("5", "Arguments are null", null) - return - } - replay.onScreenshotRecorded(File(path), timestamp) - result.success("") - } - private fun setReplayConfig( call: MethodCall, result: Result, @@ -614,7 +602,7 @@ class SentryFlutterPlugin : replayConfig.bitRate, ), ) - replay.onConfigurationChanged(Configuration()) + replay!!.onConfigurationChanged(Configuration()) result.success("") } @@ -626,7 +614,7 @@ class SentryFlutterPlugin : result.error("5", "Arguments are null", null) return } - replay.captureReplay(isCrash) - result.success(replay.getReplayId().toString()) + replay!!.captureReplay(isCrash) + result.success(replay!!.getReplayId().toString()) } } diff --git a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterReplayRecorder.kt b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterReplayRecorder.kt index c49fc23482..fb86ed4440 100644 --- a/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterReplayRecorder.kt +++ b/flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterReplayRecorder.kt @@ -19,17 +19,11 @@ internal class SentryFlutterReplayRecorder( return } - val cacheDirPath = integration.replayCacheDir?.absolutePath - if (cacheDirPath == null) { - Log.w("Sentry", "Replay cache directory is null, can't start replay recorder.") - return - } Handler(Looper.getMainLooper()).post { try { channel.invokeMethod( "ReplayRecorder.start", mapOf( - "directory" to cacheDirPath, "width" to recorderConfig.recordingWidth, "height" to recorderConfig.recordingHeight, "frameRate" to recorderConfig.frameRate, diff --git a/flutter/ffi-jni.yaml b/flutter/ffi-jni.yaml new file mode 100644 index 0000000000..1e4969aa2a --- /dev/null +++ b/flutter/ffi-jni.yaml @@ -0,0 +1,18 @@ +android_sdk_config: + add_gradle_deps: true + android_example: 'example/' + +# summarizer: +# backend: asm + +output: + dart: + path: lib/src/native/java/binding.dart + structure: single_file + +log_level: all + +classes: + - io.sentry.android.replay.ReplayIntegration + - io.sentry.flutter.SentryFlutterPlugin + - android.graphics.Bitmap diff --git a/flutter/lib/src/native/java/android_replay_recorder.dart b/flutter/lib/src/native/java/android_replay_recorder.dart index 2719558fef..f0af91d004 100644 --- a/flutter/lib/src/native/java/android_replay_recorder.dart +++ b/flutter/lib/src/native/java/android_replay_recorder.dart @@ -1,40 +1,63 @@ +import 'dart:async'; +import 'dart:isolate'; +import 'dart:typed_data'; + +import 'package:jni/jni.dart'; import 'package:meta/meta.dart'; import '../../../sentry_flutter.dart'; import '../../replay/scheduled_recorder.dart'; +import '../../replay/scheduled_recorder_config.dart'; import '../../screenshot/screenshot.dart'; -import '../sentry_safe_method_channel.dart'; +import 'binding.dart' as native; +// Note, this is currently not unit-tested because mocking JNI calls is +// cumbersome, see https://github.com/dart-lang/native/issues/1794 @internal class AndroidReplayRecorder extends ScheduledScreenshotRecorder { - final SentrySafeMethodChannel _channel; - final String _cacheDir; + _AndroidNativeReplayWorker? _worker; + + @internal // visible for testing, used by SentryNativeJava + static AndroidReplayRecorder Function( + ScheduledScreenshotRecorderConfig, SentryFlutterOptions) factory = + AndroidReplayRecorder.new; - AndroidReplayRecorder( - super.config, super.options, this._channel, this._cacheDir) { + AndroidReplayRecorder(super.config, super.options) { super.callback = _addReplayScreenshot; } + @override + Future start() async { + final spawningWorker = _AndroidNativeReplayWorker.spawn(); + super.start(); + _worker = await spawningWorker; + } + + @override + Future stop() async { + await super.stop(); + _worker?.close(); + _worker = null; + } + Future _addReplayScreenshot( Screenshot screenshot, bool isNewlyCaptured) async { final timestamp = screenshot.timestamp.millisecondsSinceEpoch; - final filePath = "$_cacheDir/$timestamp.png"; try { - final pngData = await screenshot.pngData; + final data = await screenshot.rawRgbaData; options.logger( SentryLevel.debug, - '$logName: saving ${isNewlyCaptured ? 'new' : 'repeated'} screenshot to' - ' $filePath (${screenshot.width}x${screenshot.height} pixels, ' - '${pngData.lengthInBytes} bytes)'); - await options.fileSystem - .file(filePath) - .writeAsBytes(pngData.buffer.asUint8List(), flush: true); - - await _channel.invokeMethod( - 'addReplayScreenshot', - {'path': filePath, 'timestamp': timestamp}, - ); + '$logName: captured screenshot (' + '${screenshot.width}x${screenshot.height} pixels, ' + '${data.lengthInBytes} bytes)'); + + await _worker!.nativeAddScreenshot(_WorkItem( + timestamp: timestamp, + data: data.buffer.asUint8List(), + width: screenshot.width, + height: screenshot.height, + )); } catch (error, stackTrace) { options.logger( SentryLevel.error, @@ -48,3 +71,140 @@ class AndroidReplayRecorder extends ScheduledScreenshotRecorder { } } } + +// Based on https://dart.dev/language/isolates#robust-ports-example +class _AndroidNativeReplayWorker { + final SendPort _commands; + final ReceivePort _responses; + final Map> _activeRequests = {}; + int _idCounter = 0; + bool _closed = false; + + static Future<_AndroidNativeReplayWorker> spawn() async { + // Create a receive port and add its initial message handler + final initPort = RawReceivePort(); + final connection = Completer<(ReceivePort, SendPort)>.sync(); + initPort.handler = (SendPort commandPort) { + connection.complete(( + ReceivePort.fromRawReceivePort(initPort), + commandPort, + )); + }; + + // Spawn the isolate. + try { + await Isolate.spawn(_startRemoteIsolate, (initPort.sendPort), + debugName: 'SentryReplayRecorder'); + } on Object { + initPort.close(); + rethrow; + } + + final (ReceivePort receivePort, SendPort sendPort) = + await connection.future; + + return _AndroidNativeReplayWorker._(receivePort, sendPort); + } + + _AndroidNativeReplayWorker._(this._responses, this._commands) { + _responses.listen(_handleResponsesFromIsolate); + } + + Future nativeAddScreenshot(_WorkItem item) async { + if (_closed) throw StateError('Closed'); + final completer = Completer.sync(); + final id = _idCounter++; + _activeRequests[id] = completer; + _commands.send((id, item)); + return await completer.future; + } + + void _handleResponsesFromIsolate(dynamic message) { + final (int id, Object? response) = message as (int, Object?); + final completer = _activeRequests.remove(id)!; + + if (response is RemoteError) { + completer.completeError(response); + } else { + completer.complete(response); + } + + if (_closed && _activeRequests.isEmpty) _responses.close(); + } + + /// This is the actual Android native implementation, the rest is just plumbing. + static void _handleCommandsToIsolate( + ReceivePort receivePort, + SendPort sendPort, + ) { + // Android Bitmap creation is a bit costly so we reuse it between captures. + native.Bitmap? bitmap; + + final _nativeReplay = native.SentryFlutterPlugin$Companion(null) + .privateSentryGetReplayIntegration()!; + + receivePort.listen((message) { + if (message == 'shutdown') { + receivePort.close(); + return; + } + final (id, item) = message as (int, _WorkItem); + try { + if (bitmap != null) { + if (bitmap!.getWidth() != item.width || + bitmap!.getHeight() != item.height) { + bitmap!.release(); + bitmap = null; + } + } + + // https://developer.android.com/reference/android/graphics/Bitmap#createBitmap(int,%20int,%20android.graphics.Bitmap.Config) + // Note: while the generated API is nullable, the docs say the returned value cannot be null.. + bitmap ??= native.Bitmap.createBitmap$3( + item.width, item.height, native.Bitmap$Config.ARGB_8888); + + final jBuffer = JByteBuffer.fromList(item.data); + try { + bitmap!.copyPixelsFromBuffer(jBuffer); + } finally { + jBuffer.release(); + } + + // TODO timestamp is currently missing in onScreenshotRecorded() + _nativeReplay.onScreenshotRecorded(bitmap!); + + sendPort.send((id, null)); + } catch (e, stacktrace) { + sendPort.send((id, RemoteError(e.toString(), stacktrace.toString()))); + } + }); + } + + static void _startRemoteIsolate(SendPort sendPort) { + final receivePort = ReceivePort(); + sendPort.send(receivePort.sendPort); + _handleCommandsToIsolate(receivePort, sendPort); + } + + void close() { + if (!_closed) { + _closed = true; + _commands.send('shutdown'); + if (_activeRequests.isEmpty) _responses.close(); + } + } +} + +class _WorkItem { + final int timestamp; + final Uint8List data; + final int width; + final int height; + + const _WorkItem({ + required this.timestamp, + required this.data, + required this.width, + required this.height, + }); +} diff --git a/flutter/lib/src/native/java/binding.dart b/flutter/lib/src/native/java/binding.dart new file mode 100644 index 0000000000..6e61ab5d11 --- /dev/null +++ b/flutter/lib/src/native/java/binding.dart @@ -0,0 +1,4084 @@ +// Autogenerated by jnigen. DO NOT EDIT! + +// ignore_for_file: annotate_overrides +// ignore_for_file: argument_type_not_assignable +// ignore_for_file: camel_case_extensions +// ignore_for_file: camel_case_types +// ignore_for_file: constant_identifier_names +// ignore_for_file: doc_directive_unknown +// ignore_for_file: file_names +// ignore_for_file: inference_failure_on_untyped_parameter +// ignore_for_file: invalid_internal_annotation +// ignore_for_file: invalid_use_of_internal_member +// ignore_for_file: library_prefixes +// ignore_for_file: lines_longer_than_80_chars +// ignore_for_file: no_leading_underscores_for_library_prefixes +// ignore_for_file: no_leading_underscores_for_local_identifiers +// ignore_for_file: non_constant_identifier_names +// ignore_for_file: only_throw_errors +// ignore_for_file: overridden_fields +// ignore_for_file: prefer_double_quotes +// ignore_for_file: unintended_html_in_doc_comment +// ignore_for_file: unnecessary_cast +// ignore_for_file: unnecessary_non_null_assertion +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: unused_element +// ignore_for_file: unused_field +// ignore_for_file: unused_import +// ignore_for_file: unused_local_variable +// ignore_for_file: unused_shown_name +// ignore_for_file: use_super_parameters + +import 'dart:core' show Object, String, bool, double, int; +import 'dart:core' as core$_; + +import 'package:jni/_internal.dart' as jni$_; +import 'package:jni/jni.dart' as jni$_; + +/// from: `io.sentry.android.replay.ReplayIntegration` +class ReplayIntegration extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; + + @jni$_.internal + ReplayIntegration.fromReference( + jni$_.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = + jni$_.JClass.forName(r'io/sentry/android/replay/ReplayIntegration'); + + /// The type which includes information such as the signature of this class. + static const nullableType = $ReplayIntegration$NullableType(); + static const type = $ReplayIntegration$Type(); + static final _id_new$ = _class.constructorId( + r'(Landroid/content/Context;Lio/sentry/transport/ICurrentDateProvider;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V', + ); + + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer + )>)>>('globalEnv_NewObject') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); + + /// from: `public void (android.content.Context context, io.sentry.transport.ICurrentDateProvider iCurrentDateProvider, kotlin.jvm.functions.Function0 function0, kotlin.jvm.functions.Function1 function1, kotlin.jvm.functions.Function1 function11)` + /// The returned object must be released after use, by calling the [release] method. + factory ReplayIntegration( + jni$_.JObject context, + jni$_.JObject iCurrentDateProvider, + jni$_.JObject? function0, + jni$_.JObject? function1, + jni$_.JObject? function11, + ) { + final _$context = context.reference; + final _$iCurrentDateProvider = iCurrentDateProvider.reference; + final _$function0 = function0?.reference ?? jni$_.jNullReference; + final _$function1 = function1?.reference ?? jni$_.jNullReference; + final _$function11 = function11?.reference ?? jni$_.jNullReference; + return ReplayIntegration.fromReference(_new$( + _class.reference.pointer, + _id_new$ as jni$_.JMethodIDPtr, + _$context.pointer, + _$iCurrentDateProvider.pointer, + _$function0.pointer, + _$function1.pointer, + _$function11.pointer) + .reference); + } + + static final _id_new$1 = _class.constructorId( + r'(Landroid/content/Context;Lio/sentry/transport/ICurrentDateProvider;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;ILkotlin/jvm/internal/DefaultConstructorMarker;)V', + ); + + static final _new$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_NewObject') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + int, + jni$_.Pointer)>(); + + /// from: `synthetic public void (android.content.Context context, io.sentry.transport.ICurrentDateProvider iCurrentDateProvider, kotlin.jvm.functions.Function0 function0, kotlin.jvm.functions.Function1 function1, kotlin.jvm.functions.Function1 function11, int i, kotlin.jvm.internal.DefaultConstructorMarker defaultConstructorMarker)` + /// The returned object must be released after use, by calling the [release] method. + factory ReplayIntegration.new$1( + jni$_.JObject? context, + jni$_.JObject? iCurrentDateProvider, + jni$_.JObject? function0, + jni$_.JObject? function1, + jni$_.JObject? function11, + int i, + jni$_.JObject? defaultConstructorMarker, + ) { + final _$context = context?.reference ?? jni$_.jNullReference; + final _$iCurrentDateProvider = + iCurrentDateProvider?.reference ?? jni$_.jNullReference; + final _$function0 = function0?.reference ?? jni$_.jNullReference; + final _$function1 = function1?.reference ?? jni$_.jNullReference; + final _$function11 = function11?.reference ?? jni$_.jNullReference; + final _$defaultConstructorMarker = + defaultConstructorMarker?.reference ?? jni$_.jNullReference; + return ReplayIntegration.fromReference(_new$1( + _class.reference.pointer, + _id_new$1 as jni$_.JMethodIDPtr, + _$context.pointer, + _$iCurrentDateProvider.pointer, + _$function0.pointer, + _$function1.pointer, + _$function11.pointer, + i, + _$defaultConstructorMarker.pointer) + .reference); + } + + static final _id_new$2 = _class.constructorId( + r'(Landroid/content/Context;Lio/sentry/transport/ICurrentDateProvider;)V', + ); + + static final _new$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer + )>)>>('globalEnv_NewObject') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); + + /// from: `public void (android.content.Context context, io.sentry.transport.ICurrentDateProvider iCurrentDateProvider)` + /// The returned object must be released after use, by calling the [release] method. + factory ReplayIntegration.new$2( + jni$_.JObject context, + jni$_.JObject iCurrentDateProvider, + ) { + final _$context = context.reference; + final _$iCurrentDateProvider = iCurrentDateProvider.reference; + return ReplayIntegration.fromReference(_new$2( + _class.reference.pointer, + _id_new$2 as jni$_.JMethodIDPtr, + _$context.pointer, + _$iCurrentDateProvider.pointer) + .reference); + } + + static final _id_new$3 = _class.constructorId( + r'(Landroid/content/Context;Lio/sentry/transport/ICurrentDateProvider;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lio/sentry/android/replay/util/MainLooperHandler;Lkotlin/jvm/functions/Function0;)V', + ); + + static final _new$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer + )>)>>('globalEnv_NewObject') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); + + /// from: `public void (android.content.Context context, io.sentry.transport.ICurrentDateProvider iCurrentDateProvider, kotlin.jvm.functions.Function0 function0, kotlin.jvm.functions.Function1 function1, kotlin.jvm.functions.Function1 function11, kotlin.jvm.functions.Function1 function12, io.sentry.android.replay.util.MainLooperHandler mainLooperHandler, kotlin.jvm.functions.Function0 function01)` + /// The returned object must be released after use, by calling the [release] method. + factory ReplayIntegration.new$3( + jni$_.JObject context, + jni$_.JObject iCurrentDateProvider, + jni$_.JObject? function0, + jni$_.JObject? function1, + jni$_.JObject? function11, + jni$_.JObject? function12, + jni$_.JObject? mainLooperHandler, + jni$_.JObject? function01, + ) { + final _$context = context.reference; + final _$iCurrentDateProvider = iCurrentDateProvider.reference; + final _$function0 = function0?.reference ?? jni$_.jNullReference; + final _$function1 = function1?.reference ?? jni$_.jNullReference; + final _$function11 = function11?.reference ?? jni$_.jNullReference; + final _$function12 = function12?.reference ?? jni$_.jNullReference; + final _$mainLooperHandler = + mainLooperHandler?.reference ?? jni$_.jNullReference; + final _$function01 = function01?.reference ?? jni$_.jNullReference; + return ReplayIntegration.fromReference(_new$3( + _class.reference.pointer, + _id_new$3 as jni$_.JMethodIDPtr, + _$context.pointer, + _$iCurrentDateProvider.pointer, + _$function0.pointer, + _$function1.pointer, + _$function11.pointer, + _$function12.pointer, + _$mainLooperHandler.pointer, + _$function01.pointer) + .reference); + } + + static final _id_new$4 = _class.constructorId( + r'(Landroid/content/Context;Lio/sentry/transport/ICurrentDateProvider;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lio/sentry/android/replay/util/MainLooperHandler;Lkotlin/jvm/functions/Function0;ILkotlin/jvm/internal/DefaultConstructorMarker;)V', + ); + + static final _new$4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_NewObject') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer, + int, + jni$_.Pointer)>(); + + /// from: `synthetic public void (android.content.Context context, io.sentry.transport.ICurrentDateProvider iCurrentDateProvider, kotlin.jvm.functions.Function0 function0, kotlin.jvm.functions.Function1 function1, kotlin.jvm.functions.Function1 function11, kotlin.jvm.functions.Function1 function12, io.sentry.android.replay.util.MainLooperHandler mainLooperHandler, kotlin.jvm.functions.Function0 function01, int i, kotlin.jvm.internal.DefaultConstructorMarker defaultConstructorMarker)` + /// The returned object must be released after use, by calling the [release] method. + factory ReplayIntegration.new$4( + jni$_.JObject? context, + jni$_.JObject? iCurrentDateProvider, + jni$_.JObject? function0, + jni$_.JObject? function1, + jni$_.JObject? function11, + jni$_.JObject? function12, + jni$_.JObject? mainLooperHandler, + jni$_.JObject? function01, + int i, + jni$_.JObject? defaultConstructorMarker, + ) { + final _$context = context?.reference ?? jni$_.jNullReference; + final _$iCurrentDateProvider = + iCurrentDateProvider?.reference ?? jni$_.jNullReference; + final _$function0 = function0?.reference ?? jni$_.jNullReference; + final _$function1 = function1?.reference ?? jni$_.jNullReference; + final _$function11 = function11?.reference ?? jni$_.jNullReference; + final _$function12 = function12?.reference ?? jni$_.jNullReference; + final _$mainLooperHandler = + mainLooperHandler?.reference ?? jni$_.jNullReference; + final _$function01 = function01?.reference ?? jni$_.jNullReference; + final _$defaultConstructorMarker = + defaultConstructorMarker?.reference ?? jni$_.jNullReference; + return ReplayIntegration.fromReference(_new$4( + _class.reference.pointer, + _id_new$4 as jni$_.JMethodIDPtr, + _$context.pointer, + _$iCurrentDateProvider.pointer, + _$function0.pointer, + _$function1.pointer, + _$function11.pointer, + _$function12.pointer, + _$mainLooperHandler.pointer, + _$function01.pointer, + i, + _$defaultConstructorMarker.pointer) + .reference); + } + + static final _id_getReplayCacheDir = _class.instanceMethodId( + r'getReplayCacheDir', + r'()Ljava/io/File;', + ); + + static final _getReplayCacheDir = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public final java.io.File getReplayCacheDir()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JObject? getReplayCacheDir() { + return _getReplayCacheDir( + reference.pointer, _id_getReplayCacheDir as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); + } + + static final _id_register = _class.instanceMethodId( + r'register', + r'(Lio/sentry/IScopes;Lio/sentry/SentryOptions;)V', + ); + + static final _register = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer + )>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); + + /// from: `public void register(io.sentry.IScopes iScopes, io.sentry.SentryOptions sentryOptions)` + void register( + jni$_.JObject iScopes, + jni$_.JObject sentryOptions, + ) { + final _$iScopes = iScopes.reference; + final _$sentryOptions = sentryOptions.reference; + _register(reference.pointer, _id_register as jni$_.JMethodIDPtr, + _$iScopes.pointer, _$sentryOptions.pointer) + .check(); + } + + static final _id_isRecording = _class.instanceMethodId( + r'isRecording', + r'()Z', + ); + + static final _isRecording = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallBooleanMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public boolean isRecording()` + bool isRecording() { + return _isRecording( + reference.pointer, _id_isRecording as jni$_.JMethodIDPtr) + .boolean; + } + + static final _id_start = _class.instanceMethodId( + r'start', + r'()V', + ); + + static final _start = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void start()` + void start() { + _start(reference.pointer, _id_start as jni$_.JMethodIDPtr).check(); + } + + static final _id_resume = _class.instanceMethodId( + r'resume', + r'()V', + ); + + static final _resume = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void resume()` + void resume() { + _resume(reference.pointer, _id_resume as jni$_.JMethodIDPtr).check(); + } + + static final _id_captureReplay = _class.instanceMethodId( + r'captureReplay', + r'(Ljava/lang/Boolean;)V', + ); + + static final _captureReplay = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void captureReplay(java.lang.Boolean boolean)` + void captureReplay( + jni$_.JBoolean? boolean, + ) { + final _$boolean = boolean?.reference ?? jni$_.jNullReference; + _captureReplay(reference.pointer, _id_captureReplay as jni$_.JMethodIDPtr, + _$boolean.pointer) + .check(); + } + + static final _id_getReplayId = _class.instanceMethodId( + r'getReplayId', + r'()Lio/sentry/protocol/SentryId;', + ); + + static final _getReplayId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public io.sentry.protocol.SentryId getReplayId()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JObject getReplayId() { + return _getReplayId( + reference.pointer, _id_getReplayId as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectType()); + } + + static final _id_setBreadcrumbConverter = _class.instanceMethodId( + r'setBreadcrumbConverter', + r'(Lio/sentry/ReplayBreadcrumbConverter;)V', + ); + + static final _setBreadcrumbConverter = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void setBreadcrumbConverter(io.sentry.ReplayBreadcrumbConverter replayBreadcrumbConverter)` + void setBreadcrumbConverter( + jni$_.JObject replayBreadcrumbConverter, + ) { + final _$replayBreadcrumbConverter = replayBreadcrumbConverter.reference; + _setBreadcrumbConverter( + reference.pointer, + _id_setBreadcrumbConverter as jni$_.JMethodIDPtr, + _$replayBreadcrumbConverter.pointer) + .check(); + } + + static final _id_getBreadcrumbConverter = _class.instanceMethodId( + r'getBreadcrumbConverter', + r'()Lio/sentry/ReplayBreadcrumbConverter;', + ); + + static final _getBreadcrumbConverter = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public io.sentry.ReplayBreadcrumbConverter getBreadcrumbConverter()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JObject getBreadcrumbConverter() { + return _getBreadcrumbConverter( + reference.pointer, _id_getBreadcrumbConverter as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectType()); + } + + static final _id_pause = _class.instanceMethodId( + r'pause', + r'()V', + ); + + static final _pause = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void pause()` + void pause() { + _pause(reference.pointer, _id_pause as jni$_.JMethodIDPtr).check(); + } + + static final _id_stop = _class.instanceMethodId( + r'stop', + r'()V', + ); + + static final _stop = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void stop()` + void stop() { + _stop(reference.pointer, _id_stop as jni$_.JMethodIDPtr).check(); + } + + static final _id_onScreenshotRecorded = _class.instanceMethodId( + r'onScreenshotRecorded', + r'(Landroid/graphics/Bitmap;)V', + ); + + static final _onScreenshotRecorded = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void onScreenshotRecorded(android.graphics.Bitmap bitmap)` + void onScreenshotRecorded( + Bitmap bitmap, + ) { + final _$bitmap = bitmap.reference; + _onScreenshotRecorded(reference.pointer, + _id_onScreenshotRecorded as jni$_.JMethodIDPtr, _$bitmap.pointer) + .check(); + } + + static final _id_onScreenshotRecorded$1 = _class.instanceMethodId( + r'onScreenshotRecorded', + r'(Ljava/io/File;J)V', + ); + + static final _onScreenshotRecorded$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int64)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); + + /// from: `public void onScreenshotRecorded(java.io.File file, long j)` + void onScreenshotRecorded$1( + jni$_.JObject file, + int j, + ) { + final _$file = file.reference; + _onScreenshotRecorded$1(reference.pointer, + _id_onScreenshotRecorded$1 as jni$_.JMethodIDPtr, _$file.pointer, j) + .check(); + } + + static final _id_close = _class.instanceMethodId( + r'close', + r'()V', + ); + + static final _close = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void close()` + void close() { + _close(reference.pointer, _id_close as jni$_.JMethodIDPtr).check(); + } + + static final _id_onConfigurationChanged = _class.instanceMethodId( + r'onConfigurationChanged', + r'(Landroid/content/res/Configuration;)V', + ); + + static final _onConfigurationChanged = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void onConfigurationChanged(android.content.res.Configuration configuration)` + void onConfigurationChanged( + jni$_.JObject configuration, + ) { + final _$configuration = configuration.reference; + _onConfigurationChanged( + reference.pointer, + _id_onConfigurationChanged as jni$_.JMethodIDPtr, + _$configuration.pointer) + .check(); + } + + static final _id_onConnectionStatusChanged = _class.instanceMethodId( + r'onConnectionStatusChanged', + r'(Lio/sentry/IConnectionStatusProvider$ConnectionStatus;)V', + ); + + static final _onConnectionStatusChanged = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void onConnectionStatusChanged(io.sentry.IConnectionStatusProvider$ConnectionStatus connectionStatus)` + void onConnectionStatusChanged( + jni$_.JObject connectionStatus, + ) { + final _$connectionStatus = connectionStatus.reference; + _onConnectionStatusChanged( + reference.pointer, + _id_onConnectionStatusChanged as jni$_.JMethodIDPtr, + _$connectionStatus.pointer) + .check(); + } + + static final _id_onRateLimitChanged = _class.instanceMethodId( + r'onRateLimitChanged', + r'(Lio/sentry/transport/RateLimiter;)V', + ); + + static final _onRateLimitChanged = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void onRateLimitChanged(io.sentry.transport.RateLimiter rateLimiter)` + void onRateLimitChanged( + jni$_.JObject rateLimiter, + ) { + final _$rateLimiter = rateLimiter.reference; + _onRateLimitChanged(reference.pointer, + _id_onRateLimitChanged as jni$_.JMethodIDPtr, _$rateLimiter.pointer) + .check(); + } + + static final _id_onLowMemory = _class.instanceMethodId( + r'onLowMemory', + r'()V', + ); + + static final _onLowMemory = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void onLowMemory()` + void onLowMemory() { + _onLowMemory(reference.pointer, _id_onLowMemory as jni$_.JMethodIDPtr) + .check(); + } + + static final _id_onTouchEvent = _class.instanceMethodId( + r'onTouchEvent', + r'(Landroid/view/MotionEvent;)V', + ); + + static final _onTouchEvent = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void onTouchEvent(android.view.MotionEvent motionEvent)` + void onTouchEvent( + jni$_.JObject motionEvent, + ) { + final _$motionEvent = motionEvent.reference; + _onTouchEvent(reference.pointer, _id_onTouchEvent as jni$_.JMethodIDPtr, + _$motionEvent.pointer) + .check(); + } +} + +final class $ReplayIntegration$NullableType + extends jni$_.JObjType { + @jni$_.internal + const $ReplayIntegration$NullableType(); + + @jni$_.internal + @core$_.override + String get signature => r'Lio/sentry/android/replay/ReplayIntegration;'; + + @jni$_.internal + @core$_.override + ReplayIntegration? fromReference(jni$_.JReference reference) => + reference.isNull + ? null + : ReplayIntegration.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($ReplayIntegration$NullableType).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($ReplayIntegration$NullableType) && + other is $ReplayIntegration$NullableType; + } +} + +final class $ReplayIntegration$Type extends jni$_.JObjType { + @jni$_.internal + const $ReplayIntegration$Type(); + + @jni$_.internal + @core$_.override + String get signature => r'Lio/sentry/android/replay/ReplayIntegration;'; + + @jni$_.internal + @core$_.override + ReplayIntegration fromReference(jni$_.JReference reference) => + ReplayIntegration.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => + const $ReplayIntegration$NullableType(); + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($ReplayIntegration$Type).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($ReplayIntegration$Type) && + other is $ReplayIntegration$Type; + } +} + +/// from: `io.sentry.flutter.SentryFlutterPlugin$Companion` +class SentryFlutterPlugin$Companion extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; + + @jni$_.internal + SentryFlutterPlugin$Companion.fromReference( + jni$_.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = + jni$_.JClass.forName(r'io/sentry/flutter/SentryFlutterPlugin$Companion'); + + /// The type which includes information such as the signature of this class. + static const nullableType = $SentryFlutterPlugin$Companion$NullableType(); + static const type = $SentryFlutterPlugin$Companion$Type(); + static final _id_privateSentryGetReplayIntegration = _class.instanceMethodId( + r'privateSentryGetReplayIntegration', + r'()Lio/sentry/android/replay/ReplayIntegration;', + ); + + static final _privateSentryGetReplayIntegration = + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public final io.sentry.android.replay.ReplayIntegration privateSentryGetReplayIntegration()` + /// The returned object must be released after use, by calling the [release] method. + ReplayIntegration? privateSentryGetReplayIntegration() { + return _privateSentryGetReplayIntegration(reference.pointer, + _id_privateSentryGetReplayIntegration as jni$_.JMethodIDPtr) + .object(const $ReplayIntegration$NullableType()); + } + + static final _id_new$ = _class.constructorId( + r'(Lkotlin/jvm/internal/DefaultConstructorMarker;)V', + ); + + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_NewObject') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `synthetic public void (kotlin.jvm.internal.DefaultConstructorMarker defaultConstructorMarker)` + /// The returned object must be released after use, by calling the [release] method. + factory SentryFlutterPlugin$Companion( + jni$_.JObject? defaultConstructorMarker, + ) { + final _$defaultConstructorMarker = + defaultConstructorMarker?.reference ?? jni$_.jNullReference; + return SentryFlutterPlugin$Companion.fromReference(_new$( + _class.reference.pointer, + _id_new$ as jni$_.JMethodIDPtr, + _$defaultConstructorMarker.pointer) + .reference); + } +} + +final class $SentryFlutterPlugin$Companion$NullableType + extends jni$_.JObjType { + @jni$_.internal + const $SentryFlutterPlugin$Companion$NullableType(); + + @jni$_.internal + @core$_.override + String get signature => r'Lio/sentry/flutter/SentryFlutterPlugin$Companion;'; + + @jni$_.internal + @core$_.override + SentryFlutterPlugin$Companion? fromReference(jni$_.JReference reference) => + reference.isNull + ? null + : SentryFlutterPlugin$Companion.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($SentryFlutterPlugin$Companion$NullableType).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($SentryFlutterPlugin$Companion$NullableType) && + other is $SentryFlutterPlugin$Companion$NullableType; + } +} + +final class $SentryFlutterPlugin$Companion$Type + extends jni$_.JObjType { + @jni$_.internal + const $SentryFlutterPlugin$Companion$Type(); + + @jni$_.internal + @core$_.override + String get signature => r'Lio/sentry/flutter/SentryFlutterPlugin$Companion;'; + + @jni$_.internal + @core$_.override + SentryFlutterPlugin$Companion fromReference(jni$_.JReference reference) => + SentryFlutterPlugin$Companion.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => + const $SentryFlutterPlugin$Companion$NullableType(); + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($SentryFlutterPlugin$Companion$Type).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($SentryFlutterPlugin$Companion$Type) && + other is $SentryFlutterPlugin$Companion$Type; + } +} + +/// from: `io.sentry.flutter.SentryFlutterPlugin` +class SentryFlutterPlugin extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; + + @jni$_.internal + SentryFlutterPlugin.fromReference( + jni$_.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = + jni$_.JClass.forName(r'io/sentry/flutter/SentryFlutterPlugin'); + + /// The type which includes information such as the signature of this class. + static const nullableType = $SentryFlutterPlugin$NullableType(); + static const type = $SentryFlutterPlugin$Type(); + static final _id_Companion = _class.staticFieldId( + r'Companion', + r'Lio/sentry/flutter/SentryFlutterPlugin$Companion;', + ); + + /// from: `static public final io.sentry.flutter.SentryFlutterPlugin$Companion Companion` + /// The returned object must be released after use, by calling the [release] method. + static SentryFlutterPlugin$Companion get Companion => + _id_Companion.get(_class, const $SentryFlutterPlugin$Companion$Type()); + + static final _id_new$ = _class.constructorId( + r'()V', + ); + + static final _new$ = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_NewObject') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void ()` + /// The returned object must be released after use, by calling the [release] method. + factory SentryFlutterPlugin() { + return SentryFlutterPlugin.fromReference( + _new$(_class.reference.pointer, _id_new$ as jni$_.JMethodIDPtr) + .reference); + } + + static final _id_onAttachedToEngine = _class.instanceMethodId( + r'onAttachedToEngine', + r'(Lio/flutter/embedding/engine/plugins/FlutterPlugin$FlutterPluginBinding;)V', + ); + + static final _onAttachedToEngine = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void onAttachedToEngine(io.flutter.embedding.engine.plugins.FlutterPlugin$FlutterPluginBinding flutterPluginBinding)` + void onAttachedToEngine( + jni$_.JObject flutterPluginBinding, + ) { + final _$flutterPluginBinding = flutterPluginBinding.reference; + _onAttachedToEngine( + reference.pointer, + _id_onAttachedToEngine as jni$_.JMethodIDPtr, + _$flutterPluginBinding.pointer) + .check(); + } + + static final _id_onMethodCall = _class.instanceMethodId( + r'onMethodCall', + r'(Lio/flutter/plugin/common/MethodCall;Lio/flutter/plugin/common/MethodChannel$Result;)V', + ); + + static final _onMethodCall = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer + )>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); + + /// from: `public void onMethodCall(io.flutter.plugin.common.MethodCall methodCall, io.flutter.plugin.common.MethodChannel$Result result)` + void onMethodCall( + jni$_.JObject methodCall, + jni$_.JObject result, + ) { + final _$methodCall = methodCall.reference; + final _$result = result.reference; + _onMethodCall(reference.pointer, _id_onMethodCall as jni$_.JMethodIDPtr, + _$methodCall.pointer, _$result.pointer) + .check(); + } + + static final _id_onDetachedFromEngine = _class.instanceMethodId( + r'onDetachedFromEngine', + r'(Lio/flutter/embedding/engine/plugins/FlutterPlugin$FlutterPluginBinding;)V', + ); + + static final _onDetachedFromEngine = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void onDetachedFromEngine(io.flutter.embedding.engine.plugins.FlutterPlugin$FlutterPluginBinding flutterPluginBinding)` + void onDetachedFromEngine( + jni$_.JObject flutterPluginBinding, + ) { + final _$flutterPluginBinding = flutterPluginBinding.reference; + _onDetachedFromEngine( + reference.pointer, + _id_onDetachedFromEngine as jni$_.JMethodIDPtr, + _$flutterPluginBinding.pointer) + .check(); + } + + static final _id_onAttachedToActivity = _class.instanceMethodId( + r'onAttachedToActivity', + r'(Lio/flutter/embedding/engine/plugins/activity/ActivityPluginBinding;)V', + ); + + static final _onAttachedToActivity = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void onAttachedToActivity(io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding activityPluginBinding)` + void onAttachedToActivity( + jni$_.JObject activityPluginBinding, + ) { + final _$activityPluginBinding = activityPluginBinding.reference; + _onAttachedToActivity( + reference.pointer, + _id_onAttachedToActivity as jni$_.JMethodIDPtr, + _$activityPluginBinding.pointer) + .check(); + } + + static final _id_onDetachedFromActivity = _class.instanceMethodId( + r'onDetachedFromActivity', + r'()V', + ); + + static final _onDetachedFromActivity = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void onDetachedFromActivity()` + void onDetachedFromActivity() { + _onDetachedFromActivity( + reference.pointer, _id_onDetachedFromActivity as jni$_.JMethodIDPtr) + .check(); + } + + static final _id_onReattachedToActivityForConfigChanges = + _class.instanceMethodId( + r'onReattachedToActivityForConfigChanges', + r'(Lio/flutter/embedding/engine/plugins/activity/ActivityPluginBinding;)V', + ); + + static final _onReattachedToActivityForConfigChanges = + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void onReattachedToActivityForConfigChanges(io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding activityPluginBinding)` + void onReattachedToActivityForConfigChanges( + jni$_.JObject activityPluginBinding, + ) { + final _$activityPluginBinding = activityPluginBinding.reference; + _onReattachedToActivityForConfigChanges( + reference.pointer, + _id_onReattachedToActivityForConfigChanges as jni$_.JMethodIDPtr, + _$activityPluginBinding.pointer) + .check(); + } + + static final _id_onDetachedFromActivityForConfigChanges = + _class.instanceMethodId( + r'onDetachedFromActivityForConfigChanges', + r'()V', + ); + + static final _onDetachedFromActivityForConfigChanges = + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void onDetachedFromActivityForConfigChanges()` + void onDetachedFromActivityForConfigChanges() { + _onDetachedFromActivityForConfigChanges(reference.pointer, + _id_onDetachedFromActivityForConfigChanges as jni$_.JMethodIDPtr) + .check(); + } + + static final _id_privateSentryGetReplayIntegration = _class.staticMethodId( + r'privateSentryGetReplayIntegration', + r'()Lio/sentry/android/replay/ReplayIntegration;', + ); + + static final _privateSentryGetReplayIntegration = + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `static public final io.sentry.android.replay.ReplayIntegration privateSentryGetReplayIntegration()` + /// The returned object must be released after use, by calling the [release] method. + static ReplayIntegration? privateSentryGetReplayIntegration() { + return _privateSentryGetReplayIntegration(_class.reference.pointer, + _id_privateSentryGetReplayIntegration as jni$_.JMethodIDPtr) + .object(const $ReplayIntegration$NullableType()); + } +} + +final class $SentryFlutterPlugin$NullableType + extends jni$_.JObjType { + @jni$_.internal + const $SentryFlutterPlugin$NullableType(); + + @jni$_.internal + @core$_.override + String get signature => r'Lio/sentry/flutter/SentryFlutterPlugin;'; + + @jni$_.internal + @core$_.override + SentryFlutterPlugin? fromReference(jni$_.JReference reference) => + reference.isNull + ? null + : SentryFlutterPlugin.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($SentryFlutterPlugin$NullableType).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($SentryFlutterPlugin$NullableType) && + other is $SentryFlutterPlugin$NullableType; + } +} + +final class $SentryFlutterPlugin$Type + extends jni$_.JObjType { + @jni$_.internal + const $SentryFlutterPlugin$Type(); + + @jni$_.internal + @core$_.override + String get signature => r'Lio/sentry/flutter/SentryFlutterPlugin;'; + + @jni$_.internal + @core$_.override + SentryFlutterPlugin fromReference(jni$_.JReference reference) => + SentryFlutterPlugin.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => + const $SentryFlutterPlugin$NullableType(); + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($SentryFlutterPlugin$Type).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($SentryFlutterPlugin$Type) && + other is $SentryFlutterPlugin$Type; + } +} + +/// from: `android.graphics.Bitmap$CompressFormat` +class Bitmap$CompressFormat extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; + + @jni$_.internal + Bitmap$CompressFormat.fromReference( + jni$_.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = + jni$_.JClass.forName(r'android/graphics/Bitmap$CompressFormat'); + + /// The type which includes information such as the signature of this class. + static const nullableType = $Bitmap$CompressFormat$NullableType(); + static const type = $Bitmap$CompressFormat$Type(); + static final _id_JPEG = _class.staticFieldId( + r'JPEG', + r'Landroid/graphics/Bitmap$CompressFormat;', + ); + + /// from: `static public final android.graphics.Bitmap$CompressFormat JPEG` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$CompressFormat get JPEG => + _id_JPEG.get(_class, const $Bitmap$CompressFormat$Type()); + + static final _id_PNG = _class.staticFieldId( + r'PNG', + r'Landroid/graphics/Bitmap$CompressFormat;', + ); + + /// from: `static public final android.graphics.Bitmap$CompressFormat PNG` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$CompressFormat get PNG => + _id_PNG.get(_class, const $Bitmap$CompressFormat$Type()); + + static final _id_WEBP = _class.staticFieldId( + r'WEBP', + r'Landroid/graphics/Bitmap$CompressFormat;', + ); + + /// from: `static public final android.graphics.Bitmap$CompressFormat WEBP` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$CompressFormat get WEBP => + _id_WEBP.get(_class, const $Bitmap$CompressFormat$Type()); + + static final _id_WEBP_LOSSY = _class.staticFieldId( + r'WEBP_LOSSY', + r'Landroid/graphics/Bitmap$CompressFormat;', + ); + + /// from: `static public final android.graphics.Bitmap$CompressFormat WEBP_LOSSY` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$CompressFormat get WEBP_LOSSY => + _id_WEBP_LOSSY.get(_class, const $Bitmap$CompressFormat$Type()); + + static final _id_WEBP_LOSSLESS = _class.staticFieldId( + r'WEBP_LOSSLESS', + r'Landroid/graphics/Bitmap$CompressFormat;', + ); + + /// from: `static public final android.graphics.Bitmap$CompressFormat WEBP_LOSSLESS` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$CompressFormat get WEBP_LOSSLESS => + _id_WEBP_LOSSLESS.get(_class, const $Bitmap$CompressFormat$Type()); + + static final _id_values = _class.staticMethodId( + r'values', + r'()[Landroid/graphics/Bitmap$CompressFormat;', + ); + + static final _values = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `static public android.graphics.Bitmap$CompressFormat[] values()` + /// The returned object must be released after use, by calling the [release] method. + static jni$_.JArray? values() { + return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType( + $Bitmap$CompressFormat$NullableType())); + } + + static final _id_valueOf = _class.staticMethodId( + r'valueOf', + r'(Ljava/lang/String;)Landroid/graphics/Bitmap$CompressFormat;', + ); + + static final _valueOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap$CompressFormat valueOf(java.lang.String synthetic)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$CompressFormat? valueOf( + jni$_.JString? synthetic, + ) { + final _$synthetic = synthetic?.reference ?? jni$_.jNullReference; + return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, + _$synthetic.pointer) + .object( + const $Bitmap$CompressFormat$NullableType()); + } +} + +final class $Bitmap$CompressFormat$NullableType + extends jni$_.JObjType { + @jni$_.internal + const $Bitmap$CompressFormat$NullableType(); + + @jni$_.internal + @core$_.override + String get signature => r'Landroid/graphics/Bitmap$CompressFormat;'; + + @jni$_.internal + @core$_.override + Bitmap$CompressFormat? fromReference(jni$_.JReference reference) => + reference.isNull + ? null + : Bitmap$CompressFormat.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($Bitmap$CompressFormat$NullableType).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($Bitmap$CompressFormat$NullableType) && + other is $Bitmap$CompressFormat$NullableType; + } +} + +final class $Bitmap$CompressFormat$Type + extends jni$_.JObjType { + @jni$_.internal + const $Bitmap$CompressFormat$Type(); + + @jni$_.internal + @core$_.override + String get signature => r'Landroid/graphics/Bitmap$CompressFormat;'; + + @jni$_.internal + @core$_.override + Bitmap$CompressFormat fromReference(jni$_.JReference reference) => + Bitmap$CompressFormat.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => + const $Bitmap$CompressFormat$NullableType(); + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($Bitmap$CompressFormat$Type).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($Bitmap$CompressFormat$Type) && + other is $Bitmap$CompressFormat$Type; + } +} + +/// from: `android.graphics.Bitmap$Config` +class Bitmap$Config extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; + + @jni$_.internal + Bitmap$Config.fromReference( + jni$_.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = jni$_.JClass.forName(r'android/graphics/Bitmap$Config'); + + /// The type which includes information such as the signature of this class. + static const nullableType = $Bitmap$Config$NullableType(); + static const type = $Bitmap$Config$Type(); + static final _id_ALPHA_8 = _class.staticFieldId( + r'ALPHA_8', + r'Landroid/graphics/Bitmap$Config;', + ); + + /// from: `static public final android.graphics.Bitmap$Config ALPHA_8` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$Config get ALPHA_8 => + _id_ALPHA_8.get(_class, const $Bitmap$Config$Type()); + + static final _id_RGB_565 = _class.staticFieldId( + r'RGB_565', + r'Landroid/graphics/Bitmap$Config;', + ); + + /// from: `static public final android.graphics.Bitmap$Config RGB_565` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$Config get RGB_565 => + _id_RGB_565.get(_class, const $Bitmap$Config$Type()); + + static final _id_ARGB_4444 = _class.staticFieldId( + r'ARGB_4444', + r'Landroid/graphics/Bitmap$Config;', + ); + + /// from: `static public final android.graphics.Bitmap$Config ARGB_4444` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$Config get ARGB_4444 => + _id_ARGB_4444.get(_class, const $Bitmap$Config$Type()); + + static final _id_ARGB_8888 = _class.staticFieldId( + r'ARGB_8888', + r'Landroid/graphics/Bitmap$Config;', + ); + + /// from: `static public final android.graphics.Bitmap$Config ARGB_8888` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$Config get ARGB_8888 => + _id_ARGB_8888.get(_class, const $Bitmap$Config$Type()); + + static final _id_RGBA_F16 = _class.staticFieldId( + r'RGBA_F16', + r'Landroid/graphics/Bitmap$Config;', + ); + + /// from: `static public final android.graphics.Bitmap$Config RGBA_F16` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$Config get RGBA_F16 => + _id_RGBA_F16.get(_class, const $Bitmap$Config$Type()); + + static final _id_HARDWARE = _class.staticFieldId( + r'HARDWARE', + r'Landroid/graphics/Bitmap$Config;', + ); + + /// from: `static public final android.graphics.Bitmap$Config HARDWARE` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$Config get HARDWARE => + _id_HARDWARE.get(_class, const $Bitmap$Config$Type()); + + static final _id_RGBA_1010102 = _class.staticFieldId( + r'RGBA_1010102', + r'Landroid/graphics/Bitmap$Config;', + ); + + /// from: `static public final android.graphics.Bitmap$Config RGBA_1010102` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$Config get RGBA_1010102 => + _id_RGBA_1010102.get(_class, const $Bitmap$Config$Type()); + + static final _id_values = _class.staticMethodId( + r'values', + r'()[Landroid/graphics/Bitmap$Config;', + ); + + static final _values = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `static public android.graphics.Bitmap$Config[] values()` + /// The returned object must be released after use, by calling the [release] method. + static jni$_.JArray? values() { + return _values(_class.reference.pointer, _id_values as jni$_.JMethodIDPtr) + .object?>( + const jni$_.JArrayNullableType( + $Bitmap$Config$NullableType())); + } + + static final _id_valueOf = _class.staticMethodId( + r'valueOf', + r'(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;', + ); + + static final _valueOf = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap$Config valueOf(java.lang.String synthetic)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap$Config? valueOf( + jni$_.JString? synthetic, + ) { + final _$synthetic = synthetic?.reference ?? jni$_.jNullReference; + return _valueOf(_class.reference.pointer, _id_valueOf as jni$_.JMethodIDPtr, + _$synthetic.pointer) + .object(const $Bitmap$Config$NullableType()); + } +} + +final class $Bitmap$Config$NullableType extends jni$_.JObjType { + @jni$_.internal + const $Bitmap$Config$NullableType(); + + @jni$_.internal + @core$_.override + String get signature => r'Landroid/graphics/Bitmap$Config;'; + + @jni$_.internal + @core$_.override + Bitmap$Config? fromReference(jni$_.JReference reference) => reference.isNull + ? null + : Bitmap$Config.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($Bitmap$Config$NullableType).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($Bitmap$Config$NullableType) && + other is $Bitmap$Config$NullableType; + } +} + +final class $Bitmap$Config$Type extends jni$_.JObjType { + @jni$_.internal + const $Bitmap$Config$Type(); + + @jni$_.internal + @core$_.override + String get signature => r'Landroid/graphics/Bitmap$Config;'; + + @jni$_.internal + @core$_.override + Bitmap$Config fromReference(jni$_.JReference reference) => + Bitmap$Config.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => + const $Bitmap$Config$NullableType(); + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($Bitmap$Config$Type).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($Bitmap$Config$Type) && + other is $Bitmap$Config$Type; + } +} + +/// from: `android.graphics.Bitmap` +class Bitmap extends jni$_.JObject { + @jni$_.internal + @core$_.override + final jni$_.JObjType $type; + + @jni$_.internal + Bitmap.fromReference( + jni$_.JReference reference, + ) : $type = type, + super.fromReference(reference); + + static final _class = jni$_.JClass.forName(r'android/graphics/Bitmap'); + + /// The type which includes information such as the signature of this class. + static const nullableType = $Bitmap$NullableType(); + static const type = $Bitmap$Type(); + static final _id_CREATOR = _class.staticFieldId( + r'CREATOR', + r'Landroid/os/Parcelable$Creator;', + ); + + /// from: `static public final android.os.Parcelable$Creator CREATOR` + /// The returned object must be released after use, by calling the [release] method. + static jni$_.JObject? get CREATOR => + _id_CREATOR.get(_class, const jni$_.JObjectNullableType()); + + /// from: `static public final int DENSITY_NONE` + static const DENSITY_NONE = 0; + static final _id_getDensity = _class.instanceMethodId( + r'getDensity', + r'()I', + ); + + static final _getDensity = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public int getDensity()` + int getDensity() { + return _getDensity(reference.pointer, _id_getDensity as jni$_.JMethodIDPtr) + .integer; + } + + static final _id_setDensity = _class.instanceMethodId( + r'setDensity', + r'(I)V', + ); + + static final _setDensity = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + + /// from: `public void setDensity(int i)` + void setDensity( + int i, + ) { + _setDensity(reference.pointer, _id_setDensity as jni$_.JMethodIDPtr, i) + .check(); + } + + static final _id_reconfigure = _class.instanceMethodId( + r'reconfigure', + r'(IILandroid/graphics/Bitmap$Config;)V', + ); + + static final _reconfigure = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, jni$_.Pointer)>(); + + /// from: `public void reconfigure(int i, int i1, android.graphics.Bitmap$Config config)` + void reconfigure( + int i, + int i1, + Bitmap$Config? config, + ) { + final _$config = config?.reference ?? jni$_.jNullReference; + _reconfigure(reference.pointer, _id_reconfigure as jni$_.JMethodIDPtr, i, + i1, _$config.pointer) + .check(); + } + + static final _id_setWidth = _class.instanceMethodId( + r'setWidth', + r'(I)V', + ); + + static final _setWidth = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + + /// from: `public void setWidth(int i)` + void setWidth( + int i, + ) { + _setWidth(reference.pointer, _id_setWidth as jni$_.JMethodIDPtr, i).check(); + } + + static final _id_setHeight = _class.instanceMethodId( + r'setHeight', + r'(I)V', + ); + + static final _setHeight = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + + /// from: `public void setHeight(int i)` + void setHeight( + int i, + ) { + _setHeight(reference.pointer, _id_setHeight as jni$_.JMethodIDPtr, i) + .check(); + } + + static final _id_setConfig = _class.instanceMethodId( + r'setConfig', + r'(Landroid/graphics/Bitmap$Config;)V', + ); + + static final _setConfig = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void setConfig(android.graphics.Bitmap$Config config)` + void setConfig( + Bitmap$Config? config, + ) { + final _$config = config?.reference ?? jni$_.jNullReference; + _setConfig(reference.pointer, _id_setConfig as jni$_.JMethodIDPtr, + _$config.pointer) + .check(); + } + + static final _id_recycle = _class.instanceMethodId( + r'recycle', + r'()V', + ); + + static final _recycle = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void recycle()` + void recycle() { + _recycle(reference.pointer, _id_recycle as jni$_.JMethodIDPtr).check(); + } + + static final _id_isRecycled = _class.instanceMethodId( + r'isRecycled', + r'()Z', + ); + + static final _isRecycled = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallBooleanMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public boolean isRecycled()` + bool isRecycled() { + return _isRecycled(reference.pointer, _id_isRecycled as jni$_.JMethodIDPtr) + .boolean; + } + + static final _id_getGenerationId = _class.instanceMethodId( + r'getGenerationId', + r'()I', + ); + + static final _getGenerationId = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public int getGenerationId()` + int getGenerationId() { + return _getGenerationId( + reference.pointer, _id_getGenerationId as jni$_.JMethodIDPtr) + .integer; + } + + static final _id_copyPixelsToBuffer = _class.instanceMethodId( + r'copyPixelsToBuffer', + r'(Ljava/nio/Buffer;)V', + ); + + static final _copyPixelsToBuffer = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void copyPixelsToBuffer(java.nio.Buffer buffer)` + void copyPixelsToBuffer( + jni$_.JBuffer? buffer, + ) { + final _$buffer = buffer?.reference ?? jni$_.jNullReference; + _copyPixelsToBuffer(reference.pointer, + _id_copyPixelsToBuffer as jni$_.JMethodIDPtr, _$buffer.pointer) + .check(); + } + + static final _id_copyPixelsFromBuffer = _class.instanceMethodId( + r'copyPixelsFromBuffer', + r'(Ljava/nio/Buffer;)V', + ); + + static final _copyPixelsFromBuffer = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void copyPixelsFromBuffer(java.nio.Buffer buffer)` + void copyPixelsFromBuffer( + jni$_.JBuffer? buffer, + ) { + final _$buffer = buffer?.reference ?? jni$_.jNullReference; + _copyPixelsFromBuffer(reference.pointer, + _id_copyPixelsFromBuffer as jni$_.JMethodIDPtr, _$buffer.pointer) + .check(); + } + + static final _id_copy = _class.instanceMethodId( + r'copy', + r'(Landroid/graphics/Bitmap$Config;Z)Landroid/graphics/Bitmap;', + ); + + static final _copy = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); + + /// from: `public android.graphics.Bitmap copy(android.graphics.Bitmap$Config config, boolean z)` + /// The returned object must be released after use, by calling the [release] method. + Bitmap? copy( + Bitmap$Config? config, + bool z, + ) { + final _$config = config?.reference ?? jni$_.jNullReference; + return _copy(reference.pointer, _id_copy as jni$_.JMethodIDPtr, + _$config.pointer, z ? 1 : 0) + .object(const $Bitmap$NullableType()); + } + + static final _id_asShared = _class.instanceMethodId( + r'asShared', + r'()Landroid/graphics/Bitmap;', + ); + + static final _asShared = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public android.graphics.Bitmap asShared()` + /// The returned object must be released after use, by calling the [release] method. + Bitmap? asShared() { + return _asShared(reference.pointer, _id_asShared as jni$_.JMethodIDPtr) + .object(const $Bitmap$NullableType()); + } + + static final _id_wrapHardwareBuffer = _class.staticMethodId( + r'wrapHardwareBuffer', + r'(Landroid/hardware/HardwareBuffer;Landroid/graphics/ColorSpace;)Landroid/graphics/Bitmap;', + ); + + static final _wrapHardwareBuffer = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap wrapHardwareBuffer(android.hardware.HardwareBuffer hardwareBuffer, android.graphics.ColorSpace colorSpace)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? wrapHardwareBuffer( + jni$_.JObject? hardwareBuffer, + jni$_.JObject? colorSpace, + ) { + final _$hardwareBuffer = hardwareBuffer?.reference ?? jni$_.jNullReference; + final _$colorSpace = colorSpace?.reference ?? jni$_.jNullReference; + return _wrapHardwareBuffer( + _class.reference.pointer, + _id_wrapHardwareBuffer as jni$_.JMethodIDPtr, + _$hardwareBuffer.pointer, + _$colorSpace.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createScaledBitmap = _class.staticMethodId( + r'createScaledBitmap', + r'(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;', + ); + + static final _createScaledBitmap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int, int, int)>(); + + /// from: `static public android.graphics.Bitmap createScaledBitmap(android.graphics.Bitmap bitmap, int i, int i1, boolean z)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createScaledBitmap( + Bitmap? bitmap, + int i, + int i1, + bool z, + ) { + final _$bitmap = bitmap?.reference ?? jni$_.jNullReference; + return _createScaledBitmap( + _class.reference.pointer, + _id_createScaledBitmap as jni$_.JMethodIDPtr, + _$bitmap.pointer, + i, + i1, + z ? 1 : 0) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap = _class.staticMethodId( + r'createBitmap', + r'(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(android.graphics.Bitmap bitmap)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap( + Bitmap? bitmap, + ) { + final _$bitmap = bitmap?.reference ?? jni$_.jNullReference; + return _createBitmap(_class.reference.pointer, + _id_createBitmap as jni$_.JMethodIDPtr, _$bitmap.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$1 = _class.staticMethodId( + r'createBitmap', + r'(Landroid/graphics/Bitmap;IIII)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + int, + int, + int)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(android.graphics.Bitmap bitmap, int i, int i1, int i2, int i3)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$1( + Bitmap? bitmap, + int i, + int i1, + int i2, + int i3, + ) { + final _$bitmap = bitmap?.reference ?? jni$_.jNullReference; + return _createBitmap$1( + _class.reference.pointer, + _id_createBitmap$1 as jni$_.JMethodIDPtr, + _$bitmap.pointer, + i, + i1, + i2, + i3) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$2 = _class.staticMethodId( + r'createBitmap', + r'(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer, + jni$_.Int32 + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + int, + int, + int, + jni$_.Pointer, + int)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(android.graphics.Bitmap bitmap, int i, int i1, int i2, int i3, android.graphics.Matrix matrix, boolean z)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$2( + Bitmap? bitmap, + int i, + int i1, + int i2, + int i3, + jni$_.JObject? matrix, + bool z, + ) { + final _$bitmap = bitmap?.reference ?? jni$_.jNullReference; + final _$matrix = matrix?.reference ?? jni$_.jNullReference; + return _createBitmap$2( + _class.reference.pointer, + _id_createBitmap$2 as jni$_.JMethodIDPtr, + _$bitmap.pointer, + i, + i1, + i2, + i3, + _$matrix.pointer, + z ? 1 : 0) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$3 = _class.staticMethodId( + r'createBitmap', + r'(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$3 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(int i, int i1, android.graphics.Bitmap$Config config)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$3( + int i, + int i1, + Bitmap$Config? config, + ) { + final _$config = config?.reference ?? jni$_.jNullReference; + return _createBitmap$3(_class.reference.pointer, + _id_createBitmap$3 as jni$_.JMethodIDPtr, i, i1, _$config.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$4 = _class.staticMethodId( + r'createBitmap', + r'(Landroid/util/DisplayMetrics;IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$4 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + int, + jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(android.util.DisplayMetrics displayMetrics, int i, int i1, android.graphics.Bitmap$Config config)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$4( + jni$_.JObject? displayMetrics, + int i, + int i1, + Bitmap$Config? config, + ) { + final _$displayMetrics = displayMetrics?.reference ?? jni$_.jNullReference; + final _$config = config?.reference ?? jni$_.jNullReference; + return _createBitmap$4( + _class.reference.pointer, + _id_createBitmap$4 as jni$_.JMethodIDPtr, + _$displayMetrics.pointer, + i, + i1, + _$config.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$5 = _class.staticMethodId( + r'createBitmap', + r'(IILandroid/graphics/Bitmap$Config;Z)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$5 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer, + jni$_.Int32 + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, int, jni$_.Pointer, int)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(int i, int i1, android.graphics.Bitmap$Config config, boolean z)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$5( + int i, + int i1, + Bitmap$Config? config, + bool z, + ) { + final _$config = config?.reference ?? jni$_.jNullReference; + return _createBitmap$5( + _class.reference.pointer, + _id_createBitmap$5 as jni$_.JMethodIDPtr, + i, + i1, + _$config.pointer, + z ? 1 : 0) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$6 = _class.staticMethodId( + r'createBitmap', + r'(IILandroid/graphics/Bitmap$Config;ZLandroid/graphics/ColorSpace;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$6 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + int, + int, + jni$_.Pointer, + int, + jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(int i, int i1, android.graphics.Bitmap$Config config, boolean z, android.graphics.ColorSpace colorSpace)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$6( + int i, + int i1, + Bitmap$Config? config, + bool z, + jni$_.JObject? colorSpace, + ) { + final _$config = config?.reference ?? jni$_.jNullReference; + final _$colorSpace = colorSpace?.reference ?? jni$_.jNullReference; + return _createBitmap$6( + _class.reference.pointer, + _id_createBitmap$6 as jni$_.JMethodIDPtr, + i, + i1, + _$config.pointer, + z ? 1 : 0, + _$colorSpace.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$7 = _class.staticMethodId( + r'createBitmap', + r'(Landroid/util/DisplayMetrics;IILandroid/graphics/Bitmap$Config;Z)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$7 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer, + jni$_.Int32 + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + int, + jni$_.Pointer, + int)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(android.util.DisplayMetrics displayMetrics, int i, int i1, android.graphics.Bitmap$Config config, boolean z)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$7( + jni$_.JObject? displayMetrics, + int i, + int i1, + Bitmap$Config? config, + bool z, + ) { + final _$displayMetrics = displayMetrics?.reference ?? jni$_.jNullReference; + final _$config = config?.reference ?? jni$_.jNullReference; + return _createBitmap$7( + _class.reference.pointer, + _id_createBitmap$7 as jni$_.JMethodIDPtr, + _$displayMetrics.pointer, + i, + i1, + _$config.pointer, + z ? 1 : 0) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$8 = _class.staticMethodId( + r'createBitmap', + r'(Landroid/util/DisplayMetrics;IILandroid/graphics/Bitmap$Config;ZLandroid/graphics/ColorSpace;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$8 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + int, + jni$_.Pointer, + int, + jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(android.util.DisplayMetrics displayMetrics, int i, int i1, android.graphics.Bitmap$Config config, boolean z, android.graphics.ColorSpace colorSpace)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$8( + jni$_.JObject? displayMetrics, + int i, + int i1, + Bitmap$Config? config, + bool z, + jni$_.JObject? colorSpace, + ) { + final _$displayMetrics = displayMetrics?.reference ?? jni$_.jNullReference; + final _$config = config?.reference ?? jni$_.jNullReference; + final _$colorSpace = colorSpace?.reference ?? jni$_.jNullReference; + return _createBitmap$8( + _class.reference.pointer, + _id_createBitmap$8 as jni$_.JMethodIDPtr, + _$displayMetrics.pointer, + i, + i1, + _$config.pointer, + z ? 1 : 0, + _$colorSpace.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$9 = _class.staticMethodId( + r'createBitmap', + r'([IIIIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$9 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + int, + int, + int, + jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(int[] is, int i, int i1, int i2, int i3, android.graphics.Bitmap$Config config)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$9( + jni$_.JIntArray? is$, + int i, + int i1, + int i2, + int i3, + Bitmap$Config? config, + ) { + final _$is$ = is$?.reference ?? jni$_.jNullReference; + final _$config = config?.reference ?? jni$_.jNullReference; + return _createBitmap$9( + _class.reference.pointer, + _id_createBitmap$9 as jni$_.JMethodIDPtr, + _$is$.pointer, + i, + i1, + i2, + i3, + _$config.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$10 = _class.staticMethodId( + r'createBitmap', + r'(Landroid/util/DisplayMetrics;[IIIIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$10 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + int, + int, + int, + int, + jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(android.util.DisplayMetrics displayMetrics, int[] is, int i, int i1, int i2, int i3, android.graphics.Bitmap$Config config)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$10( + jni$_.JObject? displayMetrics, + jni$_.JIntArray? is$, + int i, + int i1, + int i2, + int i3, + Bitmap$Config? config, + ) { + final _$displayMetrics = displayMetrics?.reference ?? jni$_.jNullReference; + final _$is$ = is$?.reference ?? jni$_.jNullReference; + final _$config = config?.reference ?? jni$_.jNullReference; + return _createBitmap$10( + _class.reference.pointer, + _id_createBitmap$10 as jni$_.JMethodIDPtr, + _$displayMetrics.pointer, + _$is$.pointer, + i, + i1, + i2, + i3, + _$config.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$11 = _class.staticMethodId( + r'createBitmap', + r'([IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$11 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + int, + jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(int[] is, int i, int i1, android.graphics.Bitmap$Config config)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$11( + jni$_.JIntArray? is$, + int i, + int i1, + Bitmap$Config? config, + ) { + final _$is$ = is$?.reference ?? jni$_.jNullReference; + final _$config = config?.reference ?? jni$_.jNullReference; + return _createBitmap$11( + _class.reference.pointer, + _id_createBitmap$11 as jni$_.JMethodIDPtr, + _$is$.pointer, + i, + i1, + _$config.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$12 = _class.staticMethodId( + r'createBitmap', + r'(Landroid/util/DisplayMetrics;[IIILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$12 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + int, + int, + jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(android.util.DisplayMetrics displayMetrics, int[] is, int i, int i1, android.graphics.Bitmap$Config config)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$12( + jni$_.JObject? displayMetrics, + jni$_.JIntArray? is$, + int i, + int i1, + Bitmap$Config? config, + ) { + final _$displayMetrics = displayMetrics?.reference ?? jni$_.jNullReference; + final _$is$ = is$?.reference ?? jni$_.jNullReference; + final _$config = config?.reference ?? jni$_.jNullReference; + return _createBitmap$12( + _class.reference.pointer, + _id_createBitmap$12 as jni$_.JMethodIDPtr, + _$displayMetrics.pointer, + _$is$.pointer, + i, + i1, + _$config.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$13 = _class.staticMethodId( + r'createBitmap', + r'(Landroid/graphics/Picture;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$13 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(android.graphics.Picture picture)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$13( + jni$_.JObject? picture, + ) { + final _$picture = picture?.reference ?? jni$_.jNullReference; + return _createBitmap$13(_class.reference.pointer, + _id_createBitmap$13 as jni$_.JMethodIDPtr, _$picture.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_createBitmap$14 = _class.staticMethodId( + r'createBitmap', + r'(Landroid/graphics/Picture;IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;', + ); + + static final _createBitmap$14 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + int, + jni$_.Pointer)>(); + + /// from: `static public android.graphics.Bitmap createBitmap(android.graphics.Picture picture, int i, int i1, android.graphics.Bitmap$Config config)` + /// The returned object must be released after use, by calling the [release] method. + static Bitmap? createBitmap$14( + jni$_.JObject? picture, + int i, + int i1, + Bitmap$Config? config, + ) { + final _$picture = picture?.reference ?? jni$_.jNullReference; + final _$config = config?.reference ?? jni$_.jNullReference; + return _createBitmap$14( + _class.reference.pointer, + _id_createBitmap$14 as jni$_.JMethodIDPtr, + _$picture.pointer, + i, + i1, + _$config.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_getNinePatchChunk = _class.instanceMethodId( + r'getNinePatchChunk', + r'()[B', + ); + + static final _getNinePatchChunk = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public byte[] getNinePatchChunk()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JByteArray? getNinePatchChunk() { + return _getNinePatchChunk( + reference.pointer, _id_getNinePatchChunk as jni$_.JMethodIDPtr) + .object(const jni$_.JByteArrayNullableType()); + } + + static final _id_compress = _class.instanceMethodId( + r'compress', + r'(Landroid/graphics/Bitmap$CompressFormat;ILjava/io/OutputStream;)Z', + ); + + static final _compress = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Pointer + )>)>>('globalEnv_CallBooleanMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + jni$_.Pointer)>(); + + /// from: `public boolean compress(android.graphics.Bitmap$CompressFormat compressFormat, int i, java.io.OutputStream outputStream)` + bool compress( + Bitmap$CompressFormat? compressFormat, + int i, + jni$_.JObject? outputStream, + ) { + final _$compressFormat = compressFormat?.reference ?? jni$_.jNullReference; + final _$outputStream = outputStream?.reference ?? jni$_.jNullReference; + return _compress(reference.pointer, _id_compress as jni$_.JMethodIDPtr, + _$compressFormat.pointer, i, _$outputStream.pointer) + .boolean; + } + + static final _id_isMutable = _class.instanceMethodId( + r'isMutable', + r'()Z', + ); + + static final _isMutable = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallBooleanMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public boolean isMutable()` + bool isMutable() { + return _isMutable(reference.pointer, _id_isMutable as jni$_.JMethodIDPtr) + .boolean; + } + + static final _id_isPremultiplied = _class.instanceMethodId( + r'isPremultiplied', + r'()Z', + ); + + static final _isPremultiplied = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallBooleanMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public boolean isPremultiplied()` + bool isPremultiplied() { + return _isPremultiplied( + reference.pointer, _id_isPremultiplied as jni$_.JMethodIDPtr) + .boolean; + } + + static final _id_setPremultiplied = _class.instanceMethodId( + r'setPremultiplied', + r'(Z)V', + ); + + static final _setPremultiplied = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + + /// from: `public void setPremultiplied(boolean z)` + void setPremultiplied( + bool z, + ) { + _setPremultiplied(reference.pointer, + _id_setPremultiplied as jni$_.JMethodIDPtr, z ? 1 : 0) + .check(); + } + + static final _id_getWidth = _class.instanceMethodId( + r'getWidth', + r'()I', + ); + + static final _getWidth = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public int getWidth()` + int getWidth() { + return _getWidth(reference.pointer, _id_getWidth as jni$_.JMethodIDPtr) + .integer; + } + + static final _id_getHeight = _class.instanceMethodId( + r'getHeight', + r'()I', + ); + + static final _getHeight = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public int getHeight()` + int getHeight() { + return _getHeight(reference.pointer, _id_getHeight as jni$_.JMethodIDPtr) + .integer; + } + + static final _id_getScaledWidth = _class.instanceMethodId( + r'getScaledWidth', + r'(Landroid/graphics/Canvas;)I', + ); + + static final _getScaledWidth = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public int getScaledWidth(android.graphics.Canvas canvas)` + int getScaledWidth( + jni$_.JObject? canvas, + ) { + final _$canvas = canvas?.reference ?? jni$_.jNullReference; + return _getScaledWidth(reference.pointer, + _id_getScaledWidth as jni$_.JMethodIDPtr, _$canvas.pointer) + .integer; + } + + static final _id_getScaledHeight = _class.instanceMethodId( + r'getScaledHeight', + r'(Landroid/graphics/Canvas;)I', + ); + + static final _getScaledHeight = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public int getScaledHeight(android.graphics.Canvas canvas)` + int getScaledHeight( + jni$_.JObject? canvas, + ) { + final _$canvas = canvas?.reference ?? jni$_.jNullReference; + return _getScaledHeight(reference.pointer, + _id_getScaledHeight as jni$_.JMethodIDPtr, _$canvas.pointer) + .integer; + } + + static final _id_getScaledWidth$1 = _class.instanceMethodId( + r'getScaledWidth', + r'(Landroid/util/DisplayMetrics;)I', + ); + + static final _getScaledWidth$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public int getScaledWidth(android.util.DisplayMetrics displayMetrics)` + int getScaledWidth$1( + jni$_.JObject? displayMetrics, + ) { + final _$displayMetrics = displayMetrics?.reference ?? jni$_.jNullReference; + return _getScaledWidth$1( + reference.pointer, + _id_getScaledWidth$1 as jni$_.JMethodIDPtr, + _$displayMetrics.pointer) + .integer; + } + + static final _id_getScaledHeight$1 = _class.instanceMethodId( + r'getScaledHeight', + r'(Landroid/util/DisplayMetrics;)I', + ); + + static final _getScaledHeight$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public int getScaledHeight(android.util.DisplayMetrics displayMetrics)` + int getScaledHeight$1( + jni$_.JObject? displayMetrics, + ) { + final _$displayMetrics = displayMetrics?.reference ?? jni$_.jNullReference; + return _getScaledHeight$1( + reference.pointer, + _id_getScaledHeight$1 as jni$_.JMethodIDPtr, + _$displayMetrics.pointer) + .integer; + } + + static final _id_getScaledWidth$2 = _class.instanceMethodId( + r'getScaledWidth', + r'(I)I', + ); + + static final _getScaledWidth$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + + /// from: `public int getScaledWidth(int i)` + int getScaledWidth$2( + int i, + ) { + return _getScaledWidth$2( + reference.pointer, _id_getScaledWidth$2 as jni$_.JMethodIDPtr, i) + .integer; + } + + static final _id_getScaledHeight$2 = _class.instanceMethodId( + r'getScaledHeight', + r'(I)I', + ); + + static final _getScaledHeight$2 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + + /// from: `public int getScaledHeight(int i)` + int getScaledHeight$2( + int i, + ) { + return _getScaledHeight$2( + reference.pointer, _id_getScaledHeight$2 as jni$_.JMethodIDPtr, i) + .integer; + } + + static final _id_getRowBytes = _class.instanceMethodId( + r'getRowBytes', + r'()I', + ); + + static final _getRowBytes = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public int getRowBytes()` + int getRowBytes() { + return _getRowBytes( + reference.pointer, _id_getRowBytes as jni$_.JMethodIDPtr) + .integer; + } + + static final _id_getByteCount = _class.instanceMethodId( + r'getByteCount', + r'()I', + ); + + static final _getByteCount = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public int getByteCount()` + int getByteCount() { + return _getByteCount( + reference.pointer, _id_getByteCount as jni$_.JMethodIDPtr) + .integer; + } + + static final _id_getAllocationByteCount = _class.instanceMethodId( + r'getAllocationByteCount', + r'()I', + ); + + static final _getAllocationByteCount = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public int getAllocationByteCount()` + int getAllocationByteCount() { + return _getAllocationByteCount( + reference.pointer, _id_getAllocationByteCount as jni$_.JMethodIDPtr) + .integer; + } + + static final _id_getConfig = _class.instanceMethodId( + r'getConfig', + r'()Landroid/graphics/Bitmap$Config;', + ); + + static final _getConfig = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public android.graphics.Bitmap$Config getConfig()` + /// The returned object must be released after use, by calling the [release] method. + Bitmap$Config? getConfig() { + return _getConfig(reference.pointer, _id_getConfig as jni$_.JMethodIDPtr) + .object(const $Bitmap$Config$NullableType()); + } + + static final _id_hasAlpha = _class.instanceMethodId( + r'hasAlpha', + r'()Z', + ); + + static final _hasAlpha = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallBooleanMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public boolean hasAlpha()` + bool hasAlpha() { + return _hasAlpha(reference.pointer, _id_hasAlpha as jni$_.JMethodIDPtr) + .boolean; + } + + static final _id_setHasAlpha = _class.instanceMethodId( + r'setHasAlpha', + r'(Z)V', + ); + + static final _setHasAlpha = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + + /// from: `public void setHasAlpha(boolean z)` + void setHasAlpha( + bool z, + ) { + _setHasAlpha( + reference.pointer, _id_setHasAlpha as jni$_.JMethodIDPtr, z ? 1 : 0) + .check(); + } + + static final _id_hasMipMap = _class.instanceMethodId( + r'hasMipMap', + r'()Z', + ); + + static final _hasMipMap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallBooleanMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public boolean hasMipMap()` + bool hasMipMap() { + return _hasMipMap(reference.pointer, _id_hasMipMap as jni$_.JMethodIDPtr) + .boolean; + } + + static final _id_setHasMipMap = _class.instanceMethodId( + r'setHasMipMap', + r'(Z)V', + ); + + static final _setHasMipMap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + + /// from: `public void setHasMipMap(boolean z)` + void setHasMipMap( + bool z, + ) { + _setHasMipMap(reference.pointer, _id_setHasMipMap as jni$_.JMethodIDPtr, + z ? 1 : 0) + .check(); + } + + static final _id_getColorSpace = _class.instanceMethodId( + r'getColorSpace', + r'()Landroid/graphics/ColorSpace;', + ); + + static final _getColorSpace = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public android.graphics.ColorSpace getColorSpace()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JObject? getColorSpace() { + return _getColorSpace( + reference.pointer, _id_getColorSpace as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); + } + + static final _id_setColorSpace = _class.instanceMethodId( + r'setColorSpace', + r'(Landroid/graphics/ColorSpace;)V', + ); + + static final _setColorSpace = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void setColorSpace(android.graphics.ColorSpace colorSpace)` + void setColorSpace( + jni$_.JObject? colorSpace, + ) { + final _$colorSpace = colorSpace?.reference ?? jni$_.jNullReference; + _setColorSpace(reference.pointer, _id_setColorSpace as jni$_.JMethodIDPtr, + _$colorSpace.pointer) + .check(); + } + + static final _id_hasGainmap = _class.instanceMethodId( + r'hasGainmap', + r'()Z', + ); + + static final _hasGainmap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallBooleanMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public boolean hasGainmap()` + bool hasGainmap() { + return _hasGainmap(reference.pointer, _id_hasGainmap as jni$_.JMethodIDPtr) + .boolean; + } + + static final _id_getGainmap = _class.instanceMethodId( + r'getGainmap', + r'()Landroid/graphics/Gainmap;', + ); + + static final _getGainmap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public android.graphics.Gainmap getGainmap()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JObject? getGainmap() { + return _getGainmap(reference.pointer, _id_getGainmap as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); + } + + static final _id_setGainmap = _class.instanceMethodId( + r'setGainmap', + r'(Landroid/graphics/Gainmap;)V', + ); + + static final _setGainmap = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public void setGainmap(android.graphics.Gainmap gainmap)` + void setGainmap( + jni$_.JObject? gainmap, + ) { + final _$gainmap = gainmap?.reference ?? jni$_.jNullReference; + _setGainmap(reference.pointer, _id_setGainmap as jni$_.JMethodIDPtr, + _$gainmap.pointer) + .check(); + } + + static final _id_eraseColor = _class.instanceMethodId( + r'eraseColor', + r'(I)V', + ); + + static final _eraseColor = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32,)>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + + /// from: `public void eraseColor(int i)` + void eraseColor( + int i, + ) { + _eraseColor(reference.pointer, _id_eraseColor as jni$_.JMethodIDPtr, i) + .check(); + } + + static final _id_eraseColor$1 = _class.instanceMethodId( + r'eraseColor', + r'(J)V', + ); + + static final _eraseColor$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int64,)>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + + /// from: `public void eraseColor(long j)` + void eraseColor$1( + int j, + ) { + _eraseColor$1(reference.pointer, _id_eraseColor$1 as jni$_.JMethodIDPtr, j) + .check(); + } + + static final _id_getPixel = _class.instanceMethodId( + r'getPixel', + r'(II)I', + ); + + static final _getPixel = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32, jni$_.Int32)>)>>( + 'globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int, int)>(); + + /// from: `public int getPixel(int i, int i1)` + int getPixel( + int i, + int i1, + ) { + return _getPixel( + reference.pointer, _id_getPixel as jni$_.JMethodIDPtr, i, i1) + .integer; + } + + static final _id_getColor = _class.instanceMethodId( + r'getColor', + r'(II)Landroid/graphics/Color;', + ); + + static final _getColor = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32, jni$_.Int32)>)>>( + 'globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int, int)>(); + + /// from: `public android.graphics.Color getColor(int i, int i1)` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JObject? getColor( + int i, + int i1, + ) { + return _getColor( + reference.pointer, _id_getColor as jni$_.JMethodIDPtr, i, i1) + .object(const jni$_.JObjectNullableType()); + } + + static final _id_getPixels = _class.instanceMethodId( + r'getPixels', + r'([IIIIIII)V', + ); + + static final _getPixels = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 + )>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + int, + int, + int, + int, + int)>(); + + /// from: `public void getPixels(int[] is, int i, int i1, int i2, int i3, int i4, int i5)` + void getPixels( + jni$_.JIntArray? is$, + int i, + int i1, + int i2, + int i3, + int i4, + int i5, + ) { + final _$is$ = is$?.reference ?? jni$_.jNullReference; + _getPixels(reference.pointer, _id_getPixels as jni$_.JMethodIDPtr, + _$is$.pointer, i, i1, i2, i3, i4, i5) + .check(); + } + + static final _id_setPixel = _class.instanceMethodId( + r'setPixel', + r'(III)V', + ); + + static final _setPixel = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Int32, jni$_.Int32, jni$_.Int32)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int, int, int)>(); + + /// from: `public void setPixel(int i, int i1, int i2)` + void setPixel( + int i, + int i1, + int i2, + ) { + _setPixel(reference.pointer, _id_setPixel as jni$_.JMethodIDPtr, i, i1, i2) + .check(); + } + + static final _id_setPixels = _class.instanceMethodId( + r'setPixels', + r'([IIIIIII)V', + ); + + static final _setPixels = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32, + jni$_.Int32 + )>)>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + int, + int, + int, + int, + int, + int)>(); + + /// from: `public void setPixels(int[] is, int i, int i1, int i2, int i3, int i4, int i5)` + void setPixels( + jni$_.JIntArray? is$, + int i, + int i1, + int i2, + int i3, + int i4, + int i5, + ) { + final _$is$ = is$?.reference ?? jni$_.jNullReference; + _setPixels(reference.pointer, _id_setPixels as jni$_.JMethodIDPtr, + _$is$.pointer, i, i1, i2, i3, i4, i5) + .check(); + } + + static final _id_describeContents = _class.instanceMethodId( + r'describeContents', + r'()I', + ); + + static final _describeContents = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallIntMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public int describeContents()` + int describeContents() { + return _describeContents( + reference.pointer, _id_describeContents as jni$_.JMethodIDPtr) + .integer; + } + + static final _id_writeToParcel = _class.instanceMethodId( + r'writeToParcel', + r'(Landroid/os/Parcel;I)V', + ); + + static final _writeToParcel = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Pointer, jni$_.Int32)>)>>( + 'globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer, int)>(); + + /// from: `public void writeToParcel(android.os.Parcel parcel, int i)` + void writeToParcel( + jni$_.JObject? parcel, + int i, + ) { + final _$parcel = parcel?.reference ?? jni$_.jNullReference; + _writeToParcel(reference.pointer, _id_writeToParcel as jni$_.JMethodIDPtr, + _$parcel.pointer, i) + .check(); + } + + static final _id_extractAlpha = _class.instanceMethodId( + r'extractAlpha', + r'()Landroid/graphics/Bitmap;', + ); + + static final _extractAlpha = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public android.graphics.Bitmap extractAlpha()` + /// The returned object must be released after use, by calling the [release] method. + Bitmap? extractAlpha() { + return _extractAlpha( + reference.pointer, _id_extractAlpha as jni$_.JMethodIDPtr) + .object(const $Bitmap$NullableType()); + } + + static final _id_extractAlpha$1 = _class.instanceMethodId( + r'extractAlpha', + r'(Landroid/graphics/Paint;[I)Landroid/graphics/Bitmap;', + ); + + static final _extractAlpha$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer + )>)>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); + + /// from: `public android.graphics.Bitmap extractAlpha(android.graphics.Paint paint, int[] is)` + /// The returned object must be released after use, by calling the [release] method. + Bitmap? extractAlpha$1( + jni$_.JObject? paint, + jni$_.JIntArray? is$, + ) { + final _$paint = paint?.reference ?? jni$_.jNullReference; + final _$is$ = is$?.reference ?? jni$_.jNullReference; + return _extractAlpha$1( + reference.pointer, + _id_extractAlpha$1 as jni$_.JMethodIDPtr, + _$paint.pointer, + _$is$.pointer) + .object(const $Bitmap$NullableType()); + } + + static final _id_sameAs = _class.instanceMethodId( + r'sameAs', + r'(Landroid/graphics/Bitmap;)Z', + ); + + static final _sameAs = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallBooleanMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); + + /// from: `public boolean sameAs(android.graphics.Bitmap bitmap)` + bool sameAs( + Bitmap? bitmap, + ) { + final _$bitmap = bitmap?.reference ?? jni$_.jNullReference; + return _sameAs(reference.pointer, _id_sameAs as jni$_.JMethodIDPtr, + _$bitmap.pointer) + .boolean; + } + + static final _id_prepareToDraw = _class.instanceMethodId( + r'prepareToDraw', + r'()V', + ); + + static final _prepareToDraw = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallVoidMethod') + .asFunction< + jni$_.JThrowablePtr Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public void prepareToDraw()` + void prepareToDraw() { + _prepareToDraw(reference.pointer, _id_prepareToDraw as jni$_.JMethodIDPtr) + .check(); + } + + static final _id_getHardwareBuffer = _class.instanceMethodId( + r'getHardwareBuffer', + r'()Landroid/hardware/HardwareBuffer;', + ); + + static final _getHardwareBuffer = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public android.hardware.HardwareBuffer getHardwareBuffer()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JObject? getHardwareBuffer() { + return _getHardwareBuffer( + reference.pointer, _id_getHardwareBuffer as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); + } +} + +final class $Bitmap$NullableType extends jni$_.JObjType { + @jni$_.internal + const $Bitmap$NullableType(); + + @jni$_.internal + @core$_.override + String get signature => r'Landroid/graphics/Bitmap;'; + + @jni$_.internal + @core$_.override + Bitmap? fromReference(jni$_.JReference reference) => reference.isNull + ? null + : Bitmap.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => this; + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($Bitmap$NullableType).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($Bitmap$NullableType) && + other is $Bitmap$NullableType; + } +} + +final class $Bitmap$Type extends jni$_.JObjType { + @jni$_.internal + const $Bitmap$Type(); + + @jni$_.internal + @core$_.override + String get signature => r'Landroid/graphics/Bitmap;'; + + @jni$_.internal + @core$_.override + Bitmap fromReference(jni$_.JReference reference) => Bitmap.fromReference( + reference, + ); + @jni$_.internal + @core$_.override + jni$_.JObjType get superType => const jni$_.JObjectNullableType(); + + @jni$_.internal + @core$_.override + jni$_.JObjType get nullableType => const $Bitmap$NullableType(); + + @jni$_.internal + @core$_.override + final superCount = 1; + + @core$_.override + int get hashCode => ($Bitmap$Type).hashCode; + + @core$_.override + bool operator ==(Object other) { + return other.runtimeType == ($Bitmap$Type) && other is $Bitmap$Type; + } +} diff --git a/flutter/lib/src/native/java/sentry_native_java.dart b/flutter/lib/src/native/java/sentry_native_java.dart index 7aa47f2d73..d4c5be2eed 100644 --- a/flutter/lib/src/native/java/sentry_native_java.dart +++ b/flutter/lib/src/native/java/sentry_native_java.dart @@ -29,9 +29,8 @@ class SentryNativeJava extends SentryNativeChannel { height: (call.arguments['height'] as num).toDouble(), frameRate: call.arguments['frameRate'] as int); - _replayRecorder = AndroidReplayRecorder( - config, options, channel, call.arguments['directory'] as String) - ..start(); + _replayRecorder = AndroidReplayRecorder.factory(config, options); + await _replayRecorder!.start(); hub.configureScope((s) { // ignore: invalid_use_of_internal_member diff --git a/flutter/lib/src/sentry_flutter_options.dart b/flutter/lib/src/sentry_flutter_options.dart index 454a87a379..823427a8f7 100644 --- a/flutter/lib/src/sentry_flutter_options.dart +++ b/flutter/lib/src/sentry_flutter_options.dart @@ -1,7 +1,5 @@ import 'dart:async'; -import 'package:file/file.dart'; -import 'package:file/local.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:meta/meta.dart' as meta; @@ -375,9 +373,6 @@ class SentryFlutterOptions extends SentryOptions { // ignore: invalid_use_of_internal_member set automatedTestMode(bool value) => super.automatedTestMode = value; - @meta.internal - FileSystem fileSystem = LocalFileSystem(); - /// Configuration of experimental features that may change or be removed /// without prior notice. Additionally, these features may not be ready for /// production use yet. diff --git a/flutter/microbenchmarks/lib/main.dart b/flutter/microbenchmarks/lib/main.dart index 968cfb92f8..27471fb732 100644 --- a/flutter/microbenchmarks/lib/main.dart +++ b/flutter/microbenchmarks/lib/main.dart @@ -1,16 +1,31 @@ import 'dart:io'; import 'src/image_bench.dart' as image_bench; import 'src/memory_bench.dart' as memory_bench; +import 'src/jni_bench.dart' as jni_bench; typedef BenchmarkSet = (String name, Future Function() callback); +const filter = String.fromEnvironment("FILTER"); + Future main() async { final benchmarks = [ ('Image', image_bench.execute), ('Memory', memory_bench.execute), + if (Platform.isAndroid) ('JNI', jni_bench.execute), ]; + RegExp? filterRegexp; + if (filter.isNotEmpty) { + print('Filtering benchmarks with "$filter"'); + filterRegexp = RegExp(filter, caseSensitive: false); + } + for (final benchmark in benchmarks) { + if (filterRegexp != null && !filterRegexp.hasMatch(benchmark.$1)) { + print('BenchmarkSet ${benchmark.$1}: skipped due to filter'); + continue; + } + final watch = Stopwatch()..start(); print('BenchmarkSet ${benchmark.$1}: starting'); await benchmark.$2.call(); diff --git a/flutter/microbenchmarks/lib/src/jni_bench.dart b/flutter/microbenchmarks/lib/src/jni_bench.dart new file mode 100644 index 0000000000..4a841bb6c0 --- /dev/null +++ b/flutter/microbenchmarks/lib/src/jni_bench.dart @@ -0,0 +1,95 @@ +import 'dart:ffi'; +import 'dart:math'; + +import 'package:jni/jni.dart'; +import 'package:benchmarking/benchmarking.dart'; +import 'package:flutter/foundation.dart'; + +Future execute() async { + final worksets = [ + _WorkSet(10 * 1000), + _WorkSet(1000 * 1000), + _WorkSet(10 * 1000 * 1000), + ]; + + // For baseline + syncBenchmark('JByteBuffer.release()', () { + JByteBuffer.allocateDirect(1).release(); + }).report(); + + for (var workset in worksets) { + syncBenchmark('JByteBuffer.fromList(${workset.size})', () { + final jBuffer = JByteBuffer.fromList(workset.data); + jBuffer.release(); + }).report(); + + syncBenchmark('JByteBuffer.allocatedDirect(${workset.size})', () { + final jBuffer = JByteBuffer.allocateDirect(workset.size); + jBuffer.release(); + }).report(); + + syncBenchmark('JByteBuffer.allocatedDirect(${workset.size}) + memcpy', () { + final jBuffer = JByteBuffer.allocateDirect(workset.size); + final jData = jBuffer._asUint8ListUnsafe(); + memcpy(jData.address, workset.data.address, workset.size); + jBuffer.release(); + }).report(); + } +} + +class _WorkSet { + static final rand = Random(); + final int size; + late final Uint8List data; + + _WorkSet(this.size) { + // Randomized size prevents loop optimizations of constant sized loops. Just in case... + + data = Uint8List.fromList( + List.generate(size, (_) => rand.nextInt(size) % 256)); + } +} + +// Copied over from package:jni due to visibility +extension on JByteBuffer { + Uint8List _asUint8ListUnsafe() { + _ensureIsDirect(); + final address = _directBufferAddress(); + final capacity = _directBufferCapacity(); + return address.cast().asTypedList(capacity); + } + + Pointer _directBufferAddress() { + final address = Jni.env.GetDirectBufferAddress(reference.pointer); + if (address == nullptr) { + throw StateError( + 'The memory region is undefined or ' + 'direct buffer access is not supported by this JVM.', + ); + } + return address; + } + + int _directBufferCapacity() { + final capacity = Jni.env.GetDirectBufferCapacity(reference.pointer); + if (capacity == -1) { + throw StateError( + 'The object is an unaligned view buffer and the processor ' + 'architecture does not support unaligned access.', + ); + } + return capacity; + } + + void _ensureIsDirect() { + if (!isDirect) { + throw StateError( + 'The buffer must be created with `JByteBuffer.allocateDirect`.', + ); + } + } +} + +/// void* memcpy( void* dest, const void* src, std::size_t count ); +@Native(symbol: 'memcpy', isLeaf: true) +external void memcpy(Pointer dest, Pointer src, int count); diff --git a/flutter/microbenchmarks/linux/flutter/generated_plugins.cmake b/flutter/microbenchmarks/linux/flutter/generated_plugins.cmake index 7204441060..7244781b99 100644 --- a/flutter/microbenchmarks/linux/flutter/generated_plugins.cmake +++ b/flutter/microbenchmarks/linux/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/flutter/microbenchmarks/pubspec.yaml b/flutter/microbenchmarks/pubspec.yaml index 23da62bdfb..80b2bcf0fa 100644 --- a/flutter/microbenchmarks/pubspec.yaml +++ b/flutter/microbenchmarks/pubspec.yaml @@ -17,6 +17,7 @@ dependencies: benchmarking: ^0.6.1 sentry_flutter: path: ../ + jni: ^0.14.0 dev_dependencies: flutter_lints: ^5.0.0 diff --git a/flutter/microbenchmarks/windows/flutter/generated_plugins.cmake b/flutter/microbenchmarks/windows/flutter/generated_plugins.cmake index e3e2f3e784..5af1999cb4 100644 --- a/flutter/microbenchmarks/windows/flutter/generated_plugins.cmake +++ b/flutter/microbenchmarks/windows/flutter/generated_plugins.cmake @@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST + jni ) set(PLUGIN_BUNDLED_LIBRARIES) diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index d74dd4da63..ca7f42fd9f 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -27,8 +27,8 @@ dependencies: package_info_plus: '>=1.0.0' meta: ^1.3.0 ffi: ^2.0.0 - file: '>=6.1.4' collection: ^1.16.0 + jni: 0.14.0 dev_dependencies: build_runner: ^2.4.2 @@ -45,6 +45,7 @@ dev_dependencies: git: url: https://github.com/getsentry/ffigen ref: 6aa2c2642f507eab3df83373189170797a9fa5e7 + jnigen: 0.14.0 flutter: plugin: diff --git a/flutter/test/replay/android_replay_recorder_web.dart b/flutter/test/replay/android_replay_recorder_web.dart new file mode 100644 index 0000000000..ab8bc199bb --- /dev/null +++ b/flutter/test/replay/android_replay_recorder_web.dart @@ -0,0 +1,21 @@ +// ignore_for_file: invalid_use_of_internal_member + +import 'dart:async'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; +import 'package:sentry_flutter/src/replay/scheduled_recorder.dart'; +import 'package:sentry_flutter/src/replay/scheduled_recorder_config.dart'; + +class AndroidReplayRecorder extends ScheduledScreenshotRecorder { + static AndroidReplayRecorder Function( + ScheduledScreenshotRecorderConfig, SentryFlutterOptions) factory = + AndroidReplayRecorder.new; + + AndroidReplayRecorder(super.config, super.options); + + @override + Future start() async { + super.start(); + } +} diff --git a/flutter/test/replay/replay_native_test.dart b/flutter/test/replay/replay_native_test.dart index 515d61a7ff..cb76cec0e6 100644 --- a/flutter/test/replay/replay_native_test.dart +++ b/flutter/test/replay/replay_native_test.dart @@ -5,12 +5,15 @@ library; import 'dart:async'; -import 'package:file/file.dart'; -import 'package:file/memory.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:sentry_flutter/src/native/factory.dart'; +import 'android_replay_recorder_web.dart' // see https://github.com/flutter/flutter/issues/160675 + if (dart.library.io) 'package:sentry_flutter/src/native/java/android_replay_recorder.dart'; +import 'package:sentry_flutter/src/replay/scheduled_recorder.dart'; +import 'package:sentry_flutter/src/screenshot/screenshot.dart'; import '../native_memory_web_mock.dart' if (dart.library.io) 'package:sentry_flutter/src/native/native_memory.dart'; import 'package:sentry_flutter/src/native/sentry_native_binding.dart'; @@ -32,13 +35,17 @@ void main() { late NativeChannelFixture native; late SentryFlutterOptions options; late MockHub hub; - late FileSystem fs; late Map replayConfig; + late _MockAndroidReplayRecorder mockAndroidRecorder; setUp(() { hub = MockHub(); - fs = MemoryFileSystem.test(); native = NativeChannelFixture(); + options = + defaultTestOptions(MockPlatformChecker(mockPlatform: mockPlatform)) + ..methodChannel = native.channel + ..experimental.replay.quality = SentryReplayQuality.low; + sut = createBinding(options); if (mockPlatform.isIOS) { replayConfig = { @@ -47,23 +54,15 @@ void main() { } else if (mockPlatform.isAndroid) { replayConfig = { 'replayId': '123', - 'directory': 'dir', 'width': 800, 'height': 600, 'frameRate': 1000, }; - fs.directory(replayConfig['directory']).createSync(recursive: true); - when(native.handler('addReplayScreenshot', any)) - .thenAnswer((_) => Future.value()); + AndroidReplayRecorder.factory = (config, options) { + mockAndroidRecorder = _MockAndroidReplayRecorder(config, options); + return mockAndroidRecorder; + }; } - - options = - defaultTestOptions(MockPlatformChecker(mockPlatform: mockPlatform)) - ..fileSystem = fs - ..methodChannel = native.channel - ..experimental.replay.quality = SentryReplayQuality.low; - - sut = createBinding(options); }); tearDown(() async { @@ -103,6 +102,11 @@ void main() { if (mockPlatform.isAndroid) { await native.invokeFromNative('ReplayRecorder.stop'); + AndroidReplayRecorder.factory = AndroidReplayRecorder.new; + + // Workaround for "A Timer is still pending even after the widget tree was disposed." + await tester.pumpWidget(Container()); + await tester.pumpAndSettle(); } }); }); @@ -131,79 +135,40 @@ void main() { await pumpTestElement(tester); if (mockPlatform.isAndroid) { - final replayDir = fs.directory(replayConfig['directory']); - - var callbackFinished = Completer(); - nextFrame({bool wait = true}) async { - final future = callbackFinished.future; + final future = mockAndroidRecorder.completer.future; await tester.pumpAndWaitUntil(future, requiredToComplete: wait); } - imageSizeBytes(File file) => file.readAsBytesSync().length; - - final capturedImages = {}; - when(native.handler('addReplayScreenshot', any)) - .thenAnswer((invocation) { - final path = - invocation.positionalArguments[1]["path"] as String; - capturedImages[path] = imageSizeBytes(fs.file(path)); - callbackFinished.complete(); - callbackFinished = Completer(); - return null; - }); - - fsImages() { - final files = replayDir.listSync().map((f) => f as File); - return {for (var f in files) f.path: imageSizeBytes(f)}; - } - - await nextFrame(wait: false); - expect(fsImages(), isEmpty); - verifyNever(native.handler('addReplayScreenshot', any)); - await native.invokeFromNative( 'ReplayRecorder.start', replayConfig); await nextFrame(); - expect(fsImages().values, isNotEmpty); - final size = fsImages().values.first; - expect(size, greaterThan(3000)); - expect(fsImages().values, [size]); - expect(capturedImages, equals(fsImages())); - - await nextFrame(); - fsImages().values.forEach((s) => expect(s, size)); - expect(capturedImages, equals(fsImages())); + expect(mockAndroidRecorder.captured, isNotEmpty); + final screenshot = mockAndroidRecorder.captured.first; + expect(screenshot.width, replayConfig['width']); + expect(screenshot.height, replayConfig['height']); await native.invokeFromNative('ReplayRecorder.pause'); - var count = capturedImages.length; + var count = mockAndroidRecorder.captured.length; await nextFrame(wait: false); await Future.delayed(const Duration(milliseconds: 100)); - fsImages().values.forEach((s) => expect(s, size)); - expect(capturedImages, equals(fsImages())); - expect(capturedImages.length, count); + expect(mockAndroidRecorder.captured.length, equals(count)); await nextFrame(wait: false); - fsImages().values.forEach((s) => expect(s, size)); - expect(capturedImages, equals(fsImages())); - expect(capturedImages.length, count); + expect(mockAndroidRecorder.captured.length, equals(count)); await native.invokeFromNative('ReplayRecorder.resume'); await nextFrame(); - fsImages().values.forEach((s) => expect(s, size)); - expect(capturedImages, equals(fsImages())); - expect(capturedImages.length, greaterThan(count)); + expect(mockAndroidRecorder.captured.length, greaterThan(count)); await native.invokeFromNative('ReplayRecorder.stop'); - count = capturedImages.length; + count = mockAndroidRecorder.captured.length; await Future.delayed(const Duration(milliseconds: 100)); await nextFrame(wait: false); - fsImages().values.forEach((s) => expect(s, size)); - expect(capturedImages, equals(fsImages())); - expect(capturedImages.length, count); + expect(mockAndroidRecorder.captured.length, equals(count)); } else if (mockPlatform.isIOS) { Future captureAndVerify() async { final future = native.invokeFromNative( @@ -233,3 +198,22 @@ void main() { }); } } + +class _MockAndroidReplayRecorder extends ScheduledScreenshotRecorder + implements AndroidReplayRecorder { + final captured = []; + var completer = Completer(); + + _MockAndroidReplayRecorder(super.config, super.options) { + super.callback = (screenshot, _) async { + captured.add(screenshot); + completer.complete(); + completer = Completer(); + }; + } + + @override + Future start() async { + super.start(); + } +}