Skip to content

Commit

Permalink
[cronet_http] Upgrade jni and jnigen to 0.12.0 (#1311)
Browse files Browse the repository at this point in the history
  • Loading branch information
HosseinYousefi authored Oct 2, 2024
1 parent aded576 commit f59cd79
Show file tree
Hide file tree
Showing 12 changed files with 2,335 additions and 2,315 deletions.
1 change: 1 addition & 0 deletions pkgs/cronet_http/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Throw `ClientException` if `CronetClient.send` runs out of Java heap while
allocating memory for the request body.
* Upgrade `package:jni` and `package:jnigen` to 0.12.0.

## 1.3.2

Expand Down
2 changes: 1 addition & 1 deletion pkgs/cronet_http/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
1 change: 1 addition & 0 deletions pkgs/cronet_http/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
namespace 'io.flutter.cronet_http_example'

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.flutter.cronet_http_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.flutter.cronet_http_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:label="cronet_http_example"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.flutter.cronet_http_example">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
2 changes: 1 addition & 1 deletion pkgs/cronet_http/example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.6.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
3 changes: 0 additions & 3 deletions pkgs/cronet_http/jnigen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,3 @@ classes:
- 'org.chromium.net.UploadDataProviders'
- 'org.chromium.net.UrlRequest'
- 'org.chromium.net.UrlResponseInfo'

enable_experiment:
- 'interface_implementation'
6 changes: 3 additions & 3 deletions pkgs/cronet_http/lib/src/cronet_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jb.UrlRequestCallbackProxy_UrlRequestCallbackInterface _urlRequestCallbacks(
// The order of callbacks generated by Cronet is documented here:
// https://developer.android.com/guide/topics/connectivity/cronet/lifecycle
return jb.UrlRequestCallbackProxy_UrlRequestCallbackInterface.implement(
jb.$UrlRequestCallbackProxy_UrlRequestCallbackInterfaceImpl(
jb.$UrlRequestCallbackProxy_UrlRequestCallbackInterface(
onResponseStarted: (urlRequest, responseInfo) {
responseStream = StreamController();
final responseHeaders =
Expand Down Expand Up @@ -377,7 +377,7 @@ class CronetClient extends BaseClient {

final builder = engine._engine.newUrlRequestBuilder(
request.url.toString().toJString(),
jb.UrlRequestCallbackProxy.new1(
jb.UrlRequestCallbackProxy(
_urlRequestCallbacks(request, responseCompleter, profile)),
_executor,
)..setHttpMethod(request.method.toJString());
Expand Down Expand Up @@ -407,7 +407,7 @@ class CronetClient extends BaseClient {
}

builder.setUploadDataProvider(
jb.UploadDataProviders.create2(data), _executor);
jb.UploadDataProviders.create$2(data), _executor);
}
builder.build().start();
return responseCompleter.future;
Expand Down
Loading

0 comments on commit f59cd79

Please sign in to comment.