From 5023143dcfa8478ea1eb33457613beca3ca78164 Mon Sep 17 00:00:00 2001 From: Mohannad Farrag Date: Fri, 22 Nov 2024 07:50:30 +0000 Subject: [PATCH] Add a new module-only API to preload HttpEngine This is supposed to be used only from the Zygote during the initialization phase to preload HttpEngine. Currently, the implementation only preloads a single class which is used to initialize the backend for HttpEngine. Bug: 380349437 Change-Id: If3ebcb37e51104a69473491e9f230d1b043c7bd0 --- framework/Android.bp | 2 ++ framework/api/module-lib-current.txt | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/framework/Android.bp b/framework/Android.bp index 0334e11c82..4353213460 100644 --- a/framework/Android.bp +++ b/framework/Android.bp @@ -156,6 +156,7 @@ java_library { java_defaults { name: "CronetJavaDefaults", srcs: [":httpclient_api_sources"], + static_libs: ["com.android.net.http.flags-aconfig-java"], libs: [ "androidx.annotation_annotation", ], @@ -212,6 +213,7 @@ java_sdk_library { }, aconfig_declarations: [ "com.android.net.flags-aconfig", + "com.android.net.http.flags-aconfig", "com.android.networksecurity.flags-aconfig", ], } diff --git a/framework/api/module-lib-current.txt b/framework/api/module-lib-current.txt index cd7307f725..0129e5c73d 100644 --- a/framework/api/module-lib-current.txt +++ b/framework/api/module-lib-current.txt @@ -247,3 +247,11 @@ package android.net { } +package android.net.http { + + public abstract class HttpEngine { + method @FlaggedApi("android.net.http.preload_httpengine_in_zygote") public static void preload(); + } + +} +