Moved Cronet code under Connectivity
$ cp -r Cronet/ Connectivity/ $ rm -r Cronet/* Bug: 251054736 Test: atest CronetApiTest Change-Id: I25d5238fe530ffaa830ce64c67b351d40b8030ea CTS-Coverage-Bug: 251012627
This commit is contained in:
parent
411f5a2167
commit
ceb2a75099
|
@ -0,0 +1,113 @@
|
|||
// Copyright (C) 2019 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
java_import {
|
||||
name: "cronet_impl_native_java",
|
||||
jars: ["prebuilt/cronet_impl_native_java.jar"],
|
||||
visibility: ["//visibility:private"],
|
||||
apex_available: ["com.android.cronet"],
|
||||
}
|
||||
|
||||
java_import {
|
||||
name: "cronet_impl_common_java",
|
||||
jars: ["prebuilt/cronet_impl_common_java.jar"],
|
||||
visibility: ["//visibility:private"],
|
||||
apex_available: ["com.android.cronet"],
|
||||
}
|
||||
|
||||
java_import {
|
||||
name: "cronet_impl_platform_java",
|
||||
jars: ["prebuilt/cronet_impl_platform_java.jar"],
|
||||
visibility: ["//visibility:private"],
|
||||
apex_available: ["com.android.cronet"],
|
||||
}
|
||||
|
||||
cc_prebuilt_library_shared {
|
||||
name: "libcronet.80.0.3986.0",
|
||||
// STOPSHIP: Confirm if it is safe
|
||||
shared_libs: [
|
||||
"libandroid",
|
||||
"libc",
|
||||
"libdl",
|
||||
"liblog",
|
||||
"libm",
|
||||
],
|
||||
stl: "libc++_static",
|
||||
target: {
|
||||
android_arm64: {
|
||||
srcs: ["prebuilt/libs/arm64-v8a/libcronet.80.0.3986.0.so"],
|
||||
},
|
||||
android_arm: {
|
||||
srcs: ["prebuilt/libs/armeabi-v7a/libcronet.80.0.3986.0.so"],
|
||||
},
|
||||
android_x86_64: {
|
||||
srcs: ["prebuilt/libs/x86_64/libcronet.80.0.3986.0.so"],
|
||||
},
|
||||
android_x86: {
|
||||
srcs: ["prebuilt/libs/x86/libcronet.80.0.3986.0.so"],
|
||||
},
|
||||
},
|
||||
// These are already stripped, and restripping them just issues diagnostics.
|
||||
strip: {
|
||||
none: true,
|
||||
},
|
||||
apex_available: ["com.android.cronet"],
|
||||
}
|
||||
|
||||
genrule {
|
||||
name: "cronet_api-src",
|
||||
srcs: ["prebuilt/cronet_api-src.jar"],
|
||||
cmd: "cp $(in) $(out)",
|
||||
out: [
|
||||
"cronet_api-src.srcjar",
|
||||
],
|
||||
}
|
||||
|
||||
java_sdk_library {
|
||||
name: "org.chromium.net.cronet",
|
||||
srcs: [
|
||||
":cronet_api-src",
|
||||
],
|
||||
// Only public non-hide methods for now.
|
||||
// TODO: Confirm target APIs with Cronet team.
|
||||
api_packages: [
|
||||
"org.chromium.net",
|
||||
],
|
||||
libs: [
|
||||
"androidx.annotation_annotation",
|
||||
],
|
||||
static_libs: [
|
||||
"cronet_impl_common_java",
|
||||
"cronet_impl_native_java",
|
||||
"cronet_impl_platform_java",
|
||||
],
|
||||
// Add dependencies on files used by droiddoc_options.
|
||||
droiddoc_option_files: [":cronet-api-current.txt"],
|
||||
apex_available: ["com.android.cronet"],
|
||||
unsafe_ignore_missing_latest_api: true,
|
||||
dist_group: "android",
|
||||
}
|
||||
|
||||
// Make the current.txt available for use by the cts/tests/signature tests.
|
||||
// ========================================================================
|
||||
filegroup {
|
||||
name: "cronet-api-current.txt",
|
||||
srcs: [
|
||||
"api/current.txt",
|
||||
],
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.android.cronet"
|
||||
android:versionCode="11"
|
||||
android:versionName="R-initial">
|
||||
</manifest>
|
|
@ -0,0 +1,2 @@
|
|||
set noparent
|
||||
file:platform/packages/modules/Connectivity:master:/OWNERS_core_networking
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"postsubmit": [
|
||||
{
|
||||
"name": "CronetApiTest"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
// Copyright (C) 2019 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
apex_defaults {
|
||||
name: "com.android.cronet-defaults",
|
||||
compile_multilib: "both",
|
||||
jni_libs: ["libcronet.80.0.3986.0"],
|
||||
java_libs: ["org.chromium.net.cronet"],
|
||||
key: "com.android.cronet.key",
|
||||
certificate: ":com.android.cronet.certificate",
|
||||
updatable: false,
|
||||
generate_hashtree: false,
|
||||
|
||||
// Use a custom AndroidManifest.xml used for API targeting.
|
||||
androidManifest: ":cronet-manifest.xml",
|
||||
}
|
||||
|
||||
filegroup {
|
||||
name: "cronet-manifest.xml",
|
||||
srcs: [
|
||||
"AndroidManifest.xml",
|
||||
],
|
||||
}
|
||||
|
||||
apex {
|
||||
name: "com.android.cronet",
|
||||
defaults: ["com.android.cronet-defaults"],
|
||||
manifest: "manifest.json",
|
||||
}
|
||||
|
||||
apex_key {
|
||||
name: "com.android.cronet.key",
|
||||
public_key: "com.android.cronet.avbpubkey",
|
||||
private_key: "com.android.cronet.pem",
|
||||
}
|
||||
|
||||
android_app_certificate {
|
||||
name: "com.android.cronet.certificate",
|
||||
certificate: "com.android.cronet",
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.android.cronet">
|
||||
<!-- APEX does not have classes.dex -->
|
||||
<application android:hasCode="false" />
|
||||
<uses-sdk
|
||||
android:minSdkVersion="29"
|
||||
/>
|
||||
</manifest>
|
Binary file not shown.
|
@ -0,0 +1,51 @@
|
|||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIJKAIBAAKCAgEAqpxkMMK57w+fzxLcwF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5yIZzC5C
|
||||
hiTXSE9AwCFllMRKInnbhUdy/L+xUL6mAbGVvD/DHE7Q2xmPSsdEX5nTZkhEnW/L
|
||||
TLLgbsy2+8ouvMJCSNaMq77jq7iCIMTogEfA5GX0UO2Kjf4pnjREOzNQg4I=
|
||||
-----END RSA PRIVATE KEY-----
|
Binary file not shown.
|
@ -0,0 +1,35 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIGIzCCBAugAwIBAgIUKEbkVLro9rIJE3M71D8sgUIngUIwDQYJKoZIhvcNAQEL
|
||||
BQAwgZ8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQH
|
||||
DA1Nb3VudGFpbiBWaWV3MRAwDgYDVQQKDAdBbmRyb2lkMRAwDgYDVQQLDAdBbmRy
|
||||
b2lkMRswGQYDVQQDDBJjb20uYW5kcm9pZC5jcm9uZXQxIjAgBgkqhkiG9w0BCQEW
|
||||
E2FuZHJvaWRAYW5kcm9pZC5jb20wIBcNMTkxMjA1MDcwOTIxWhgPNDc1NzEwMzEw
|
||||
NzA5MjFaMIGfMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQG
|
||||
A1UEBwwNTW91bnRhaW4gVmlldzEQMA4GA1UECgwHQW5kcm9pZDEQMA4GA1UECwwH
|
||||
QW5kcm9pZDEbMBkGA1UEAwwSY29tLmFuZHJvaWQuY3JvbmV0MSIwIAYJKoZIhvcN
|
||||
AQkBFhNhbmRyb2lkQGFuZHJvaWQuY29tMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
|
||||
MIICCgKCAgEAwNXIHR2BeZl/R7tOXgC3KK71rrtK98zucfrNBNp/rUiFqiN527P4
|
||||
HLW+CAwnFJGLLzHhSbXiZLXyLS7FfPuMeiULUsv1mIVEVwVhtPvbodxwh5szxlVe
|
||||
iVf1WkIV90n2tZojTnhMsiEPt0EBWriPJstdO264snqg+oY9Dktxk4tXtTah/rUI
|
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Hn/80yATKAe0/AztoZpQWZ5g1IAnpCISg
|
||||
k65FHVhbkcKdjNQePOGwjictq21KaYFrbXfIwqpejxSqQdLMne02Dj/2kv0dU1jV
|
||||
JG9YxVWIpobauYD5mmZvN6PTYJWGQRAsIFFyWfhvnEiohGmVLNEQ3uRaue0yNMXc
|
||||
V2t8B81/jNGXwi06qxmjCMnMhucSCSFl2a2V5oiDEcVj4YbaJ+CEJPdopMhQwqab
|
||||
EgTkJBeEXoPFenToSIprL/YiuBNvvPETyTYN+hAXh3P7MSeWewkgGhpZhuyzT8F0
|
||||
vEo+nt5WhRWl0pEVLFLiOOXR+/LAB3aqrPEdd0NXvxiCb/QaZnCp
|
||||
-----END CERTIFICATE-----
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "com.android.cronet",
|
||||
"version": 1
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
// Copyright 2019 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
apex_test {
|
||||
name: "test_com.android.cronet",
|
||||
visibility: [
|
||||
"//system/apex/tests",
|
||||
],
|
||||
defaults: ["com.android.cronet-defaults"],
|
||||
manifest: "test_apex_manifest.json",
|
||||
file_contexts: ":com.android.cronet-file_contexts",
|
||||
// Test APEX, should never be installed
|
||||
installable: false,
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "com.android.cronet",
|
||||
"version": 300000000
|
||||
}
|
|
@ -0,0 +1,175 @@
|
|||
// Signature format: 2.0
|
||||
package org.chromium.net {
|
||||
|
||||
public abstract class CallbackException extends org.chromium.net.CronetException {
|
||||
ctor protected CallbackException(String, Throwable);
|
||||
}
|
||||
|
||||
public abstract class CronetEngine {
|
||||
ctor public CronetEngine();
|
||||
method public abstract java.net.URLStreamHandlerFactory createURLStreamHandlerFactory();
|
||||
method public abstract byte[] getGlobalMetricsDeltas();
|
||||
method public abstract String getVersionString();
|
||||
method public abstract org.chromium.net.UrlRequest.Builder newUrlRequestBuilder(String, org.chromium.net.UrlRequest.Callback, java.util.concurrent.Executor);
|
||||
method public abstract java.net.URLConnection openConnection(java.net.URL) throws java.io.IOException;
|
||||
method public abstract void shutdown();
|
||||
method public abstract void startNetLogToFile(String, boolean);
|
||||
method public abstract void stopNetLog();
|
||||
}
|
||||
|
||||
public static class CronetEngine.Builder {
|
||||
ctor public CronetEngine.Builder(android.content.Context);
|
||||
method public org.chromium.net.CronetEngine.Builder addPublicKeyPins(String, java.util.Set<byte[]>, boolean, java.util.Date);
|
||||
method public org.chromium.net.CronetEngine.Builder addQuicHint(String, int, int);
|
||||
method public org.chromium.net.CronetEngine build();
|
||||
method public org.chromium.net.CronetEngine.Builder enableBrotli(boolean);
|
||||
method public org.chromium.net.CronetEngine.Builder enableHttp2(boolean);
|
||||
method public org.chromium.net.CronetEngine.Builder enableHttpCache(int, long);
|
||||
method public org.chromium.net.CronetEngine.Builder enablePublicKeyPinningBypassForLocalTrustAnchors(boolean);
|
||||
method public org.chromium.net.CronetEngine.Builder enableQuic(boolean);
|
||||
method public String getDefaultUserAgent();
|
||||
method public org.chromium.net.CronetEngine.Builder setLibraryLoader(org.chromium.net.CronetEngine.Builder.LibraryLoader);
|
||||
method public org.chromium.net.CronetEngine.Builder setStoragePath(String);
|
||||
method public org.chromium.net.CronetEngine.Builder setUserAgent(String);
|
||||
field public static final int HTTP_CACHE_DISABLED = 0; // 0x0
|
||||
field public static final int HTTP_CACHE_DISK = 3; // 0x3
|
||||
field public static final int HTTP_CACHE_DISK_NO_HTTP = 2; // 0x2
|
||||
field public static final int HTTP_CACHE_IN_MEMORY = 1; // 0x1
|
||||
}
|
||||
|
||||
public abstract static class CronetEngine.Builder.LibraryLoader {
|
||||
ctor public CronetEngine.Builder.LibraryLoader();
|
||||
method public abstract void loadLibrary(String);
|
||||
}
|
||||
|
||||
public abstract class CronetException extends java.io.IOException {
|
||||
ctor protected CronetException(String, Throwable);
|
||||
}
|
||||
|
||||
public final class InlineExecutionProhibitedException extends java.util.concurrent.RejectedExecutionException {
|
||||
ctor public InlineExecutionProhibitedException();
|
||||
}
|
||||
|
||||
public abstract class NetworkException extends org.chromium.net.CronetException {
|
||||
ctor protected NetworkException(String, Throwable);
|
||||
method public abstract int getCronetInternalErrorCode();
|
||||
method public abstract int getErrorCode();
|
||||
method public abstract boolean immediatelyRetryable();
|
||||
field public static final int ERROR_ADDRESS_UNREACHABLE = 9; // 0x9
|
||||
field public static final int ERROR_CONNECTION_CLOSED = 5; // 0x5
|
||||
field public static final int ERROR_CONNECTION_REFUSED = 7; // 0x7
|
||||
field public static final int ERROR_CONNECTION_RESET = 8; // 0x8
|
||||
field public static final int ERROR_CONNECTION_TIMED_OUT = 6; // 0x6
|
||||
field public static final int ERROR_HOSTNAME_NOT_RESOLVED = 1; // 0x1
|
||||
field public static final int ERROR_INTERNET_DISCONNECTED = 2; // 0x2
|
||||
field public static final int ERROR_NETWORK_CHANGED = 3; // 0x3
|
||||
field public static final int ERROR_OTHER = 11; // 0xb
|
||||
field public static final int ERROR_QUIC_PROTOCOL_FAILED = 10; // 0xa
|
||||
field public static final int ERROR_TIMED_OUT = 4; // 0x4
|
||||
}
|
||||
|
||||
public abstract class QuicException extends org.chromium.net.NetworkException {
|
||||
ctor protected QuicException(String, Throwable);
|
||||
method public abstract int getQuicDetailedErrorCode();
|
||||
}
|
||||
|
||||
public abstract class UploadDataProvider implements java.io.Closeable {
|
||||
ctor public UploadDataProvider();
|
||||
method public void close() throws java.io.IOException;
|
||||
method public abstract long getLength() throws java.io.IOException;
|
||||
method public abstract void read(org.chromium.net.UploadDataSink, java.nio.ByteBuffer) throws java.io.IOException;
|
||||
method public abstract void rewind(org.chromium.net.UploadDataSink) throws java.io.IOException;
|
||||
}
|
||||
|
||||
public final class UploadDataProviders {
|
||||
method public static org.chromium.net.UploadDataProvider create(java.io.File);
|
||||
method public static org.chromium.net.UploadDataProvider create(android.os.ParcelFileDescriptor);
|
||||
method public static org.chromium.net.UploadDataProvider create(java.nio.ByteBuffer);
|
||||
method public static org.chromium.net.UploadDataProvider create(byte[], int, int);
|
||||
method public static org.chromium.net.UploadDataProvider create(byte[]);
|
||||
}
|
||||
|
||||
public abstract class UploadDataSink {
|
||||
ctor public UploadDataSink();
|
||||
method public abstract void onReadError(Exception);
|
||||
method public abstract void onReadSucceeded(boolean);
|
||||
method public abstract void onRewindError(Exception);
|
||||
method public abstract void onRewindSucceeded();
|
||||
}
|
||||
|
||||
public abstract class UrlRequest {
|
||||
ctor public UrlRequest();
|
||||
method public abstract void cancel();
|
||||
method public abstract void followRedirect();
|
||||
method public abstract void getStatus(org.chromium.net.UrlRequest.StatusListener);
|
||||
method public abstract boolean isDone();
|
||||
method public abstract void read(java.nio.ByteBuffer);
|
||||
method public abstract void start();
|
||||
}
|
||||
|
||||
public abstract static class UrlRequest.Builder {
|
||||
ctor public UrlRequest.Builder();
|
||||
method public abstract org.chromium.net.UrlRequest.Builder addHeader(String, String);
|
||||
method public abstract org.chromium.net.UrlRequest.Builder allowDirectExecutor();
|
||||
method public abstract org.chromium.net.UrlRequest build();
|
||||
method public abstract org.chromium.net.UrlRequest.Builder disableCache();
|
||||
method public abstract org.chromium.net.UrlRequest.Builder setHttpMethod(String);
|
||||
method public abstract org.chromium.net.UrlRequest.Builder setPriority(int);
|
||||
method public abstract org.chromium.net.UrlRequest.Builder setUploadDataProvider(org.chromium.net.UploadDataProvider, java.util.concurrent.Executor);
|
||||
field public static final int REQUEST_PRIORITY_HIGHEST = 4; // 0x4
|
||||
field public static final int REQUEST_PRIORITY_IDLE = 0; // 0x0
|
||||
field public static final int REQUEST_PRIORITY_LOW = 2; // 0x2
|
||||
field public static final int REQUEST_PRIORITY_LOWEST = 1; // 0x1
|
||||
field public static final int REQUEST_PRIORITY_MEDIUM = 3; // 0x3
|
||||
}
|
||||
|
||||
public abstract static class UrlRequest.Callback {
|
||||
ctor public UrlRequest.Callback();
|
||||
method public void onCanceled(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo);
|
||||
method public abstract void onFailed(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, org.chromium.net.CronetException);
|
||||
method public abstract void onReadCompleted(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, java.nio.ByteBuffer) throws java.lang.Exception;
|
||||
method public abstract void onRedirectReceived(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, String) throws java.lang.Exception;
|
||||
method public abstract void onResponseStarted(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo) throws java.lang.Exception;
|
||||
method public abstract void onSucceeded(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo);
|
||||
}
|
||||
|
||||
public static class UrlRequest.Status {
|
||||
field public static final int CONNECTING = 10; // 0xa
|
||||
field public static final int DOWNLOADING_PAC_FILE = 5; // 0x5
|
||||
field public static final int ESTABLISHING_PROXY_TUNNEL = 8; // 0x8
|
||||
field public static final int IDLE = 0; // 0x0
|
||||
field public static final int INVALID = -1; // 0xffffffff
|
||||
field public static final int READING_RESPONSE = 14; // 0xe
|
||||
field public static final int RESOLVING_HOST = 9; // 0x9
|
||||
field public static final int RESOLVING_HOST_IN_PAC_FILE = 7; // 0x7
|
||||
field public static final int RESOLVING_PROXY_FOR_URL = 6; // 0x6
|
||||
field public static final int SENDING_REQUEST = 12; // 0xc
|
||||
field public static final int SSL_HANDSHAKE = 11; // 0xb
|
||||
field public static final int WAITING_FOR_AVAILABLE_SOCKET = 2; // 0x2
|
||||
field public static final int WAITING_FOR_CACHE = 4; // 0x4
|
||||
field public static final int WAITING_FOR_DELEGATE = 3; // 0x3
|
||||
field public static final int WAITING_FOR_RESPONSE = 13; // 0xd
|
||||
field public static final int WAITING_FOR_STALLED_SOCKET_POOL = 1; // 0x1
|
||||
}
|
||||
|
||||
public abstract static class UrlRequest.StatusListener {
|
||||
ctor public UrlRequest.StatusListener();
|
||||
method public abstract void onStatus(int);
|
||||
}
|
||||
|
||||
public abstract class UrlResponseInfo {
|
||||
ctor public UrlResponseInfo();
|
||||
method public abstract java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAllHeaders();
|
||||
method public abstract java.util.List<java.util.Map.Entry<java.lang.String,java.lang.String>> getAllHeadersAsList();
|
||||
method public abstract int getHttpStatusCode();
|
||||
method public abstract String getHttpStatusText();
|
||||
method public abstract String getNegotiatedProtocol();
|
||||
method public abstract String getProxyServer();
|
||||
method public abstract long getReceivedByteCount();
|
||||
method public abstract String getUrl();
|
||||
method public abstract java.util.List<java.lang.String> getUrlChain();
|
||||
method public abstract boolean wasCached();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,263 @@
|
|||
// Baseline format: 1.0
|
||||
AcronymName: org.chromium.net.CronetEngine#createURLStreamHandlerFactory():
|
||||
Acronyms should not be capitalized in method names: was `createURLStreamHandlerFactory`, should this be `createUrlStreamHandlerFactory`?
|
||||
|
||||
|
||||
AndroidUri: org.chromium.net.CronetEngine#createURLStreamHandlerFactory():
|
||||
Use android.net.Uri instead of java.net.URL (method org.chromium.net.CronetEngine.createURLStreamHandlerFactory())
|
||||
AndroidUri: org.chromium.net.CronetEngine#openConnection(java.net.URL):
|
||||
Use android.net.Uri instead of java.net.URL (method org.chromium.net.CronetEngine.openConnection(java.net.URL))
|
||||
AndroidUri: org.chromium.net.CronetEngine#openConnection(java.net.URL) parameter #0:
|
||||
Use android.net.Uri instead of java.net.URL (parameter url in org.chromium.net.CronetEngine.openConnection(java.net.URL url))
|
||||
|
||||
|
||||
BuilderSetStyle: org.chromium.net.CronetEngine.Builder#enableBrotli(boolean):
|
||||
Builder methods names should use setFoo() / addFoo() / clearFoo() style: method org.chromium.net.CronetEngine.Builder.enableBrotli(boolean)
|
||||
BuilderSetStyle: org.chromium.net.CronetEngine.Builder#enableHttp2(boolean):
|
||||
Builder methods names should use setFoo() / addFoo() / clearFoo() style: method org.chromium.net.CronetEngine.Builder.enableHttp2(boolean)
|
||||
BuilderSetStyle: org.chromium.net.CronetEngine.Builder#enableHttpCache(int, long):
|
||||
Builder methods names should use setFoo() / addFoo() / clearFoo() style: method org.chromium.net.CronetEngine.Builder.enableHttpCache(int,long)
|
||||
BuilderSetStyle: org.chromium.net.CronetEngine.Builder#enablePublicKeyPinningBypassForLocalTrustAnchors(boolean):
|
||||
Builder methods names should use setFoo() / addFoo() / clearFoo() style: method org.chromium.net.CronetEngine.Builder.enablePublicKeyPinningBypassForLocalTrustAnchors(boolean)
|
||||
BuilderSetStyle: org.chromium.net.CronetEngine.Builder#enableQuic(boolean):
|
||||
Builder methods names should use setFoo() / addFoo() / clearFoo() style: method org.chromium.net.CronetEngine.Builder.enableQuic(boolean)
|
||||
BuilderSetStyle: org.chromium.net.UrlRequest.Builder#allowDirectExecutor():
|
||||
Builder methods names should use setFoo() / addFoo() / clearFoo() style: method org.chromium.net.UrlRequest.Builder.allowDirectExecutor()
|
||||
BuilderSetStyle: org.chromium.net.UrlRequest.Builder#disableCache():
|
||||
Builder methods names should use setFoo() / addFoo() / clearFoo() style: method org.chromium.net.UrlRequest.Builder.disableCache()
|
||||
|
||||
|
||||
ExecutorRegistration: org.chromium.net.UrlRequest#getStatus(org.chromium.net.UrlRequest.StatusListener):
|
||||
Registration methods should have overload that accepts delivery Executor: `getStatus`
|
||||
|
||||
|
||||
GenericException: org.chromium.net.UrlRequest.Callback#onReadCompleted(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, java.nio.ByteBuffer):
|
||||
Methods must not throw generic exceptions (`java.lang.Exception`)
|
||||
GenericException: org.chromium.net.UrlRequest.Callback#onRedirectReceived(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, String):
|
||||
Methods must not throw generic exceptions (`java.lang.Exception`)
|
||||
GenericException: org.chromium.net.UrlRequest.Callback#onResponseStarted(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo):
|
||||
Methods must not throw generic exceptions (`java.lang.Exception`)
|
||||
|
||||
|
||||
GetterOnBuilder: org.chromium.net.CronetEngine.Builder#getDefaultUserAgent():
|
||||
Getter should be on the built object, not the builder: method org.chromium.net.CronetEngine.Builder.getDefaultUserAgent()
|
||||
|
||||
|
||||
ListenerInterface: org.chromium.net.UrlRequest.StatusListener:
|
||||
Listeners should be an interface, or otherwise renamed Callback: StatusListener
|
||||
|
||||
|
||||
ListenerLast: org.chromium.net.CronetEngine#newUrlRequestBuilder(String, org.chromium.net.UrlRequest.Callback, java.util.concurrent.Executor) parameter #2:
|
||||
Listeners should always be at end of argument list (method `newUrlRequestBuilder`)
|
||||
|
||||
|
||||
MissingGetterMatchingBuilder: org.chromium.net.CronetEngine.Builder#addPublicKeyPins(String, java.util.Set<byte[]>, boolean, java.util.Date):
|
||||
org.chromium.net.CronetEngine does not declare a `getPublicKeyPinss()` method matching method org.chromium.net.CronetEngine.Builder.addPublicKeyPins(String,java.util.Set<byte[]>,boolean,java.util.Date)
|
||||
MissingGetterMatchingBuilder: org.chromium.net.CronetEngine.Builder#addQuicHint(String, int, int):
|
||||
org.chromium.net.CronetEngine does not declare a `getQuicHints()` method matching method org.chromium.net.CronetEngine.Builder.addQuicHint(String,int,int)
|
||||
MissingGetterMatchingBuilder: org.chromium.net.CronetEngine.Builder#setLibraryLoader(org.chromium.net.CronetEngine.Builder.LibraryLoader):
|
||||
org.chromium.net.CronetEngine does not declare a `getLibraryLoader()` method matching method org.chromium.net.CronetEngine.Builder.setLibraryLoader(org.chromium.net.CronetEngine.Builder.LibraryLoader)
|
||||
MissingGetterMatchingBuilder: org.chromium.net.CronetEngine.Builder#setStoragePath(String):
|
||||
org.chromium.net.CronetEngine does not declare a `getStoragePath()` method matching method org.chromium.net.CronetEngine.Builder.setStoragePath(String)
|
||||
MissingGetterMatchingBuilder: org.chromium.net.CronetEngine.Builder#setUserAgent(String):
|
||||
org.chromium.net.CronetEngine does not declare a `getUserAgent()` method matching method org.chromium.net.CronetEngine.Builder.setUserAgent(String)
|
||||
MissingGetterMatchingBuilder: org.chromium.net.UrlRequest.Builder#addHeader(String, String):
|
||||
org.chromium.net.UrlRequest does not declare a `getHeaders()` method matching method org.chromium.net.UrlRequest.Builder.addHeader(String,String)
|
||||
MissingGetterMatchingBuilder: org.chromium.net.UrlRequest.Builder#setHttpMethod(String):
|
||||
org.chromium.net.UrlRequest does not declare a `getHttpMethod()` method matching method org.chromium.net.UrlRequest.Builder.setHttpMethod(String)
|
||||
MissingGetterMatchingBuilder: org.chromium.net.UrlRequest.Builder#setPriority(int):
|
||||
org.chromium.net.UrlRequest does not declare a `getPriority()` method matching method org.chromium.net.UrlRequest.Builder.setPriority(int)
|
||||
MissingGetterMatchingBuilder: org.chromium.net.UrlRequest.Builder#setUploadDataProvider(org.chromium.net.UploadDataProvider, java.util.concurrent.Executor):
|
||||
org.chromium.net.UrlRequest does not declare a `getUploadDataProvider()` method matching method org.chromium.net.UrlRequest.Builder.setUploadDataProvider(org.chromium.net.UploadDataProvider,java.util.concurrent.Executor)
|
||||
|
||||
|
||||
MissingNullability: org.chromium.net.CallbackException#CallbackException(String, Throwable) parameter #0:
|
||||
Missing nullability on parameter `message` in method `CallbackException`
|
||||
MissingNullability: org.chromium.net.CallbackException#CallbackException(String, Throwable) parameter #1:
|
||||
Missing nullability on parameter `cause` in method `CallbackException`
|
||||
MissingNullability: org.chromium.net.CronetEngine#createURLStreamHandlerFactory():
|
||||
Missing nullability on method `createURLStreamHandlerFactory` return
|
||||
MissingNullability: org.chromium.net.CronetEngine#getGlobalMetricsDeltas():
|
||||
Missing nullability on method `getGlobalMetricsDeltas` return
|
||||
MissingNullability: org.chromium.net.CronetEngine#getVersionString():
|
||||
Missing nullability on method `getVersionString` return
|
||||
MissingNullability: org.chromium.net.CronetEngine#newUrlRequestBuilder(String, org.chromium.net.UrlRequest.Callback, java.util.concurrent.Executor):
|
||||
Missing nullability on method `newUrlRequestBuilder` return
|
||||
MissingNullability: org.chromium.net.CronetEngine#newUrlRequestBuilder(String, org.chromium.net.UrlRequest.Callback, java.util.concurrent.Executor) parameter #0:
|
||||
Missing nullability on parameter `url` in method `newUrlRequestBuilder`
|
||||
MissingNullability: org.chromium.net.CronetEngine#newUrlRequestBuilder(String, org.chromium.net.UrlRequest.Callback, java.util.concurrent.Executor) parameter #1:
|
||||
Missing nullability on parameter `callback` in method `newUrlRequestBuilder`
|
||||
MissingNullability: org.chromium.net.CronetEngine#newUrlRequestBuilder(String, org.chromium.net.UrlRequest.Callback, java.util.concurrent.Executor) parameter #2:
|
||||
Missing nullability on parameter `executor` in method `newUrlRequestBuilder`
|
||||
MissingNullability: org.chromium.net.CronetEngine#openConnection(java.net.URL):
|
||||
Missing nullability on method `openConnection` return
|
||||
MissingNullability: org.chromium.net.CronetEngine#openConnection(java.net.URL) parameter #0:
|
||||
Missing nullability on parameter `url` in method `openConnection`
|
||||
MissingNullability: org.chromium.net.CronetEngine#startNetLogToFile(String, boolean) parameter #0:
|
||||
Missing nullability on parameter `fileName` in method `startNetLogToFile`
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#Builder(android.content.Context) parameter #0:
|
||||
Missing nullability on parameter `context` in method `Builder`
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#addPublicKeyPins(String, java.util.Set<byte[]>, boolean, java.util.Date):
|
||||
Missing nullability on method `addPublicKeyPins` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#addPublicKeyPins(String, java.util.Set<byte[]>, boolean, java.util.Date) parameter #0:
|
||||
Missing nullability on parameter `hostName` in method `addPublicKeyPins`
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#addPublicKeyPins(String, java.util.Set<byte[]>, boolean, java.util.Date) parameter #1:
|
||||
Missing nullability on parameter `pinsSha256` in method `addPublicKeyPins`
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#addPublicKeyPins(String, java.util.Set<byte[]>, boolean, java.util.Date) parameter #3:
|
||||
Missing nullability on parameter `expirationDate` in method `addPublicKeyPins`
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#addQuicHint(String, int, int):
|
||||
Missing nullability on method `addQuicHint` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#addQuicHint(String, int, int) parameter #0:
|
||||
Missing nullability on parameter `host` in method `addQuicHint`
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#build():
|
||||
Missing nullability on method `build` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#enableBrotli(boolean):
|
||||
Missing nullability on method `enableBrotli` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#enableHttp2(boolean):
|
||||
Missing nullability on method `enableHttp2` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#enableHttpCache(int, long):
|
||||
Missing nullability on method `enableHttpCache` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#enablePublicKeyPinningBypassForLocalTrustAnchors(boolean):
|
||||
Missing nullability on method `enablePublicKeyPinningBypassForLocalTrustAnchors` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#enableQuic(boolean):
|
||||
Missing nullability on method `enableQuic` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#getDefaultUserAgent():
|
||||
Missing nullability on method `getDefaultUserAgent` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#setLibraryLoader(org.chromium.net.CronetEngine.Builder.LibraryLoader):
|
||||
Missing nullability on method `setLibraryLoader` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#setLibraryLoader(org.chromium.net.CronetEngine.Builder.LibraryLoader) parameter #0:
|
||||
Missing nullability on parameter `loader` in method `setLibraryLoader`
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#setStoragePath(String):
|
||||
Missing nullability on method `setStoragePath` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#setStoragePath(String) parameter #0:
|
||||
Missing nullability on parameter `value` in method `setStoragePath`
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#setUserAgent(String):
|
||||
Missing nullability on method `setUserAgent` return
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder#setUserAgent(String) parameter #0:
|
||||
Missing nullability on parameter `userAgent` in method `setUserAgent`
|
||||
MissingNullability: org.chromium.net.CronetEngine.Builder.LibraryLoader#loadLibrary(String) parameter #0:
|
||||
Missing nullability on parameter `libName` in method `loadLibrary`
|
||||
MissingNullability: org.chromium.net.CronetException#CronetException(String, Throwable) parameter #0:
|
||||
Missing nullability on parameter `message` in method `CronetException`
|
||||
MissingNullability: org.chromium.net.CronetException#CronetException(String, Throwable) parameter #1:
|
||||
Missing nullability on parameter `cause` in method `CronetException`
|
||||
MissingNullability: org.chromium.net.NetworkException#NetworkException(String, Throwable) parameter #0:
|
||||
Missing nullability on parameter `message` in method `NetworkException`
|
||||
MissingNullability: org.chromium.net.NetworkException#NetworkException(String, Throwable) parameter #1:
|
||||
Missing nullability on parameter `cause` in method `NetworkException`
|
||||
MissingNullability: org.chromium.net.QuicException#QuicException(String, Throwable) parameter #0:
|
||||
Missing nullability on parameter `message` in method `QuicException`
|
||||
MissingNullability: org.chromium.net.QuicException#QuicException(String, Throwable) parameter #1:
|
||||
Missing nullability on parameter `cause` in method `QuicException`
|
||||
MissingNullability: org.chromium.net.UploadDataProvider#read(org.chromium.net.UploadDataSink, java.nio.ByteBuffer) parameter #0:
|
||||
Missing nullability on parameter `uploadDataSink` in method `read`
|
||||
MissingNullability: org.chromium.net.UploadDataProvider#read(org.chromium.net.UploadDataSink, java.nio.ByteBuffer) parameter #1:
|
||||
Missing nullability on parameter `byteBuffer` in method `read`
|
||||
MissingNullability: org.chromium.net.UploadDataProvider#rewind(org.chromium.net.UploadDataSink) parameter #0:
|
||||
Missing nullability on parameter `uploadDataSink` in method `rewind`
|
||||
MissingNullability: org.chromium.net.UploadDataProviders#create(android.os.ParcelFileDescriptor):
|
||||
Missing nullability on method `create` return
|
||||
MissingNullability: org.chromium.net.UploadDataProviders#create(android.os.ParcelFileDescriptor) parameter #0:
|
||||
Missing nullability on parameter `fd` in method `create`
|
||||
MissingNullability: org.chromium.net.UploadDataProviders#create(byte[]):
|
||||
Missing nullability on method `create` return
|
||||
MissingNullability: org.chromium.net.UploadDataProviders#create(byte[]) parameter #0:
|
||||
Missing nullability on parameter `data` in method `create`
|
||||
MissingNullability: org.chromium.net.UploadDataProviders#create(byte[], int, int):
|
||||
Missing nullability on method `create` return
|
||||
MissingNullability: org.chromium.net.UploadDataProviders#create(byte[], int, int) parameter #0:
|
||||
Missing nullability on parameter `data` in method `create`
|
||||
MissingNullability: org.chromium.net.UploadDataProviders#create(java.io.File):
|
||||
Missing nullability on method `create` return
|
||||
MissingNullability: org.chromium.net.UploadDataProviders#create(java.io.File) parameter #0:
|
||||
Missing nullability on parameter `file` in method `create`
|
||||
MissingNullability: org.chromium.net.UploadDataProviders#create(java.nio.ByteBuffer):
|
||||
Missing nullability on method `create` return
|
||||
MissingNullability: org.chromium.net.UploadDataProviders#create(java.nio.ByteBuffer) parameter #0:
|
||||
Missing nullability on parameter `buffer` in method `create`
|
||||
MissingNullability: org.chromium.net.UploadDataSink#onReadError(Exception) parameter #0:
|
||||
Missing nullability on parameter `exception` in method `onReadError`
|
||||
MissingNullability: org.chromium.net.UploadDataSink#onRewindError(Exception) parameter #0:
|
||||
Missing nullability on parameter `exception` in method `onRewindError`
|
||||
MissingNullability: org.chromium.net.UrlRequest#getStatus(org.chromium.net.UrlRequest.StatusListener) parameter #0:
|
||||
Missing nullability on parameter `listener` in method `getStatus`
|
||||
MissingNullability: org.chromium.net.UrlRequest#read(java.nio.ByteBuffer) parameter #0:
|
||||
Missing nullability on parameter `buffer` in method `read`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#addHeader(String, String):
|
||||
Missing nullability on method `addHeader` return
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#addHeader(String, String) parameter #0:
|
||||
Missing nullability on parameter `header` in method `addHeader`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#addHeader(String, String) parameter #1:
|
||||
Missing nullability on parameter `value` in method `addHeader`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#allowDirectExecutor():
|
||||
Missing nullability on method `allowDirectExecutor` return
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#build():
|
||||
Missing nullability on method `build` return
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#disableCache():
|
||||
Missing nullability on method `disableCache` return
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#setHttpMethod(String):
|
||||
Missing nullability on method `setHttpMethod` return
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#setHttpMethod(String) parameter #0:
|
||||
Missing nullability on parameter `method` in method `setHttpMethod`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#setPriority(int):
|
||||
Missing nullability on method `setPriority` return
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#setUploadDataProvider(org.chromium.net.UploadDataProvider, java.util.concurrent.Executor):
|
||||
Missing nullability on method `setUploadDataProvider` return
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#setUploadDataProvider(org.chromium.net.UploadDataProvider, java.util.concurrent.Executor) parameter #0:
|
||||
Missing nullability on parameter `uploadDataProvider` in method `setUploadDataProvider`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Builder#setUploadDataProvider(org.chromium.net.UploadDataProvider, java.util.concurrent.Executor) parameter #1:
|
||||
Missing nullability on parameter `executor` in method `setUploadDataProvider`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onCanceled(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo) parameter #0:
|
||||
Missing nullability on parameter `request` in method `onCanceled`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onCanceled(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo) parameter #1:
|
||||
Missing nullability on parameter `info` in method `onCanceled`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onFailed(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, org.chromium.net.CronetException) parameter #0:
|
||||
Missing nullability on parameter `request` in method `onFailed`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onFailed(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, org.chromium.net.CronetException) parameter #1:
|
||||
Missing nullability on parameter `info` in method `onFailed`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onFailed(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, org.chromium.net.CronetException) parameter #2:
|
||||
Missing nullability on parameter `error` in method `onFailed`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onReadCompleted(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, java.nio.ByteBuffer) parameter #0:
|
||||
Missing nullability on parameter `request` in method `onReadCompleted`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onReadCompleted(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, java.nio.ByteBuffer) parameter #1:
|
||||
Missing nullability on parameter `info` in method `onReadCompleted`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onReadCompleted(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, java.nio.ByteBuffer) parameter #2:
|
||||
Missing nullability on parameter `byteBuffer` in method `onReadCompleted`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onRedirectReceived(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, String) parameter #0:
|
||||
Missing nullability on parameter `request` in method `onRedirectReceived`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onRedirectReceived(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, String) parameter #1:
|
||||
Missing nullability on parameter `info` in method `onRedirectReceived`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onRedirectReceived(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo, String) parameter #2:
|
||||
Missing nullability on parameter `newLocationUrl` in method `onRedirectReceived`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onResponseStarted(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo) parameter #0:
|
||||
Missing nullability on parameter `request` in method `onResponseStarted`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onResponseStarted(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo) parameter #1:
|
||||
Missing nullability on parameter `info` in method `onResponseStarted`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onSucceeded(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo) parameter #0:
|
||||
Missing nullability on parameter `request` in method `onSucceeded`
|
||||
MissingNullability: org.chromium.net.UrlRequest.Callback#onSucceeded(org.chromium.net.UrlRequest, org.chromium.net.UrlResponseInfo) parameter #1:
|
||||
Missing nullability on parameter `info` in method `onSucceeded`
|
||||
MissingNullability: org.chromium.net.UrlResponseInfo#getAllHeaders():
|
||||
Missing nullability on method `getAllHeaders` return
|
||||
MissingNullability: org.chromium.net.UrlResponseInfo#getAllHeadersAsList():
|
||||
Missing nullability on method `getAllHeadersAsList` return
|
||||
MissingNullability: org.chromium.net.UrlResponseInfo#getHttpStatusText():
|
||||
Missing nullability on method `getHttpStatusText` return
|
||||
MissingNullability: org.chromium.net.UrlResponseInfo#getNegotiatedProtocol():
|
||||
Missing nullability on method `getNegotiatedProtocol` return
|
||||
MissingNullability: org.chromium.net.UrlResponseInfo#getProxyServer():
|
||||
Missing nullability on method `getProxyServer` return
|
||||
MissingNullability: org.chromium.net.UrlResponseInfo#getUrl():
|
||||
Missing nullability on method `getUrl` return
|
||||
MissingNullability: org.chromium.net.UrlResponseInfo#getUrlChain():
|
||||
Missing nullability on method `getUrlChain` return
|
||||
|
||||
|
||||
NotCloseable: org.chromium.net.CronetEngine:
|
||||
Classes that release resources (shutdown()) should implement AutoClosable and CloseGuard: class org.chromium.net.CronetEngine
|
||||
|
||||
|
||||
StaticFinalBuilder: org.chromium.net.CronetEngine.Builder:
|
||||
Builder must be final: org.chromium.net.CronetEngine.Builder
|
||||
StaticFinalBuilder: org.chromium.net.UrlRequest.Builder:
|
||||
Builder must be final: org.chromium.net.UrlRequest.Builder
|
|
@ -0,0 +1 @@
|
|||
// Signature format: 2.0
|
|
@ -0,0 +1 @@
|
|||
// Signature format: 2.0
|
|
@ -0,0 +1 @@
|
|||
// Signature format: 2.0
|
|
@ -0,0 +1 @@
|
|||
// Signature format: 2.0
|
|
@ -0,0 +1 @@
|
|||
// Signature format: 2.0
|
|
@ -0,0 +1,4 @@
|
|||
MAJOR=80
|
||||
MINOR=0
|
||||
BUILD=3986
|
||||
PATCH=0
|
|
@ -0,0 +1 @@
|
|||
12
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,46 @@
|
|||
//
|
||||
// Copyright (C) 2019 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
package {
|
||||
default_applicable_licenses: ["Android-Apache-2.0"],
|
||||
}
|
||||
|
||||
java_library {
|
||||
name: "CronetApiCommonTests",
|
||||
srcs: ["src/**/*.java"],
|
||||
static_libs: [
|
||||
"androidx.test.rules",
|
||||
"androidx.core_core",
|
||||
"junit",
|
||||
],
|
||||
libs: [
|
||||
"android.test.runner",
|
||||
"android.test.base",
|
||||
"android.test.mock",
|
||||
"androidx.annotation_annotation",
|
||||
"org.chromium.net.cronet.stubs",
|
||||
],
|
||||
}
|
||||
|
||||
android_test {
|
||||
name: "CronetApiTest",
|
||||
platform_apis: true,
|
||||
test_suites: ["device-tests"],
|
||||
certificate: "platform",
|
||||
static_libs: [
|
||||
"CronetApiCommonTests",
|
||||
],
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
-->
|
||||
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.chromium.net.test">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET"/>
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
|
||||
<application>
|
||||
<uses-library android:name="android.test.runner" />
|
||||
<uses-library android:name="org.chromium.net.cronet" />
|
||||
</application>
|
||||
|
||||
<instrumentation
|
||||
android:name="androidx.test.runner.AndroidJUnitRunner"
|
||||
android:targetPackage="org.chromium.net.test"
|
||||
android:label="Cronet API Networking Tests" />
|
||||
</manifest>
|
|
@ -0,0 +1,144 @@
|
|||
/*
|
||||
* Copyright (C) 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chromium.net.test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.test.platform.app.InstrumentationRegistry;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.Random;
|
||||
|
||||
import org.chromium.net.CronetEngine;
|
||||
import org.chromium.net.CronetException;
|
||||
import org.chromium.net.UrlRequest;
|
||||
import org.chromium.net.UrlResponseInfo;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class CronetApiTest {
|
||||
private static final String TAG = CronetApiTest.class.getSimpleName();
|
||||
static final String HTTPS_PREFIX = "https://";
|
||||
static final int TIMEOUT_MS = 12_000;
|
||||
|
||||
private final String[] mTestDomains = {"www.google.com", "www.android.com"};
|
||||
@NonNull
|
||||
private CronetEngine mCronetEngine;
|
||||
@NonNull
|
||||
private ConnectivityManager mCm;
|
||||
@NonNull
|
||||
private Executor mExecutor;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
Context context = InstrumentationRegistry.getInstrumentation().getContext();
|
||||
mCm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
CronetEngine.Builder builder = new CronetEngine.Builder(context);
|
||||
builder.enableHttpCache(CronetEngine.Builder.HTTP_CACHE_IN_MEMORY, 100 * 1024)
|
||||
.enableHttp2(true)
|
||||
//.enableBrotli(true)
|
||||
.enableQuic(true);
|
||||
mCronetEngine = builder.build();
|
||||
mExecutor = new Handler(Looper.getMainLooper())::post;
|
||||
}
|
||||
|
||||
static private void assertGreaterThan(String msg, int first, int second) {
|
||||
assertTrue(msg + " Excepted " + first + " to be greater than " + second, first > second);
|
||||
}
|
||||
|
||||
private void assertHasTestableNetworks() {
|
||||
assertNotNull("This test requires a working Internet connection",
|
||||
mCm.getActiveNetwork());
|
||||
}
|
||||
|
||||
private String getRandomDomain() {
|
||||
int index = (new Random()).nextInt(mTestDomains.length);
|
||||
return mTestDomains[index];
|
||||
}
|
||||
|
||||
class VerifyUrlRequestCallback extends UrlRequest.Callback {
|
||||
private final CountDownLatch mLatch = new CountDownLatch(1);
|
||||
private final String mUrl;
|
||||
|
||||
VerifyUrlRequestCallback(@NonNull String url) {
|
||||
this.mUrl = url;
|
||||
}
|
||||
|
||||
public boolean waitForAnswer() throws InterruptedException {
|
||||
return mLatch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRedirectReceived(
|
||||
UrlRequest request, UrlResponseInfo info, String newLocationUrl) {
|
||||
request.followRedirect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponseStarted(UrlRequest request, UrlResponseInfo info) {
|
||||
request.read(ByteBuffer.allocateDirect(32 * 1024));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReadCompleted(
|
||||
UrlRequest request, UrlResponseInfo info, ByteBuffer byteBuffer) {
|
||||
byteBuffer.clear();
|
||||
request.read(byteBuffer);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onSucceeded(UrlRequest request, UrlResponseInfo info) {
|
||||
assertEquals("Unexpected http status code from " + mUrl + ".",
|
||||
200, info.getHttpStatusCode());
|
||||
assertGreaterThan("Received byte from " + mUrl + " is 0.",
|
||||
(int)info.getReceivedByteCount(), 0);
|
||||
mLatch.countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailed(UrlRequest request, UrlResponseInfo info, CronetException error) {
|
||||
fail(mUrl + error.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUrlGet() throws Exception {
|
||||
assertHasTestableNetworks();
|
||||
String url = HTTPS_PREFIX + getRandomDomain();
|
||||
VerifyUrlRequestCallback callback = new VerifyUrlRequestCallback(url);
|
||||
UrlRequest.Builder builder = mCronetEngine.newUrlRequestBuilder(url, callback, mExecutor);
|
||||
builder.build().start();
|
||||
assertTrue(url + " but not complete after " + TIMEOUT_MS + "ms.",
|
||||
callback.waitForAnswer());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue