From 3b9ba6acdfcb57928938a4fceae24b2a05727ee7 Mon Sep 17 00:00:00 2001
From: Patrick Rohr <prohr@google.com>
Date: Thu, 5 Jan 2023 22:50:58 -0800
Subject: [PATCH] cronet: add defaults to enable / disable Cronet in
 framework-tethering

A similar option already exists in
packages/modules/Connectivity/Cronet/apex/Android.bp. This is in
preparation of adding cronet to framework-tethering. It is possible that
we only end up using one of the variables but better safe than sorry.

This change will be blocked by the blocked automerger into
tm-mainline-prod. If this continues to be a problem, we might have to
play some tricks with automerger.

Test: TH
Change-Id: I40ba22aba041ec12ec2bf2881df14e6c0ee53b44
---
 Tethering/common/TetheringLib/Android.bp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Tethering/common/TetheringLib/Android.bp b/Tethering/common/TetheringLib/Android.bp
index 481557b863..6a990eeee2 100644
--- a/Tethering/common/TetheringLib/Android.bp
+++ b/Tethering/common/TetheringLib/Android.bp
@@ -17,6 +17,18 @@ package {
     default_applicable_licenses: ["Android-Apache-2.0"],
 }
 
+// TODO: This is currently not used, but is being merged early, so Cronet can be disabled in
+// tm-mainline-prod.
+// Both cronet_java_defaults and cronet_java_prejarjar_defaults can be used to
+// specify a java_defaults target that either enables or disables Cronet. This
+// is used to disable Cronet on tm-mainline-prod.
+// Note: they must either both be enabled or disabled.
+cronet_java_defaults = "CronetJavaDefaultsDisabled"
+cronet_java_prejarjar_defaults = "CronetJavaPrejarjarDefaultsDisabled"
+// This is a placeholder comment to avoid merge conflicts
+// as cronet_defaults may have different values
+// depending on the branch
+
 java_sdk_library {
     name: "framework-tethering",
     defaults: ["framework-module-defaults"],
-- 
GitLab