diff --git a/pkgs/cronet_http/CHANGELOG.md b/pkgs/cronet_http/CHANGELOG.md index 0483c24af4..a76880aaaf 100644 --- a/pkgs/cronet_http/CHANGELOG.md +++ b/pkgs/cronet_http/CHANGELOG.md @@ -1,5 +1,6 @@ -## 1.4.1-wip +## 1.5.0-wip +* Add the ability to abort requests. * Upgrade Cronet dependencies version. ## 1.4.0 diff --git a/pkgs/cronet_http/android/src/main/kotlin/io/flutter/plugins/cronet_http/UrlRequestCallbackProxy.kt b/pkgs/cronet_http/android/src/main/kotlin/io/flutter/plugins/cronet_http/UrlRequestCallbackProxy.kt index e2c0412a4e..23c3100f7a 100644 --- a/pkgs/cronet_http/android/src/main/kotlin/io/flutter/plugins/cronet_http/UrlRequestCallbackProxy.kt +++ b/pkgs/cronet_http/android/src/main/kotlin/io/flutter/plugins/cronet_http/UrlRequestCallbackProxy.kt @@ -40,6 +40,7 @@ class UrlRequestCallbackProxy(val callback: UrlRequestCallbackInterface) : UrlRe ) fun onResponseStarted(request: UrlRequest?, info: UrlResponseInfo?) + fun onReadCompleted( request: UrlRequest?, info: UrlResponseInfo?, @@ -47,6 +48,9 @@ class UrlRequestCallbackProxy(val callback: UrlRequestCallbackInterface) : UrlRe ) fun onSucceeded(request: UrlRequest?, info: UrlResponseInfo?) + + fun onCanceled(request: UrlRequest?, info: UrlResponseInfo?) + fun onFailed( request: UrlRequest?, info: UrlResponseInfo?, @@ -78,6 +82,10 @@ class UrlRequestCallbackProxy(val callback: UrlRequestCallbackInterface) : UrlRe callback.onSucceeded(request, info); } + override fun onCanceled(request: UrlRequest?, info: UrlResponseInfo?) { + callback.onCanceled(request, info); + } + override fun onFailed( request: UrlRequest?, info: UrlResponseInfo?, diff --git a/pkgs/cronet_http/example/android/gradle.properties b/pkgs/cronet_http/example/android/gradle.properties index dda9ad986c..988bcc6f83 100644 --- a/pkgs/cronet_http/example/android/gradle.properties +++ b/pkgs/cronet_http/example/android/gradle.properties @@ -1,4 +1,4 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx12800M org.gradle.caching=true android.useAndroidX=true android.enableJetifier=true diff --git a/pkgs/cronet_http/example/integration_test/client_profile_test.dart b/pkgs/cronet_http/example/integration_test/client_profile_test.dart index 08da828099..8cb4f7d605 100644 --- a/pkgs/cronet_http/example/integration_test/client_profile_test.dart +++ b/pkgs/cronet_http/example/integration_test/client_profile_test.dart @@ -221,29 +221,30 @@ void main() { late List receivedData; setUpAll(() async { + final cancelCompleter = Completer(); successServer = (await HttpServer.bind('localhost', 0)) ..listen((request) async { await request.drain(); request.response.headers.set('Content-Type', 'text/plain'); - while (true) { + while (!cancelCompleter.isCompleted) { request.response.write('Hello World'); await request.response.flush(); - await Future.delayed(const Duration(seconds: 0)); + // Let the event loop run. + await Future(() {}); } + await request.response.close(); }); - final cancelCompleter = Completer(); successServerUri = Uri.http('localhost:${successServer.port}'); final client = CronetClientWithProfile.defaultCronetEngine(); final request = StreamedRequest('GET', successServerUri); unawaited(request.sink.close()); final response = await client.send(request); - var i = 0; late final StreamSubscription> s; receivedData = []; s = response.stream.listen((d) { receivedData += d; - if (++i == 1000) { + if (++i == 2) { s.cancel(); cancelCompleter.complete(); } @@ -263,6 +264,121 @@ void main() { }); }); + group('abort before response', () { + late HttpServer successServer; + late Uri successServerUri; + late HttpClientRequestProfile profile; + + setUpAll(() async { + final abortCompleter = Completer(); + successServer = (await HttpServer.bind('localhost', 0)) + ..listen((request) async { + await request.drain(); + request.response.headers.set('Content-Type', 'text/plain'); + await request.response.close(); + }); + successServerUri = Uri.http('localhost:${successServer.port}'); + final client = CronetClientWithProfile.defaultCronetEngine(); + final request = AbortableStreamedRequest('GET', successServerUri, + abortTrigger: abortCompleter.future); + final responseFuture = client.send(request); + abortCompleter.complete(); + unawaited(request.sink.close()); + try { + await responseFuture; + } on RequestAbortedException { + // Expected failure. + } + profile = client.profile!; + }); + tearDownAll(() { + successServer.close(); + }); + + test('request attributes', () async { + expect(profile.requestData.contentLength, isNull); + expect(profile.requestData.startTime, isNotNull); + expect(profile.requestData.endTime, isNotNull); + expect(profile.requestData.error, contains('aborted')); + expect(profile.responseData.bodyBytes, isEmpty); + }); + + test('response attributes', () { + expect(profile.responseData.bodyBytes, isEmpty); + expect(profile.responseData.compressionState, isNull); + expect(profile.responseData.contentLength, isNull); + expect(profile.responseData.endTime, isNull); + expect(profile.responseData.error, isNull); + expect(profile.responseData.headers, isNull); + expect(profile.responseData.isRedirect, isNull); + expect(profile.responseData.persistentConnection, isNull); + expect(profile.responseData.reasonPhrase, isNull); + expect(profile.responseData.redirects, isEmpty); + expect(profile.responseData.startTime, isNull); + expect(profile.responseData.statusCode, isNull); + }); + }); + + group('abort during response', () { + late HttpServer successServer; + late Uri successServerUri; + late HttpClientRequestProfile profile; + RequestAbortedException? streamException; + + setUpAll(() async { + final abortCompleter = Completer(); + successServer = (await HttpServer.bind('localhost', 0)) + ..listen((request) async { + await request.drain(); + request.response.headers.set('Content-Type', 'text/plain'); + while (!abortCompleter.isCompleted) { + request.response.write('Hello World'); + await request.response.flush(); + // Let the event loop run. + await Future(() {}); + } + await request.response.close(); + }); + successServerUri = Uri.http('localhost:${successServer.port}'); + final client = CronetClientWithProfile.defaultCronetEngine(); + final request = AbortableStreamedRequest('GET', successServerUri, + abortTrigger: abortCompleter.future); + unawaited(request.sink.close()); + final response = await client.send(request); + var i = 0; + + try { + await response.stream.listen((d) { + if (++i == 2) { + abortCompleter.complete(); + } + }).asFuture(); + } on RequestAbortedException catch (e) { + streamException = e; + } + + profile = client.profile!; + }); + tearDownAll(() { + successServer.close(); + }); + + test('stream exception', () async { + expect(streamException, isA()); + }); + + test('request attributes', () async { + expect(profile.requestData.contentLength, isNull); + expect(profile.requestData.startTime, isNotNull); + expect(profile.requestData.endTime, isNotNull); + }); + + test('response attributes', () { + expect(profile.responseData.error, contains('aborted')); + expect(profile.responseData.bodyBytes, isNotEmpty); + }); + }); + group('redirects', () { late HttpServer successServer; late Uri successServerUri; diff --git a/pkgs/cronet_http/example/integration_test/client_test.dart b/pkgs/cronet_http/example/integration_test/client_test.dart index 8f5bd983b9..aa7fd93cc3 100644 --- a/pkgs/cronet_http/example/integration_test/client_test.dart +++ b/pkgs/cronet_http/example/integration_test/client_test.dart @@ -22,6 +22,7 @@ Future testConformance() async { canStreamRequestBody: false, canReceiveSetCookieHeaders: true, canSendCookieHeaders: true, + supportsAbort: true, ); } finally { HttpClientRequestProfile.profilingEnabled = profile; @@ -36,6 +37,7 @@ Future testConformance() async { canStreamRequestBody: false, canReceiveSetCookieHeaders: true, canSendCookieHeaders: true, + supportsAbort: true, ); } finally { HttpClientRequestProfile.profilingEnabled = profile; @@ -51,6 +53,9 @@ Future testConformance() async { return CronetClient.fromCronetEngine(engine); }, canStreamRequestBody: false, + canReceiveSetCookieHeaders: true, + canSendCookieHeaders: true, + supportsAbort: true, ); }); } diff --git a/pkgs/cronet_http/lib/src/cronet_client.dart b/pkgs/cronet_http/lib/src/cronet_client.dart index ef20b6b779..d7c49ff63d 100644 --- a/pkgs/cronet_http/lib/src/cronet_client.dart +++ b/pkgs/cronet_http/lib/src/cronet_client.dart @@ -195,7 +195,7 @@ jb.UrlRequestCallbackProxy$UrlRequestCallbackInterface _urlRequestCallbacks( StreamController>? responseStream; JByteBuffer? jByteBuffer; var numRedirects = 0; - var done = false; + var responseStreamCancelled = false; // The order of callbacks generated by Cronet is documented here: // https://developer.android.com/guide/topics/connectivity/cronet/lifecycle @@ -208,8 +208,8 @@ jb.UrlRequestCallbackProxy$UrlRequestCallbackInterface _urlRequestCallbacks( responseStream = StreamController(onCancel: () { // The user did `response.stream.cancel()`. We can just pretend that // the response completed normally. - if (done) return; - done = true; + if (responseStreamCancelled) return; + responseStreamCancelled = true; urlRequest!.cancel(); responseStream!.sink.close(); jByteBuffer?.release(); @@ -260,7 +260,7 @@ jb.UrlRequestCallbackProxy$UrlRequestCallbackInterface _urlRequestCallbacks( urlRequest?.read(jByteBuffer!); }, onRedirectReceived: (urlRequest, responseInfo, newLocationUrl) { - if (done) return; + if (responseStreamCancelled) return; final responseHeaders = _cronetToClientHeaders(responseInfo!.getAllHeaders()!); @@ -308,7 +308,7 @@ jb.UrlRequestCallbackProxy$UrlRequestCallbackInterface _urlRequestCallbacks( } }, onReadCompleted: (urlRequest, responseInfo, byteBuffer) { - if (done) return; + if (responseStreamCancelled) return; byteBuffer!.flip(); final data = jByteBuffer!.asUint8List().sublist(0, byteBuffer.remaining); responseStream!.add(data); @@ -318,15 +318,15 @@ jb.UrlRequestCallbackProxy$UrlRequestCallbackInterface _urlRequestCallbacks( urlRequest!.read(byteBuffer); }, onSucceeded: (urlRequest, responseInfo) { - if (done) return; - done = true; + if (responseStreamCancelled) return; + responseStreamCancelled = true; responseStream!.sink.close(); jByteBuffer?.release(); profile?.responseData.close(); }, onFailed: (urlRequest, responseInfo /* can be null */, cronetException) { - if (done) return; - done = true; + if (responseStreamCancelled) return; + responseStreamCancelled = true; final error = ClientException( 'Cronet exception: ${cronetException.toString()}', request.url); if (responseStream == null) { @@ -345,6 +345,29 @@ jb.UrlRequestCallbackProxy$UrlRequestCallbackInterface _urlRequestCallbacks( } jByteBuffer?.release(); }, + // Will always be the last callback invoked. + // See https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest#cancel() + onCanceled: (urlRequest, urlResponseInfo /* can be null */) { + if (responseStreamCancelled) return; + responseStreamCancelled = true; + final error = RequestAbortedException(request.url); + if (responseStream == null) { + responseCompleter.completeError(error); + } else { + if (!responseStream!.isClosed) { + responseStream!.sink.addError(error); + responseStream!.close(); + } + } + if (profile != null) { + if (profile.requestData.endTime == null) { + profile.requestData.closeWithError(error.toString()); + } else { + profile.responseData.closeWithError(error.toString()); + } + } + jByteBuffer?.release(); + }, )); } @@ -477,7 +500,12 @@ class CronetClient extends BaseClient { builder.setUploadDataProvider( jb.UploadDataProviders.create$2(data), _executor); } - builder.build()!.start(); + + final cronetRequest = builder.build()!; + if (request case Abortable(:final abortTrigger?)) { + unawaited(abortTrigger.whenComplete(cronetRequest.cancel)); + } + cronetRequest.start(); return responseCompleter.future; } } diff --git a/pkgs/cronet_http/lib/src/jni/jni_bindings.dart b/pkgs/cronet_http/lib/src/jni/jni_bindings.dart index a509a03c5e..691e62743f 100644 --- a/pkgs/cronet_http/lib/src/jni/jni_bindings.dart +++ b/pkgs/cronet_http/lib/src/jni/jni_bindings.dart @@ -217,6 +217,41 @@ class UrlRequestCallbackProxy$UrlRequestCallbackInterface .check(); } + static final _id_onCanceled = _class.instanceMethodId( + r'onCanceled', + r'(Lorg/chromium/net/UrlRequest;Lorg/chromium/net/UrlResponseInfo;)V', + ); + + static final _onCanceled = 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 abstract void onCanceled(org.chromium.net.UrlRequest urlRequest, org.chromium.net.UrlResponseInfo urlResponseInfo)` + void onCanceled( + UrlRequest? urlRequest, + UrlResponseInfo? urlResponseInfo, + ) { + final _$urlRequest = urlRequest?.reference ?? jni$_.jNullReference; + final _$urlResponseInfo = + urlResponseInfo?.reference ?? jni$_.jNullReference; + _onCanceled(reference.pointer, _id_onCanceled as jni$_.JMethodIDPtr, + _$urlRequest.pointer, _$urlResponseInfo.pointer) + .check(); + } + static final _id_onFailed = _class.instanceMethodId( r'onFailed', r'(Lorg/chromium/net/UrlRequest;Lorg/chromium/net/UrlResponseInfo;Lorg/chromium/net/CronetException;)V', @@ -327,6 +362,14 @@ class UrlRequestCallbackProxy$UrlRequestCallbackInterface ); return jni$_.nullptr; } + if ($d == + r'onCanceled(Lorg/chromium/net/UrlRequest;Lorg/chromium/net/UrlResponseInfo;)V') { + _$impls[$p]!.onCanceled( + $a![0]?.as(const $UrlRequest$Type(), releaseOriginal: true), + $a![1]?.as(const $UrlResponseInfo$Type(), releaseOriginal: true), + ); + return jni$_.nullptr; + } if ($d == r'onFailed(Lorg/chromium/net/UrlRequest;Lorg/chromium/net/UrlResponseInfo;Lorg/chromium/net/CronetException;)V') { _$impls[$p]!.onFailed( @@ -370,6 +413,8 @@ class UrlRequestCallbackProxy$UrlRequestCallbackInterface r'onReadCompleted(Lorg/chromium/net/UrlRequest;Lorg/chromium/net/UrlResponseInfo;Ljava/nio/ByteBuffer;)V', if ($impl.onSucceeded$async) r'onSucceeded(Lorg/chromium/net/UrlRequest;Lorg/chromium/net/UrlResponseInfo;)V', + if ($impl.onCanceled$async) + r'onCanceled(Lorg/chromium/net/UrlRequest;Lorg/chromium/net/UrlResponseInfo;)V', if ($impl.onFailed$async) r'onFailed(Lorg/chromium/net/UrlRequest;Lorg/chromium/net/UrlResponseInfo;Lorg/chromium/net/CronetException;)V', ], @@ -407,6 +452,10 @@ abstract base mixin class $UrlRequestCallbackProxy$UrlRequestCallbackInterface { UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo) onSucceeded, bool onSucceeded$async, + required void Function( + UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo) + onCanceled, + bool onCanceled$async, required void Function(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo, CronetException? cronetException) onFailed, @@ -424,6 +473,8 @@ abstract base mixin class $UrlRequestCallbackProxy$UrlRequestCallbackInterface { bool get onReadCompleted$async => false; void onSucceeded(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo); bool get onSucceeded$async => false; + void onCanceled(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo); + bool get onCanceled$async => false; void onFailed(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo, CronetException? cronetException); bool get onFailed$async => false; @@ -448,6 +499,10 @@ final class _$UrlRequestCallbackProxy$UrlRequestCallbackInterface UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo) onSucceeded, this.onSucceeded$async = false, + required void Function( + UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo) + onCanceled, + this.onCanceled$async = false, required void Function(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo, CronetException? cronetException) onFailed, @@ -456,6 +511,7 @@ final class _$UrlRequestCallbackProxy$UrlRequestCallbackInterface _onResponseStarted = onResponseStarted, _onReadCompleted = onReadCompleted, _onSucceeded = onSucceeded, + _onCanceled = onCanceled, _onFailed = onFailed; final void Function(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo, @@ -470,6 +526,9 @@ final class _$UrlRequestCallbackProxy$UrlRequestCallbackInterface final void Function(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo) _onSucceeded; final bool onSucceeded$async; + final void Function(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo) + _onCanceled; + final bool onCanceled$async; final void Function(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo, CronetException? cronetException) _onFailed; final bool onFailed$async; @@ -493,6 +552,10 @@ final class _$UrlRequestCallbackProxy$UrlRequestCallbackInterface return _onSucceeded(urlRequest, urlResponseInfo); } + void onCanceled(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo) { + return _onCanceled(urlRequest, urlResponseInfo); + } + void onFailed(UrlRequest? urlRequest, UrlResponseInfo? urlResponseInfo, CronetException? cronetException) { return _onFailed(urlRequest, urlResponseInfo, cronetException); @@ -822,6 +885,41 @@ class UrlRequestCallbackProxy extends UrlRequest$Callback { .check(); } + static final _id_onCanceled = _class.instanceMethodId( + r'onCanceled', + r'(Lorg/chromium/net/UrlRequest;Lorg/chromium/net/UrlResponseInfo;)V', + ); + + static final _onCanceled = 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 onCanceled(org.chromium.net.UrlRequest urlRequest, org.chromium.net.UrlResponseInfo urlResponseInfo)` + void onCanceled( + UrlRequest? urlRequest, + UrlResponseInfo? urlResponseInfo, + ) { + final _$urlRequest = urlRequest?.reference ?? jni$_.jNullReference; + final _$urlResponseInfo = + urlResponseInfo?.reference ?? jni$_.jNullReference; + _onCanceled(reference.pointer, _id_onCanceled as jni$_.JMethodIDPtr, + _$urlRequest.pointer, _$urlResponseInfo.pointer) + .check(); + } + static final _id_onFailed = _class.instanceMethodId( r'onFailed', r'(Lorg/chromium/net/UrlRequest;Lorg/chromium/net/UrlResponseInfo;Lorg/chromium/net/CronetException;)V', @@ -964,53 +1062,33 @@ class URL extends jni$_.JObject { static const nullableType = $URL$NullableType(); static const type = $URL$Type(); static final _id_new$ = _class.constructorId( - r'(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V', + r'(Ljava/lang/String;)V', ); static final _new$ = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - jni$_.VarArgs< - ( - jni$_.Pointer, - jni$_.Pointer, - jni$_.Int32, - jni$_.Pointer - )>)>>('globalEnv_NewObject') + 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, - jni$_.Pointer, - int, - jni$_.Pointer)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public void (java.lang.String string, java.lang.String string1, int i, java.lang.String string2)` + /// from: `public void (java.lang.String string)` /// The returned object must be released after use, by calling the [release] method. factory URL( jni$_.JString? string, - jni$_.JString? string1, - int i, - jni$_.JString? string2, ) { final _$string = string?.reference ?? jni$_.jNullReference; - final _$string1 = string1?.reference ?? jni$_.jNullReference; - final _$string2 = string2?.reference ?? jni$_.jNullReference; - return URL.fromReference(_new$( - _class.reference.pointer, - _id_new$ as jni$_.JMethodIDPtr, - _$string.pointer, - _$string1.pointer, - i, - _$string2.pointer) + return URL.fromReference(_new$(_class.reference.pointer, + _id_new$ as jni$_.JMethodIDPtr, _$string.pointer) .reference); } static final _id_new$1 = _class.constructorId( - r'(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V', + r'(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;)V', ); static final _new$1 = jni$_.ProtectedJniExtensions.lookup< @@ -1022,6 +1100,7 @@ class URL extends jni$_.JObject { ( jni$_.Pointer, jni$_.Pointer, + jni$_.Int32, jni$_.Pointer )>)>>('globalEnv_NewObject') .asFunction< @@ -1030,13 +1109,15 @@ class URL extends jni$_.JObject { jni$_.JMethodIDPtr, jni$_.Pointer, jni$_.Pointer, + int, jni$_.Pointer)>(); - /// from: `public void (java.lang.String string, java.lang.String string1, java.lang.String string2)` + /// from: `public void (java.lang.String string, java.lang.String string1, int i, java.lang.String string2)` /// The returned object must be released after use, by calling the [release] method. factory URL.new$1( jni$_.JString? string, jni$_.JString? string1, + int i, jni$_.JString? string2, ) { final _$string = string?.reference ?? jni$_.jNullReference; @@ -1047,6 +1128,7 @@ class URL extends jni$_.JObject { _id_new$1 as jni$_.JMethodIDPtr, _$string.pointer, _$string1.pointer, + i, _$string2.pointer) .reference); } @@ -1104,28 +1186,44 @@ class URL extends jni$_.JObject { } static final _id_new$3 = _class.constructorId( - r'(Ljava/lang/String;)V', + r'(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V', ); static final _new$3 = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - jni$_.VarArgs<(jni$_.Pointer,)>)>>( - 'globalEnv_NewObject') + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs< + ( + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer + )>)>>('globalEnv_NewObject') .asFunction< - jni$_.JniResult Function(jni$_.Pointer, - jni$_.JMethodIDPtr, jni$_.Pointer)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer, + jni$_.Pointer)>(); - /// from: `public void (java.lang.String string)` + /// from: `public void (java.lang.String string, java.lang.String string1, java.lang.String string2)` /// The returned object must be released after use, by calling the [release] method. factory URL.new$3( jni$_.JString? string, + jni$_.JString? string1, + jni$_.JString? string2, ) { final _$string = string?.reference ?? jni$_.jNullReference; - return URL.fromReference(_new$3(_class.reference.pointer, - _id_new$3 as jni$_.JMethodIDPtr, _$string.pointer) + final _$string1 = string1?.reference ?? jni$_.jNullReference; + final _$string2 = string2?.reference ?? jni$_.jNullReference; + return URL.fromReference(_new$3( + _class.reference.pointer, + _id_new$3 as jni$_.JMethodIDPtr, + _$string.pointer, + _$string1.pointer, + _$string2.pointer) .reference); } @@ -1206,36 +1304,38 @@ class URL extends jni$_.JObject { .reference); } - static final _id_getQuery = _class.instanceMethodId( - r'getQuery', - r'()Ljava/lang/String;', + static final _id_equals = _class.instanceMethodId( + r'equals', + r'(Ljava/lang/Object;)Z', ); - static final _getQuery = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') + static final _equals = 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$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public java.lang.String getQuery()` - /// The returned object must be released after use, by calling the [release] method. - jni$_.JString? getQuery() { - return _getQuery(reference.pointer, _id_getQuery as jni$_.JMethodIDPtr) - .object(const jni$_.JStringNullableType()); + /// from: `public boolean equals(java.lang.Object object)` + bool equals( + jni$_.JObject? object, + ) { + final _$object = object?.reference ?? jni$_.jNullReference; + return _equals(reference.pointer, _id_equals as jni$_.JMethodIDPtr, + _$object.pointer) + .boolean; } - static final _id_getPath = _class.instanceMethodId( - r'getPath', + static final _id_getAuthority = _class.instanceMethodId( + r'getAuthority', r'()Ljava/lang/String;', ); - static final _getPath = jni$_.ProtectedJniExtensions.lookup< + static final _getAuthority = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, @@ -1247,19 +1347,20 @@ class URL extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public java.lang.String getPath()` + /// from: `public java.lang.String getAuthority()` /// The returned object must be released after use, by calling the [release] method. - jni$_.JString? getPath() { - return _getPath(reference.pointer, _id_getPath as jni$_.JMethodIDPtr) + jni$_.JString? getAuthority() { + return _getAuthority( + reference.pointer, _id_getAuthority as jni$_.JMethodIDPtr) .object(const jni$_.JStringNullableType()); } - static final _id_getUserInfo = _class.instanceMethodId( - r'getUserInfo', - r'()Ljava/lang/String;', + static final _id_getContent = _class.instanceMethodId( + r'getContent', + r'()Ljava/lang/Object;', ); - static final _getUserInfo = jni$_.ProtectedJniExtensions.lookup< + static final _getContent = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, @@ -1271,60 +1372,38 @@ class URL extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public java.lang.String getUserInfo()` + /// from: `public java.lang.Object getContent()` /// The returned object must be released after use, by calling the [release] method. - jni$_.JString? getUserInfo() { - return _getUserInfo( - reference.pointer, _id_getUserInfo as jni$_.JMethodIDPtr) - .object(const jni$_.JStringNullableType()); + jni$_.JObject? getContent() { + return _getContent(reference.pointer, _id_getContent as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); } - static final _id_getAuthority = _class.instanceMethodId( - r'getAuthority', - r'()Ljava/lang/String;', + static final _id_getContent$1 = _class.instanceMethodId( + r'getContent', + r'([Ljava/lang/Class;)Ljava/lang/Object;', ); - static final _getAuthority = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') + static final _getContent$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( + 'globalEnv_CallObjectMethod') .asFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - )>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public java.lang.String getAuthority()` + /// from: `public java.lang.Object getContent(java.lang.Class[] classs)` /// The returned object must be released after use, by calling the [release] method. - jni$_.JString? getAuthority() { - return _getAuthority( - reference.pointer, _id_getAuthority as jni$_.JMethodIDPtr) - .object(const jni$_.JStringNullableType()); - } - - static final _id_getPort = _class.instanceMethodId( - r'getPort', - r'()I', - ); - - static final _getPort = 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 getPort()` - int getPort() { - return _getPort(reference.pointer, _id_getPort as jni$_.JMethodIDPtr) - .integer; + jni$_.JObject? getContent$1( + jni$_.JArray? classs, + ) { + final _$classs = classs?.reference ?? jni$_.jNullReference; + return _getContent$1(reference.pointer, + _id_getContent$1 as jni$_.JMethodIDPtr, _$classs.pointer) + .object(const jni$_.JObjectNullableType()); } static final _id_getDefaultPort = _class.instanceMethodId( @@ -1351,12 +1430,12 @@ class URL extends jni$_.JObject { .integer; } - static final _id_getProtocol = _class.instanceMethodId( - r'getProtocol', + static final _id_getFile = _class.instanceMethodId( + r'getFile', r'()Ljava/lang/String;', ); - static final _getProtocol = jni$_.ProtectedJniExtensions.lookup< + static final _getFile = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, @@ -1368,11 +1447,10 @@ class URL extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public java.lang.String getProtocol()` + /// from: `public java.lang.String getFile()` /// The returned object must be released after use, by calling the [release] method. - jni$_.JString? getProtocol() { - return _getProtocol( - reference.pointer, _id_getProtocol as jni$_.JMethodIDPtr) + jni$_.JString? getFile() { + return _getFile(reference.pointer, _id_getFile as jni$_.JMethodIDPtr) .object(const jni$_.JStringNullableType()); } @@ -1400,12 +1478,12 @@ class URL extends jni$_.JObject { .object(const jni$_.JStringNullableType()); } - static final _id_getFile = _class.instanceMethodId( - r'getFile', + static final _id_getPath = _class.instanceMethodId( + r'getPath', r'()Ljava/lang/String;', ); - static final _getFile = jni$_.ProtectedJniExtensions.lookup< + static final _getPath = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, @@ -1417,118 +1495,91 @@ class URL extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public java.lang.String getFile()` + /// from: `public java.lang.String getPath()` /// The returned object must be released after use, by calling the [release] method. - jni$_.JString? getFile() { - return _getFile(reference.pointer, _id_getFile as jni$_.JMethodIDPtr) + jni$_.JString? getPath() { + return _getPath(reference.pointer, _id_getPath as jni$_.JMethodIDPtr) .object(const jni$_.JStringNullableType()); } - static final _id_getRef = _class.instanceMethodId( - r'getRef', - r'()Ljava/lang/String;', + static final _id_getPort = _class.instanceMethodId( + r'getPort', + r'()I', ); - static final _getRef = jni$_.ProtectedJniExtensions.lookup< + static final _getPort = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') + )>>('globalEnv_CallIntMethod') .asFunction< jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, )>(); - /// from: `public java.lang.String getRef()` - /// The returned object must be released after use, by calling the [release] method. - jni$_.JString? getRef() { - return _getRef(reference.pointer, _id_getRef as jni$_.JMethodIDPtr) - .object(const jni$_.JStringNullableType()); - } - - static final _id_equals = _class.instanceMethodId( - r'equals', - r'(Ljava/lang/Object;)Z', - ); - - static final _equals = 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 equals(java.lang.Object object)` - bool equals( - jni$_.JObject? object, - ) { - final _$object = object?.reference ?? jni$_.jNullReference; - return _equals(reference.pointer, _id_equals as jni$_.JMethodIDPtr, - _$object.pointer) - .boolean; + /// from: `public int getPort()` + int getPort() { + return _getPort(reference.pointer, _id_getPort as jni$_.JMethodIDPtr) + .integer; } - static final _id_hashCode$1 = _class.instanceMethodId( - r'hashCode', - r'()I', + static final _id_getProtocol = _class.instanceMethodId( + r'getProtocol', + r'()Ljava/lang/String;', ); - static final _hashCode$1 = jni$_.ProtectedJniExtensions.lookup< + static final _getProtocol = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, - )>>('globalEnv_CallIntMethod') + )>>('globalEnv_CallObjectMethod') .asFunction< jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, )>(); - /// from: `public int hashCode()` - int hashCode$1() { - return _hashCode$1(reference.pointer, _id_hashCode$1 as jni$_.JMethodIDPtr) - .integer; + /// from: `public java.lang.String getProtocol()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JString? getProtocol() { + return _getProtocol( + reference.pointer, _id_getProtocol as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } - static final _id_sameFile = _class.instanceMethodId( - r'sameFile', - r'(Ljava/net/URL;)Z', + static final _id_getQuery = _class.instanceMethodId( + r'getQuery', + r'()Ljava/lang/String;', ); - static final _sameFile = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - jni$_.VarArgs<(jni$_.Pointer,)>)>>( - 'globalEnv_CallBooleanMethod') + static final _getQuery = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') .asFunction< - jni$_.JniResult Function(jni$_.Pointer, - jni$_.JMethodIDPtr, jni$_.Pointer)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); - /// from: `public boolean sameFile(java.net.URL uRL)` - bool sameFile( - URL? uRL, - ) { - final _$uRL = uRL?.reference ?? jni$_.jNullReference; - return _sameFile(reference.pointer, _id_sameFile as jni$_.JMethodIDPtr, - _$uRL.pointer) - .boolean; + /// from: `public java.lang.String getQuery()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JString? getQuery() { + return _getQuery(reference.pointer, _id_getQuery as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); } - static final _id_toString$1 = _class.instanceMethodId( - r'toString', + static final _id_getRef = _class.instanceMethodId( + r'getRef', r'()Ljava/lang/String;', ); - static final _toString$1 = jni$_.ProtectedJniExtensions.lookup< + static final _getRef = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, @@ -1540,19 +1591,19 @@ class URL extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public java.lang.String toString()` + /// from: `public java.lang.String getRef()` /// The returned object must be released after use, by calling the [release] method. - jni$_.JString? toString$1() { - return _toString$1(reference.pointer, _id_toString$1 as jni$_.JMethodIDPtr) + jni$_.JString? getRef() { + return _getRef(reference.pointer, _id_getRef as jni$_.JMethodIDPtr) .object(const jni$_.JStringNullableType()); } - static final _id_toExternalForm = _class.instanceMethodId( - r'toExternalForm', + static final _id_getUserInfo = _class.instanceMethodId( + r'getUserInfo', r'()Ljava/lang/String;', ); - static final _toExternalForm = jni$_.ProtectedJniExtensions.lookup< + static final _getUserInfo = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, @@ -1564,36 +1615,35 @@ class URL extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `public java.lang.String toExternalForm()` + /// from: `public java.lang.String getUserInfo()` /// The returned object must be released after use, by calling the [release] method. - jni$_.JString? toExternalForm() { - return _toExternalForm( - reference.pointer, _id_toExternalForm as jni$_.JMethodIDPtr) + jni$_.JString? getUserInfo() { + return _getUserInfo( + reference.pointer, _id_getUserInfo as jni$_.JMethodIDPtr) .object(const jni$_.JStringNullableType()); } - static final _id_toURI = _class.instanceMethodId( - r'toURI', - r'()Ljava/net/URI;', + static final _id_hashCode$1 = _class.instanceMethodId( + r'hashCode', + r'()I', ); - static final _toURI = jni$_.ProtectedJniExtensions.lookup< + static final _hashCode$1 = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') + )>>('globalEnv_CallIntMethod') .asFunction< jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, )>(); - /// from: `public java.net.URI toURI()` - /// The returned object must be released after use, by calling the [release] method. - jni$_.JObject? toURI() { - return _toURI(reference.pointer, _id_toURI as jni$_.JMethodIDPtr) - .object(const jni$_.JObjectNullableType()); + /// from: `public int hashCode()` + int hashCode$1() { + return _hashCode$1(reference.pointer, _id_hashCode$1 as jni$_.JMethodIDPtr) + .integer; } static final _id_openConnection = _class.instanceMethodId( @@ -1672,55 +1722,30 @@ class URL extends jni$_.JObject { .object(const jni$_.JObjectNullableType()); } - static final _id_getContent = _class.instanceMethodId( - r'getContent', - r'()Ljava/lang/Object;', - ); - - static final _getContent = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - )>>('globalEnv_CallObjectMethod') - .asFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - )>(); - - /// from: `public java.lang.Object getContent()` - /// The returned object must be released after use, by calling the [release] method. - jni$_.JObject? getContent() { - return _getContent(reference.pointer, _id_getContent as jni$_.JMethodIDPtr) - .object(const jni$_.JObjectNullableType()); - } - - static final _id_getContent$1 = _class.instanceMethodId( - r'getContent', - r'([Ljava/lang/Class;)Ljava/lang/Object;', + static final _id_sameFile = _class.instanceMethodId( + r'sameFile', + r'(Ljava/net/URL;)Z', ); - static final _getContent$1 = jni$_.ProtectedJniExtensions.lookup< + static final _sameFile = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Pointer,)>)>>( - 'globalEnv_CallObjectMethod') + 'globalEnv_CallBooleanMethod') .asFunction< jni$_.JniResult Function(jni$_.Pointer, jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `public java.lang.Object getContent(java.lang.Class[] classs)` - /// The returned object must be released after use, by calling the [release] method. - jni$_.JObject? getContent$1( - jni$_.JArray? classs, + /// from: `public boolean sameFile(java.net.URL uRL)` + bool sameFile( + URL? uRL, ) { - final _$classs = classs?.reference ?? jni$_.jNullReference; - return _getContent$1(reference.pointer, - _id_getContent$1 as jni$_.JMethodIDPtr, _$classs.pointer) - .object(const jni$_.JObjectNullableType()); + final _$uRL = uRL?.reference ?? jni$_.jNullReference; + return _sameFile(reference.pointer, _id_sameFile as jni$_.JMethodIDPtr, + _$uRL.pointer) + .boolean; } static final _id_setURLStreamHandlerFactory = _class.staticMethodId( @@ -1752,6 +1777,79 @@ class URL extends jni$_.JObject { _$uRLStreamHandlerFactory.pointer) .check(); } + + static final _id_toExternalForm = _class.instanceMethodId( + r'toExternalForm', + r'()Ljava/lang/String;', + ); + + static final _toExternalForm = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public java.lang.String toExternalForm()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JString? toExternalForm() { + return _toExternalForm( + reference.pointer, _id_toExternalForm as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); + } + + static final _id_toString$1 = _class.instanceMethodId( + r'toString', + r'()Ljava/lang/String;', + ); + + static final _toString$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public java.lang.String toString()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JString? toString$1() { + return _toString$1(reference.pointer, _id_toString$1 as jni$_.JMethodIDPtr) + .object(const jni$_.JStringNullableType()); + } + + static final _id_toURI = _class.instanceMethodId( + r'toURI', + r'()Ljava/net/URI;', + ); + + static final _toURI = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); + + /// from: `public java.net.URI toURI()` + /// The returned object must be released after use, by calling the [release] method. + jni$_.JObject? toURI() { + return _toURI(reference.pointer, _id_toURI as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); + } } final class $URL$NullableType extends jni$_.JObjType { @@ -1842,117 +1940,136 @@ class Executors extends jni$_.JObject { /// The type which includes information such as the signature of this class. static const nullableType = $Executors$NullableType(); static const type = $Executors$Type(); - static final _id_newFixedThreadPool = _class.staticMethodId( - r'newFixedThreadPool', - r'(I)Ljava/util/concurrent/ExecutorService;', + static final _id_callable = _class.staticMethodId( + r'callable', + r'(Ljava/lang/Runnable;)Ljava/util/concurrent/Callable;', ); - static final _newFixedThreadPool = jni$_.ProtectedJniExtensions.lookup< + static final _callable = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< - jni$_.JniResult Function(jni$_.Pointer, - jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni$_.JniResult Function( - jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public java.util.concurrent.ExecutorService newFixedThreadPool(int i)` + /// from: `static public java.util.concurrent.Callable callable(java.lang.Runnable runnable)` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? newFixedThreadPool( - int i, + static jni$_.JObject? callable( + jni$_.JObject? runnable, ) { - return _newFixedThreadPool(_class.reference.pointer, - _id_newFixedThreadPool as jni$_.JMethodIDPtr, i) + final _$runnable = runnable?.reference ?? jni$_.jNullReference; + return _callable(_class.reference.pointer, + _id_callable as jni$_.JMethodIDPtr, _$runnable.pointer) .object(const jni$_.JObjectNullableType()); } - static final _id_newWorkStealingPool = _class.staticMethodId( - r'newWorkStealingPool', - r'(I)Ljava/util/concurrent/ExecutorService;', + static final _id_callable$1 = _class.staticMethodId( + r'callable', + r'(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/Callable;', ); - static final _newWorkStealingPool = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< - jni$_.JniResult Function(jni$_.Pointer, - jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( - 'globalEnv_CallStaticObjectMethod') + static final _callable$1 = 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, int)>(); + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_.Pointer, + jni$_.Pointer)>(); - /// from: `static public java.util.concurrent.ExecutorService newWorkStealingPool(int i)` + /// from: `static public java.util.concurrent.Callable callable(java.lang.Runnable runnable, T object)` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? newWorkStealingPool( - int i, - ) { - return _newWorkStealingPool(_class.reference.pointer, - _id_newWorkStealingPool as jni$_.JMethodIDPtr, i) + static jni$_.JObject? callable$1<$T extends jni$_.JObject?>( + jni$_.JObject? runnable, + $T? object, { + required jni$_.JObjType<$T> T, + }) { + final _$runnable = runnable?.reference ?? jni$_.jNullReference; + final _$object = object?.reference ?? jni$_.jNullReference; + return _callable$1( + _class.reference.pointer, + _id_callable$1 as jni$_.JMethodIDPtr, + _$runnable.pointer, + _$object.pointer) .object(const jni$_.JObjectNullableType()); } - static final _id_newWorkStealingPool$1 = _class.staticMethodId( - r'newWorkStealingPool', - r'()Ljava/util/concurrent/ExecutorService;', + static final _id_callable$2 = _class.staticMethodId( + r'callable', + r'(Ljava/security/PrivilegedAction;)Ljava/util/concurrent/Callable;', ); - static final _newWorkStealingPool$1 = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') + static final _callable$2 = 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$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public java.util.concurrent.ExecutorService newWorkStealingPool()` + /// from: `static public java.util.concurrent.Callable callable(java.security.PrivilegedAction privilegedAction)` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? newWorkStealingPool$1() { - return _newWorkStealingPool$1(_class.reference.pointer, - _id_newWorkStealingPool$1 as jni$_.JMethodIDPtr) + static jni$_.JObject? callable$2( + jni$_.JObject? privilegedAction, + ) { + final _$privilegedAction = + privilegedAction?.reference ?? jni$_.jNullReference; + return _callable$2(_class.reference.pointer, + _id_callable$2 as jni$_.JMethodIDPtr, _$privilegedAction.pointer) .object(const jni$_.JObjectNullableType()); } - static final _id_newFixedThreadPool$1 = _class.staticMethodId( - r'newFixedThreadPool', - r'(ILjava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ExecutorService;', + static final _id_callable$3 = _class.staticMethodId( + r'callable', + r'(Ljava/security/PrivilegedExceptionAction;)Ljava/util/concurrent/Callable;', ); - static final _newFixedThreadPool$1 = jni$_.ProtectedJniExtensions.lookup< + static final _callable$3 = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, jni$_.JMethodIDPtr, - jni$_ - .VarArgs<(jni$_.Int32, jni$_.Pointer)>)>>( + jni$_.VarArgs<(jni$_.Pointer,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< jni$_.JniResult Function(jni$_.Pointer, - jni$_.JMethodIDPtr, int, jni$_.Pointer)>(); + jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public java.util.concurrent.ExecutorService newFixedThreadPool(int i, java.util.concurrent.ThreadFactory threadFactory)` + /// from: `static public java.util.concurrent.Callable callable(java.security.PrivilegedExceptionAction privilegedExceptionAction)` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? newFixedThreadPool$1( - int i, - jni$_.JObject? threadFactory, + static jni$_.JObject? callable$3( + jni$_.JObject? privilegedExceptionAction, ) { - final _$threadFactory = threadFactory?.reference ?? jni$_.jNullReference; - return _newFixedThreadPool$1( + final _$privilegedExceptionAction = + privilegedExceptionAction?.reference ?? jni$_.jNullReference; + return _callable$3( _class.reference.pointer, - _id_newFixedThreadPool$1 as jni$_.JMethodIDPtr, - i, - _$threadFactory.pointer) + _id_callable$3 as jni$_.JMethodIDPtr, + _$privilegedExceptionAction.pointer) .object(const jni$_.JObjectNullableType()); } - static final _id_newSingleThreadExecutor = _class.staticMethodId( - r'newSingleThreadExecutor', - r'()Ljava/util/concurrent/ExecutorService;', + static final _id_defaultThreadFactory = _class.staticMethodId( + r'defaultThreadFactory', + r'()Ljava/util/concurrent/ThreadFactory;', ); - static final _newSingleThreadExecutor = jni$_.ProtectedJniExtensions.lookup< + static final _defaultThreadFactory = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, @@ -1964,40 +2081,11 @@ class Executors extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `static public java.util.concurrent.ExecutorService newSingleThreadExecutor()` - /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? newSingleThreadExecutor() { - return _newSingleThreadExecutor(_class.reference.pointer, - _id_newSingleThreadExecutor as jni$_.JMethodIDPtr) - .object(const jni$_.JObjectNullableType()); - } - - static final _id_newSingleThreadExecutor$1 = _class.staticMethodId( - r'newSingleThreadExecutor', - r'(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ExecutorService;', - ); - - static final _newSingleThreadExecutor$1 = 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 java.util.concurrent.ExecutorService newSingleThreadExecutor(java.util.concurrent.ThreadFactory threadFactory)` + /// from: `static public java.util.concurrent.ThreadFactory defaultThreadFactory()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? newSingleThreadExecutor$1( - jni$_.JObject? threadFactory, - ) { - final _$threadFactory = threadFactory?.reference ?? jni$_.jNullReference; - return _newSingleThreadExecutor$1( - _class.reference.pointer, - _id_newSingleThreadExecutor$1 as jni$_.JMethodIDPtr, - _$threadFactory.pointer) + static jni$_.JObject? defaultThreadFactory() { + return _defaultThreadFactory(_class.reference.pointer, + _id_defaultThreadFactory as jni$_.JMethodIDPtr) .object(const jni$_.JObjectNullableType()); } @@ -2055,58 +2143,58 @@ class Executors extends jni$_.JObject { .object(const jni$_.JObjectNullableType()); } - static final _id_newSingleThreadScheduledExecutor = _class.staticMethodId( - r'newSingleThreadScheduledExecutor', - r'()Ljava/util/concurrent/ScheduledExecutorService;', + static final _id_newFixedThreadPool = _class.staticMethodId( + r'newFixedThreadPool', + r'(I)Ljava/util/concurrent/ExecutorService;', ); - static final _newSingleThreadScheduledExecutor = - jni$_.ProtectedJniExtensions.lookup< + static final _newFixedThreadPool = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') - .asFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - )>(); + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); - /// from: `static public java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor()` + /// from: `static public java.util.concurrent.ExecutorService newFixedThreadPool(int i)` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? newSingleThreadScheduledExecutor() { - return _newSingleThreadScheduledExecutor(_class.reference.pointer, - _id_newSingleThreadScheduledExecutor as jni$_.JMethodIDPtr) + static jni$_.JObject? newFixedThreadPool( + int i, + ) { + return _newFixedThreadPool(_class.reference.pointer, + _id_newFixedThreadPool as jni$_.JMethodIDPtr, i) .object(const jni$_.JObjectNullableType()); } - static final _id_newSingleThreadScheduledExecutor$1 = _class.staticMethodId( - r'newSingleThreadScheduledExecutor', - r'(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ScheduledExecutorService;', + static final _id_newFixedThreadPool$1 = _class.staticMethodId( + r'newFixedThreadPool', + r'(ILjava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ExecutorService;', ); - static final _newSingleThreadScheduledExecutor$1 = - 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)>(); + static final _newFixedThreadPool$1 = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + jni$_ + .VarArgs<(jni$_.Int32, jni$_.Pointer)>)>>( + 'globalEnv_CallStaticObjectMethod') + .asFunction< + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, int, jni$_.Pointer)>(); - /// from: `static public java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor(java.util.concurrent.ThreadFactory threadFactory)` + /// from: `static public java.util.concurrent.ExecutorService newFixedThreadPool(int i, java.util.concurrent.ThreadFactory threadFactory)` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? newSingleThreadScheduledExecutor$1( + static jni$_.JObject? newFixedThreadPool$1( + int i, jni$_.JObject? threadFactory, ) { final _$threadFactory = threadFactory?.reference ?? jni$_.jNullReference; - return _newSingleThreadScheduledExecutor$1( + return _newFixedThreadPool$1( _class.reference.pointer, - _id_newSingleThreadScheduledExecutor$1 as jni$_.JMethodIDPtr, + _id_newFixedThreadPool$1 as jni$_.JMethodIDPtr, + i, _$threadFactory.pointer) .object(const jni$_.JObjectNullableType()); } @@ -2167,75 +2255,12 @@ class Executors extends jni$_.JObject { .object(const jni$_.JObjectNullableType()); } - static final _id_unconfigurableExecutorService = _class.staticMethodId( - r'unconfigurableExecutorService', - r'(Ljava/util/concurrent/ExecutorService;)Ljava/util/concurrent/ExecutorService;', - ); - - static final _unconfigurableExecutorService = - 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 java.util.concurrent.ExecutorService unconfigurableExecutorService(java.util.concurrent.ExecutorService executorService)` - /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? unconfigurableExecutorService( - jni$_.JObject? executorService, - ) { - final _$executorService = - executorService?.reference ?? jni$_.jNullReference; - return _unconfigurableExecutorService( - _class.reference.pointer, - _id_unconfigurableExecutorService as jni$_.JMethodIDPtr, - _$executorService.pointer) - .object(const jni$_.JObjectNullableType()); - } - - static final _id_unconfigurableScheduledExecutorService = - _class.staticMethodId( - r'unconfigurableScheduledExecutorService', - r'(Ljava/util/concurrent/ScheduledExecutorService;)Ljava/util/concurrent/ScheduledExecutorService;', - ); - - static final _unconfigurableScheduledExecutorService = - 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 java.util.concurrent.ScheduledExecutorService unconfigurableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduledExecutorService)` - /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? unconfigurableScheduledExecutorService( - jni$_.JObject? scheduledExecutorService, - ) { - final _$scheduledExecutorService = - scheduledExecutorService?.reference ?? jni$_.jNullReference; - return _unconfigurableScheduledExecutorService( - _class.reference.pointer, - _id_unconfigurableScheduledExecutorService as jni$_.JMethodIDPtr, - _$scheduledExecutorService.pointer) - .object(const jni$_.JObjectNullableType()); - } - - static final _id_defaultThreadFactory = _class.staticMethodId( - r'defaultThreadFactory', - r'()Ljava/util/concurrent/ThreadFactory;', + static final _id_newSingleThreadExecutor = _class.staticMethodId( + r'newSingleThreadExecutor', + r'()Ljava/util/concurrent/ExecutorService;', ); - static final _defaultThreadFactory = jni$_.ProtectedJniExtensions.lookup< + static final _newSingleThreadExecutor = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< jni$_.JniResult Function( jni$_.Pointer, @@ -2247,160 +2272,145 @@ class Executors extends jni$_.JObject { jni$_.JMethodIDPtr, )>(); - /// from: `static public java.util.concurrent.ThreadFactory defaultThreadFactory()` + /// from: `static public java.util.concurrent.ExecutorService newSingleThreadExecutor()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? defaultThreadFactory() { - return _defaultThreadFactory(_class.reference.pointer, - _id_defaultThreadFactory as jni$_.JMethodIDPtr) + static jni$_.JObject? newSingleThreadExecutor() { + return _newSingleThreadExecutor(_class.reference.pointer, + _id_newSingleThreadExecutor as jni$_.JMethodIDPtr) .object(const jni$_.JObjectNullableType()); } - static final _id_privilegedThreadFactory = _class.staticMethodId( - r'privilegedThreadFactory', - r'()Ljava/util/concurrent/ThreadFactory;', + static final _id_newSingleThreadExecutor$1 = _class.staticMethodId( + r'newSingleThreadExecutor', + r'(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ExecutorService;', ); - static final _privilegedThreadFactory = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - )>>('globalEnv_CallStaticObjectMethod') + static final _newSingleThreadExecutor$1 = 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$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.Pointer)>(); - /// from: `static public java.util.concurrent.ThreadFactory privilegedThreadFactory()` + /// from: `static public java.util.concurrent.ExecutorService newSingleThreadExecutor(java.util.concurrent.ThreadFactory threadFactory)` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? privilegedThreadFactory() { - return _privilegedThreadFactory(_class.reference.pointer, - _id_privilegedThreadFactory as jni$_.JMethodIDPtr) + static jni$_.JObject? newSingleThreadExecutor$1( + jni$_.JObject? threadFactory, + ) { + final _$threadFactory = threadFactory?.reference ?? jni$_.jNullReference; + return _newSingleThreadExecutor$1( + _class.reference.pointer, + _id_newSingleThreadExecutor$1 as jni$_.JMethodIDPtr, + _$threadFactory.pointer) .object(const jni$_.JObjectNullableType()); } - static final _id_callable = _class.staticMethodId( - r'callable', - r'(Ljava/lang/Runnable;Ljava/lang/Object;)Ljava/util/concurrent/Callable;', + static final _id_newSingleThreadScheduledExecutor = _class.staticMethodId( + r'newSingleThreadScheduledExecutor', + r'()Ljava/util/concurrent/ScheduledExecutorService;', ); - static final _callable = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< + static final _newSingleThreadScheduledExecutor = + jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') + .asFunction< 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)>(); + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); - /// from: `static public java.util.concurrent.Callable callable(java.lang.Runnable runnable, T object)` + /// from: `static public java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? callable<$T extends jni$_.JObject?>( - jni$_.JObject? runnable, - $T? object, { - required jni$_.JObjType<$T> T, - }) { - final _$runnable = runnable?.reference ?? jni$_.jNullReference; - final _$object = object?.reference ?? jni$_.jNullReference; - return _callable( - _class.reference.pointer, - _id_callable as jni$_.JMethodIDPtr, - _$runnable.pointer, - _$object.pointer) + static jni$_.JObject? newSingleThreadScheduledExecutor() { + return _newSingleThreadScheduledExecutor(_class.reference.pointer, + _id_newSingleThreadScheduledExecutor as jni$_.JMethodIDPtr) .object(const jni$_.JObjectNullableType()); } - static final _id_callable$1 = _class.staticMethodId( - r'callable', - r'(Ljava/lang/Runnable;)Ljava/util/concurrent/Callable;', + static final _id_newSingleThreadScheduledExecutor$1 = _class.staticMethodId( + r'newSingleThreadScheduledExecutor', + r'(Ljava/util/concurrent/ThreadFactory;)Ljava/util/concurrent/ScheduledExecutorService;', ); - static final _callable$1 = 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)>(); + static final _newSingleThreadScheduledExecutor$1 = + 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 java.util.concurrent.Callable callable(java.lang.Runnable runnable)` + /// from: `static public java.util.concurrent.ScheduledExecutorService newSingleThreadScheduledExecutor(java.util.concurrent.ThreadFactory threadFactory)` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? callable$1( - jni$_.JObject? runnable, + static jni$_.JObject? newSingleThreadScheduledExecutor$1( + jni$_.JObject? threadFactory, ) { - final _$runnable = runnable?.reference ?? jni$_.jNullReference; - return _callable$1(_class.reference.pointer, - _id_callable$1 as jni$_.JMethodIDPtr, _$runnable.pointer) + final _$threadFactory = threadFactory?.reference ?? jni$_.jNullReference; + return _newSingleThreadScheduledExecutor$1( + _class.reference.pointer, + _id_newSingleThreadScheduledExecutor$1 as jni$_.JMethodIDPtr, + _$threadFactory.pointer) .object(const jni$_.JObjectNullableType()); } - static final _id_callable$2 = _class.staticMethodId( - r'callable', - r'(Ljava/security/PrivilegedAction;)Ljava/util/concurrent/Callable;', + static final _id_newWorkStealingPool = _class.staticMethodId( + r'newWorkStealingPool', + r'()Ljava/util/concurrent/ExecutorService;', ); - static final _callable$2 = jni$_.ProtectedJniExtensions.lookup< - jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - jni$_.VarArgs<(jni$_.Pointer,)>)>>( - 'globalEnv_CallStaticObjectMethod') + static final _newWorkStealingPool = jni$_.ProtectedJniExtensions.lookup< + jni$_.NativeFunction< + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>>('globalEnv_CallStaticObjectMethod') .asFunction< - jni$_.JniResult Function(jni$_.Pointer, - jni$_.JMethodIDPtr, jni$_.Pointer)>(); + jni$_.JniResult Function( + jni$_.Pointer, + jni$_.JMethodIDPtr, + )>(); - /// from: `static public java.util.concurrent.Callable callable(java.security.PrivilegedAction privilegedAction)` + /// from: `static public java.util.concurrent.ExecutorService newWorkStealingPool()` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? callable$2( - jni$_.JObject? privilegedAction, - ) { - final _$privilegedAction = - privilegedAction?.reference ?? jni$_.jNullReference; - return _callable$2(_class.reference.pointer, - _id_callable$2 as jni$_.JMethodIDPtr, _$privilegedAction.pointer) + static jni$_.JObject? newWorkStealingPool() { + return _newWorkStealingPool(_class.reference.pointer, + _id_newWorkStealingPool as jni$_.JMethodIDPtr) .object(const jni$_.JObjectNullableType()); } - static final _id_callable$3 = _class.staticMethodId( - r'callable', - r'(Ljava/security/PrivilegedExceptionAction;)Ljava/util/concurrent/Callable;', + static final _id_newWorkStealingPool$1 = _class.staticMethodId( + r'newWorkStealingPool', + r'(I)Ljava/util/concurrent/ExecutorService;', ); - static final _callable$3 = jni$_.ProtectedJniExtensions.lookup< + static final _newWorkStealingPool$1 = jni$_.ProtectedJniExtensions.lookup< jni$_.NativeFunction< - jni$_.JniResult Function( - jni$_.Pointer, - jni$_.JMethodIDPtr, - jni$_.VarArgs<(jni$_.Pointer,)>)>>( + jni$_.JniResult Function(jni$_.Pointer, + jni$_.JMethodIDPtr, jni$_.VarArgs<(jni$_.Int32,)>)>>( 'globalEnv_CallStaticObjectMethod') .asFunction< - jni$_.JniResult Function(jni$_.Pointer, - jni$_.JMethodIDPtr, jni$_.Pointer)>(); + jni$_.JniResult Function( + jni$_.Pointer, jni$_.JMethodIDPtr, int)>(); - /// from: `static public java.util.concurrent.Callable callable(java.security.PrivilegedExceptionAction privilegedExceptionAction)` + /// from: `static public java.util.concurrent.ExecutorService newWorkStealingPool(int i)` /// The returned object must be released after use, by calling the [release] method. - static jni$_.JObject? callable$3( - jni$_.JObject? privilegedExceptionAction, + static jni$_.JObject? newWorkStealingPool$1( + int i, ) { - final _$privilegedExceptionAction = - privilegedExceptionAction?.reference ?? jni$_.jNullReference; - return _callable$3( - _class.reference.pointer, - _id_callable$3 as jni$_.JMethodIDPtr, - _$privilegedExceptionAction.pointer) + return _newWorkStealingPool$1(_class.reference.pointer, + _id_newWorkStealingPool$1 as jni$_.JMethodIDPtr, i) .object(const jni$_.JObjectNullableType()); } @@ -2464,6 +2474,94 @@ class Executors extends jni$_.JObject { _$callable.pointer) .object(const jni$_.JObjectNullableType()); } + + static final _id_privilegedThreadFactory = _class.staticMethodId( + r'privilegedThreadFactory', + r'()Ljava/util/concurrent/ThreadFactory;', + ); + + static final _privilegedThreadFactory = 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 java.util.concurrent.ThreadFactory privilegedThreadFactory()` + /// The returned object must be released after use, by calling the [release] method. + static jni$_.JObject? privilegedThreadFactory() { + return _privilegedThreadFactory(_class.reference.pointer, + _id_privilegedThreadFactory as jni$_.JMethodIDPtr) + .object(const jni$_.JObjectNullableType()); + } + + static final _id_unconfigurableExecutorService = _class.staticMethodId( + r'unconfigurableExecutorService', + r'(Ljava/util/concurrent/ExecutorService;)Ljava/util/concurrent/ExecutorService;', + ); + + static final _unconfigurableExecutorService = + 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 java.util.concurrent.ExecutorService unconfigurableExecutorService(java.util.concurrent.ExecutorService executorService)` + /// The returned object must be released after use, by calling the [release] method. + static jni$_.JObject? unconfigurableExecutorService( + jni$_.JObject? executorService, + ) { + final _$executorService = + executorService?.reference ?? jni$_.jNullReference; + return _unconfigurableExecutorService( + _class.reference.pointer, + _id_unconfigurableExecutorService as jni$_.JMethodIDPtr, + _$executorService.pointer) + .object(const jni$_.JObjectNullableType()); + } + + static final _id_unconfigurableScheduledExecutorService = + _class.staticMethodId( + r'unconfigurableScheduledExecutorService', + r'(Ljava/util/concurrent/ScheduledExecutorService;)Ljava/util/concurrent/ScheduledExecutorService;', + ); + + static final _unconfigurableScheduledExecutorService = + 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 java.util.concurrent.ScheduledExecutorService unconfigurableScheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduledExecutorService)` + /// The returned object must be released after use, by calling the [release] method. + static jni$_.JObject? unconfigurableScheduledExecutorService( + jni$_.JObject? scheduledExecutorService, + ) { + final _$scheduledExecutorService = + scheduledExecutorService?.reference ?? jni$_.jNullReference; + return _unconfigurableScheduledExecutorService( + _class.reference.pointer, + _id_unconfigurableScheduledExecutorService as jni$_.JMethodIDPtr, + _$scheduledExecutorService.pointer) + .object(const jni$_.JObjectNullableType()); + } } final class $Executors$NullableType extends jni$_.JObjType { diff --git a/pkgs/cronet_http/pubspec.yaml b/pkgs/cronet_http/pubspec.yaml index 42a68962e2..96e0ba4321 100644 --- a/pkgs/cronet_http/pubspec.yaml +++ b/pkgs/cronet_http/pubspec.yaml @@ -1,5 +1,5 @@ name: cronet_http -version: 1.4.0 +version: 1.5.0-wip description: >- An Android Flutter plugin that provides access to the Cronet HTTP client. repository: https://github.com/dart-lang/http/tree/master/pkgs/cronet_http @@ -11,7 +11,7 @@ environment: dependencies: flutter: sdk: flutter - http: ^1.2.0 + http: ^1.5.0-beta http_profile: ^0.1.0 jni: ^0.14.2