Merge changes I0f8e6590,I61a1bb91

* changes:
  Add MdnsAnyRecord
  Add constructors to MDNS records
diff --git a/Tethering/src/com/android/networkstack/tethering/Tethering.java b/Tethering/src/com/android/networkstack/tethering/Tethering.java
index 1f3fc11..c2cf92c 100644
--- a/Tethering/src/com/android/networkstack/tethering/Tethering.java
+++ b/Tethering/src/com/android/networkstack/tethering/Tethering.java
@@ -477,17 +477,10 @@
             wifiManager.registerSoftApCallback(mExecutor, softApCallback);
         }
         if (SdkLevel.isAtLeastT() && wifiManager != null) {
-            try {
-                // Although WifiManager#registerLocalOnlyHotspotSoftApCallback document that it need
-                // NEARBY_WIFI_DEVICES permission, but actually a caller who have NETWORK_STACK
-                // or MAINLINE_NETWORK_STACK permission would also able to use this API.
-                wifiManager.registerLocalOnlyHotspotSoftApCallback(mExecutor, softApCallback);
-            } catch (UnsupportedOperationException e) {
-                // Since wifi module development in internal branch,
-                // #registerLocalOnlyHotspotSoftApCallback currently doesn't supported in AOSP
-                // before AOSP switch to Android T + 1.
-                Log.wtf(TAG, "registerLocalOnlyHotspotSoftApCallback API is not supported");
-            }
+            // Although WifiManager#registerLocalOnlyHotspotSoftApCallback document that it need
+            // NEARBY_WIFI_DEVICES permission, but actually a caller who have NETWORK_STACK
+            // or MAINLINE_NETWORK_STACK permission would also able to use this API.
+            wifiManager.registerLocalOnlyHotspotSoftApCallback(mExecutor, softApCallback);
         }
 
         startTrackDefaultNetwork();
diff --git a/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java b/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java
index 8ef5d71..903de9d 100644
--- a/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java
+++ b/Tethering/src/com/android/networkstack/tethering/TetheringConfiguration.java
@@ -22,6 +22,7 @@
 import static android.net.ConnectivityManager.TYPE_MOBILE_DUN;
 import static android.net.ConnectivityManager.TYPE_MOBILE_HIPRI;
 import static android.provider.DeviceConfig.NAMESPACE_CONNECTIVITY;
+import static android.provider.DeviceConfig.NAMESPACE_TETHERING;
 
 import static com.android.net.module.util.DeviceConfigUtils.TETHERING_MODULE_NAME;
 import static com.android.networkstack.apishim.ConstantsShim.KEY_CARRIER_SUPPORTS_TETHERING_BOOL;
@@ -193,8 +194,13 @@
 
         isDunRequired = checkDunRequired(ctx);
 
-        final boolean forceAutomaticUpstream = !SdkLevel.isAtLeastS()
-                && isFeatureEnabled(ctx, TETHER_FORCE_UPSTREAM_AUTOMATIC_VERSION);
+        // Here is how automatic mode enable/disable support on different Android version:
+        // - R   : can be enabled/disabled by resource config_tether_upstream_automatic.
+        //         but can be force-enabled by flag TETHER_FORCE_UPSTREAM_AUTOMATIC_VERSION.
+        // - S, T: can be enabled/disabled by resource config_tether_upstream_automatic.
+        // - U+  : automatic mode only.
+        final boolean forceAutomaticUpstream = SdkLevel.isAtLeastU() || (!SdkLevel.isAtLeastS()
+                && isConnectivityFeatureEnabled(ctx, TETHER_FORCE_UPSTREAM_AUTOMATIC_VERSION));
         chooseUpstreamAutomatically = forceAutomaticUpstream || getResourceBoolean(
                 res, R.bool.config_tether_upstream_automatic, false /** defaultValue */);
         preferredUpstreamIfaceTypes = getUpstreamIfaceTypes(res, isDunRequired);
@@ -565,9 +571,23 @@
         return DeviceConfig.getProperty(NAMESPACE_CONNECTIVITY, name);
     }
 
+    /**
+     * This is deprecated because connectivity namespace already be used for NetworkStack mainline
+     * module. Tethering should use its own namespace to roll out the feature flag.
+     * @deprecated new caller should use isTetheringFeatureEnabled instead.
+     */
+    @Deprecated
+    private boolean isConnectivityFeatureEnabled(Context ctx, String featureVersionFlag) {
+        return isFeatureEnabled(ctx, NAMESPACE_CONNECTIVITY, featureVersionFlag);
+    }
+
+    private boolean isTetheringFeatureEnabled(Context ctx, String featureVersionFlag) {
+        return isFeatureEnabled(ctx, NAMESPACE_TETHERING, featureVersionFlag);
+    }
+
     @VisibleForTesting
-    protected boolean isFeatureEnabled(Context ctx, String featureVersionFlag) {
-        return DeviceConfigUtils.isFeatureEnabled(ctx, NAMESPACE_CONNECTIVITY, featureVersionFlag,
+    protected boolean isFeatureEnabled(Context ctx, String namespace, String featureVersionFlag) {
+        return DeviceConfigUtils.isFeatureEnabled(ctx, namespace, featureVersionFlag,
                 TETHERING_MODULE_NAME, false /* defaultEnabled */);
     }
 
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/FakeTetheringConfiguration.java b/Tethering/tests/unit/src/com/android/networkstack/tethering/FakeTetheringConfiguration.java
index 95ec38f..0d686ed 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/FakeTetheringConfiguration.java
+++ b/Tethering/tests/unit/src/com/android/networkstack/tethering/FakeTetheringConfiguration.java
@@ -33,7 +33,7 @@
     }
 
     @Override
-    protected boolean isFeatureEnabled(Context ctx, String featureVersionFlag) {
+    protected boolean isFeatureEnabled(Context ctx, String namespace, String featureVersionFlag) {
         return false;
     }
 
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java
index 1a12125..f662c02 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java
+++ b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringConfigurationTest.java
@@ -545,7 +545,8 @@
         assertTrue(testCfg.shouldEnableWifiP2pDedicatedIp());
     }
 
-    @Test
+    // The config only works on T-
+    @Test @IgnoreAfter(Build.VERSION_CODES.TIRAMISU)
     public void testChooseUpstreamAutomatically() throws Exception {
         when(mResources.getBoolean(R.bool.config_tether_upstream_automatic))
                 .thenReturn(true);
@@ -556,6 +557,20 @@
         assertChooseUpstreamAutomaticallyIs(false);
     }
 
+    // The automatic mode is always enabled on U+
+    @Test @IgnoreUpTo(Build.VERSION_CODES.TIRAMISU)
+    public void testChooseUpstreamAutomaticallyAfterT() throws Exception {
+        // Expect that automatic mode is always enabled no matter what
+        // config_tether_upstream_automatic is.
+        when(mResources.getBoolean(R.bool.config_tether_upstream_automatic))
+                .thenReturn(true);
+        assertChooseUpstreamAutomaticallyIs(true);
+
+        when(mResources.getBoolean(R.bool.config_tether_upstream_automatic))
+                .thenReturn(false);
+        assertChooseUpstreamAutomaticallyIs(true);
+    }
+
     // The flag override only works on R-
     @Test @IgnoreAfter(Build.VERSION_CODES.R)
     public void testChooseUpstreamAutomatically_FlagOverride() throws Exception {
@@ -574,14 +589,34 @@
         assertChooseUpstreamAutomaticallyIs(false);
     }
 
-    @Test @IgnoreUpTo(Build.VERSION_CODES.R)
-    public void testChooseUpstreamAutomatically_FlagOverrideAfterR() throws Exception {
+    @Test @IgnoreUpTo(Build.VERSION_CODES.R) @IgnoreAfter(Build.VERSION_CODES.TIRAMISU)
+    public void testChooseUpstreamAutomatically_FlagOverrideOnSAndT() throws Exception {
         when(mResources.getBoolean(R.bool.config_tether_upstream_automatic))
                 .thenReturn(false);
         setTetherForceUpstreamAutomaticFlagVersion(TEST_PACKAGE_VERSION - 1);
         assertChooseUpstreamAutomaticallyIs(false);
     }
 
+    // The automatic mode is always enabled on U+
+    @Test @IgnoreUpTo(Build.VERSION_CODES.TIRAMISU)
+    public void testChooseUpstreamAutomatically_FlagOverrideAfterT() throws Exception {
+        // Expect that automatic mode is always enabled no matter what
+        // TETHER_FORCE_UPSTREAM_AUTOMATIC_VERSION is.
+        when(mResources.getBoolean(R.bool.config_tether_upstream_automatic))
+                .thenReturn(false);
+        setTetherForceUpstreamAutomaticFlagVersion(TEST_PACKAGE_VERSION - 1);
+        assertTrue(DeviceConfigUtils.isFeatureEnabled(mMockContext, NAMESPACE_CONNECTIVITY,
+                TetheringConfiguration.TETHER_FORCE_UPSTREAM_AUTOMATIC_VERSION, APEX_NAME, false));
+
+        assertChooseUpstreamAutomaticallyIs(true);
+
+        setTetherForceUpstreamAutomaticFlagVersion(0L);
+        assertChooseUpstreamAutomaticallyIs(true);
+
+        setTetherForceUpstreamAutomaticFlagVersion(Long.MAX_VALUE);
+        assertChooseUpstreamAutomaticallyIs(true);
+    }
+
     private void setTetherForceUpstreamAutomaticFlagVersion(Long version) {
         doReturn(version == null ? null : Long.toString(version)).when(
                 () -> DeviceConfig.getProperty(eq(NAMESPACE_CONNECTIVITY),
diff --git a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java
index 9337b1a..a8d886b 100644
--- a/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java
+++ b/Tethering/tests/unit/src/com/android/networkstack/tethering/TetheringTest.java
@@ -196,6 +196,7 @@
 import com.android.networkstack.tethering.TestConnectivityManager.TestNetworkAgent;
 import com.android.networkstack.tethering.metrics.TetheringMetrics;
 import com.android.testutils.DevSdkIgnoreRule;
+import com.android.testutils.DevSdkIgnoreRule.IgnoreAfter;
 import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo;
 import com.android.testutils.MiscAsserts;
 
@@ -1212,13 +1213,12 @@
         inOrder.verify(mUpstreamNetworkMonitor).setCurrentUpstream(wifi.networkId);
     }
 
-    @Test
-    public void testAutomaticUpstreamSelection() throws Exception {
+    private void verifyAutomaticUpstreamSelection(boolean configAutomatic) throws Exception {
         TestNetworkAgent mobile = new TestNetworkAgent(mCm, buildMobileDualStackUpstreamState());
         TestNetworkAgent wifi = new TestNetworkAgent(mCm, buildWifiUpstreamState());
         InOrder inOrder = inOrder(mCm, mUpstreamNetworkMonitor);
         // Enable automatic upstream selection.
-        upstreamSelectionTestCommon(true, inOrder, mobile, wifi);
+        upstreamSelectionTestCommon(configAutomatic, inOrder, mobile, wifi);
 
         // This code has historically been racy, so test different orderings of CONNECTIVITY_ACTION
         // broadcasts and callbacks, and add mLooper.dispatchAll() calls between the two.
@@ -1298,6 +1298,20 @@
     }
 
     @Test
+    public void testAutomaticUpstreamSelection() throws Exception {
+        verifyAutomaticUpstreamSelection(true /* configAutomatic */);
+    }
+
+    @Test
+    @IgnoreUpTo(Build.VERSION_CODES.TIRAMISU)
+    public void testAutomaticUpstreamSelectionWithConfigDisabled() throws Exception {
+        // Expect that automatic config can't disable the automatic mode because automatic mode
+        // is always enabled on U+ device.
+        verifyAutomaticUpstreamSelection(false /* configAutomatic */);
+    }
+
+    @Test
+    @IgnoreAfter(Build.VERSION_CODES.TIRAMISU)
     public void testLegacyUpstreamSelection() throws Exception {
         TestNetworkAgent mobile = new TestNetworkAgent(mCm, buildMobileDualStackUpstreamState());
         TestNetworkAgent wifi = new TestNetworkAgent(mCm, buildWifiUpstreamState());
@@ -1323,14 +1337,13 @@
         verifyDisableTryCellWhenTetheringStop(inOrder);
     }
 
-    @Test
-    public void testChooseDunUpstreamByAutomaticMode() throws Exception {
+    private void verifyChooseDunUpstreamByAutomaticMode(boolean configAutomatic) throws Exception {
         // Enable automatic upstream selection.
         TestNetworkAgent mobile = new TestNetworkAgent(mCm, buildMobileDualStackUpstreamState());
         TestNetworkAgent wifi = new TestNetworkAgent(mCm, buildWifiUpstreamState());
         TestNetworkAgent dun = new TestNetworkAgent(mCm, buildDunUpstreamState());
         InOrder inOrder = inOrder(mCm, mUpstreamNetworkMonitor);
-        chooseDunUpstreamTestCommon(true, inOrder, mobile, wifi, dun);
+        chooseDunUpstreamTestCommon(configAutomatic, inOrder, mobile, wifi, dun);
 
         // When default network switch to mobile and wifi is connected (may have low signal),
         // automatic mode would request dun again and choose it as upstream.
@@ -1359,6 +1372,18 @@
     }
 
     @Test
+    public void testChooseDunUpstreamByAutomaticMode() throws Exception {
+        verifyChooseDunUpstreamByAutomaticMode(true /* configAutomatic */);
+    }
+
+    @Test
+    @IgnoreUpTo(Build.VERSION_CODES.TIRAMISU)
+    public void testChooseDunUpstreamByAutomaticModeWithConfigDisabled() throws Exception {
+        verifyChooseDunUpstreamByAutomaticMode(false /* configAutomatic */);
+    }
+
+    @Test
+    @IgnoreAfter(Build.VERSION_CODES.TIRAMISU)
     public void testChooseDunUpstreamByLegacyMode() throws Exception {
         // Enable Legacy upstream selection.
         TestNetworkAgent mobile = new TestNetworkAgent(mCm, buildMobileDualStackUpstreamState());
diff --git a/framework/api/module-lib-current.txt b/framework/api/module-lib-current.txt
index 073cca2..752c347 100644
--- a/framework/api/module-lib-current.txt
+++ b/framework/api/module-lib-current.txt
@@ -228,13 +228,9 @@
   }
 
   public final class VpnTransportInfo implements android.os.Parcelable android.net.TransportInfo {
-    ctor public VpnTransportInfo(int, @Nullable String);
-    method public int describeContents();
+    ctor @Deprecated public VpnTransportInfo(int, @Nullable String);
     method @Nullable public String getSessionId();
-    method public int getType();
     method @NonNull public android.net.VpnTransportInfo makeCopy(long);
-    method public void writeToParcel(@NonNull android.os.Parcel, int);
-    field @NonNull public static final android.os.Parcelable.Creator<android.net.VpnTransportInfo> CREATOR;
   }
 
 }
diff --git a/framework/api/system-current.txt b/framework/api/system-current.txt
index 8b35197..c7872a0 100644
--- a/framework/api/system-current.txt
+++ b/framework/api/system-current.txt
@@ -511,6 +511,15 @@
     field @NonNull public static final android.os.Parcelable.Creator<android.net.TcpKeepalivePacketData> CREATOR;
   }
 
+  public final class VpnTransportInfo implements android.os.Parcelable android.net.TransportInfo {
+    ctor public VpnTransportInfo(int, @Nullable String, boolean);
+    method public int describeContents();
+    method public boolean getBypassable();
+    method public int getType();
+    method public void writeToParcel(@NonNull android.os.Parcel, int);
+    field @NonNull public static final android.os.Parcelable.Creator<android.net.VpnTransportInfo> CREATOR;
+  }
+
 }
 
 package android.net.apf {
diff --git a/framework/src/android/net/VpnTransportInfo.java b/framework/src/android/net/VpnTransportInfo.java
index 4071c9a..ebad477 100644
--- a/framework/src/android/net/VpnTransportInfo.java
+++ b/framework/src/android/net/VpnTransportInfo.java
@@ -17,6 +17,7 @@
 package android.net;
 
 import static android.annotation.SystemApi.Client.MODULE_LIBRARIES;
+import static android.annotation.SystemApi.Client.PRIVILEGED_APPS;
 import static android.net.NetworkCapabilities.REDACT_FOR_NETWORK_SETTINGS;
 
 import android.annotation.NonNull;
@@ -27,6 +28,10 @@
 import android.os.Parcelable;
 import android.text.TextUtils;
 
+import androidx.annotation.RequiresApi;
+
+import com.android.modules.utils.build.SdkLevel;
+
 import java.util.Objects;
 
 /**
@@ -37,7 +42,7 @@
  *
  * @hide
  */
-@SystemApi(client = MODULE_LIBRARIES)
+@SystemApi(client = PRIVILEGED_APPS)
 public final class VpnTransportInfo implements TransportInfo, Parcelable {
     /** Type of this VPN. */
     private final int mType;
@@ -45,6 +50,13 @@
     @Nullable
     private final String mSessionId;
 
+    private final boolean mBypassable;
+
+    // TODO: Refer to Build.VERSION_CODES when it's available in every branch.
+    private static final int UPSIDE_DOWN_CAKE = 34;
+
+    /** @hide */
+    @SystemApi(client = MODULE_LIBRARIES)
     @Override
     public @RedactionType long getApplicableRedactions() {
         return REDACT_FOR_NETWORK_SETTINGS;
@@ -52,21 +64,58 @@
 
     /**
      * Create a copy of a {@link VpnTransportInfo} with the sessionId redacted if necessary.
+     * @hide
      */
     @NonNull
+    @SystemApi(client = MODULE_LIBRARIES)
     public VpnTransportInfo makeCopy(@RedactionType long redactions) {
         return new VpnTransportInfo(mType,
-            ((redactions & REDACT_FOR_NETWORK_SETTINGS) != 0) ? null : mSessionId);
+            ((redactions & REDACT_FOR_NETWORK_SETTINGS) != 0) ? null : mSessionId, mBypassable);
     }
 
+    /**
+     * @deprecated please use {@link VpnTransportInfo(int,String,boolean)} instead.
+     * @hide
+     */
+    @Deprecated
+    @SystemApi(client = MODULE_LIBRARIES)
     public VpnTransportInfo(int type, @Nullable String sessionId) {
+        // When the module runs on older SDKs, |bypassable| will always be false since the old Vpn
+        // code will call this constructor. For Settings VPNs, this is always correct as they are
+        // never bypassable. For VpnManager and VpnService types, this may be wrong since both of
+        // them have a choice. However, on these SDKs VpnTransportInfo#getBypassable is not
+        // available anyway, so this should be harmless. False is a better choice than true here
+        // regardless because it is the default value for both VpnManager and VpnService if the app
+        // does not do anything about it.
+        this(type, sessionId, false /* bypassable */);
+    }
+
+    public VpnTransportInfo(int type, @Nullable String sessionId, boolean bypassable) {
         this.mType = type;
         this.mSessionId = sessionId;
+        this.mBypassable = bypassable;
+    }
+
+    /**
+     * Returns whether the VPN is allowing bypass.
+     *
+     * This method is not supported in SDK below U, and will throw
+     * {@code UnsupportedOperationException} if called.
+     */
+    @RequiresApi(UPSIDE_DOWN_CAKE)
+    public boolean getBypassable() {
+        if (!SdkLevel.isAtLeastU()) {
+            throw new UnsupportedOperationException("Not supported before U");
+        }
+
+        return mBypassable;
     }
 
     /**
      * Returns the session Id of this VpnTransportInfo.
+     * @hide
      */
+    @SystemApi(client = MODULE_LIBRARIES)
     @Nullable
     public String getSessionId() {
         return mSessionId;
@@ -84,17 +133,19 @@
         if (!(o instanceof VpnTransportInfo)) return false;
 
         VpnTransportInfo that = (VpnTransportInfo) o;
-        return (this.mType == that.mType) && TextUtils.equals(this.mSessionId, that.mSessionId);
+        return (this.mType == that.mType) && TextUtils.equals(this.mSessionId, that.mSessionId)
+                && (this.mBypassable == that.mBypassable);
     }
 
     @Override
     public int hashCode() {
-        return Objects.hash(mType, mSessionId);
+        return Objects.hash(mType, mSessionId, mBypassable);
     }
 
     @Override
     public String toString() {
-        return String.format("VpnTransportInfo{type=%d, sessionId=%s}", mType, mSessionId);
+        return String.format("VpnTransportInfo{type=%d, sessionId=%s, bypassable=%b}",
+                mType, mSessionId, mBypassable);
     }
 
     @Override
@@ -106,12 +157,13 @@
     public void writeToParcel(@NonNull Parcel dest, int flags) {
         dest.writeInt(mType);
         dest.writeString(mSessionId);
+        dest.writeBoolean(mBypassable);
     }
 
     public static final @NonNull Creator<VpnTransportInfo> CREATOR =
             new Creator<VpnTransportInfo>() {
         public VpnTransportInfo createFromParcel(Parcel in) {
-            return new VpnTransportInfo(in.readInt(), in.readString());
+            return new VpnTransportInfo(in.readInt(), in.readString(), in.readBoolean());
         }
         public VpnTransportInfo[] newArray(int size) {
             return new VpnTransportInfo[size];
diff --git a/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java b/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java
index edf04b2..f6a55c8 100644
--- a/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java
+++ b/service-t/src/com/android/server/ethernet/EthernetServiceImpl.java
@@ -289,7 +289,7 @@
 
         enforceAdminPermission(iface, false, "enableInterface()");
 
-        mTracker.enableInterface(iface, new EthernetCallback(cb));
+        mTracker.setInterfaceEnabled(iface, true /* enabled */, new EthernetCallback(cb));
     }
 
     @Override
@@ -301,7 +301,7 @@
 
         enforceAdminPermission(iface, false, "disableInterface()");
 
-        mTracker.disableInterface(iface, new EthernetCallback(cb));
+        mTracker.setInterfaceEnabled(iface, false /* enabled */, new EthernetCallback(cb));
     }
 
     @Override
diff --git a/service-t/src/com/android/server/ethernet/EthernetTracker.java b/service-t/src/com/android/server/ethernet/EthernetTracker.java
index 95baf81..852cf42 100644
--- a/service-t/src/com/android/server/ethernet/EthernetTracker.java
+++ b/service-t/src/com/android/server/ethernet/EthernetTracker.java
@@ -371,15 +371,9 @@
     }
 
     @VisibleForTesting(visibility = PACKAGE)
-    protected void enableInterface(@NonNull final String iface,
+    protected void setInterfaceEnabled(@NonNull final String iface, boolean enabled,
             @Nullable final EthernetCallback cb) {
-        mHandler.post(() -> updateInterfaceState(iface, true, cb));
-    }
-
-    @VisibleForTesting(visibility = PACKAGE)
-    protected void disableInterface(@NonNull final String iface,
-            @Nullable final EthernetCallback cb) {
-        mHandler.post(() -> updateInterfaceState(iface, false, cb));
+        mHandler.post(() -> updateInterfaceState(iface, enabled, cb));
     }
 
     IpConfiguration getIpConfiguration(String iface) {
diff --git a/service/Android.bp b/service/Android.bp
index 326f91b..691c1ad 100644
--- a/service/Android.bp
+++ b/service/Android.bp
@@ -178,7 +178,10 @@
         "networkstack-client",
         "PlatformProperties",
         "service-connectivity-protos",
-        "service-connectivity-stats-protos",
+        // TODO: Adding the stats protos currently affects test coverage.
+        // So remove the protos in ConnectivityService until all
+        // tests for proto apis are added.
+        //"service-connectivity-stats-protos",
         "NetworkStackApiStableShims",
     ],
     apex_available: [
diff --git a/tests/cts/net/src/android/net/cts/CaptivePortalTest.kt b/tests/cts/net/src/android/net/cts/CaptivePortalTest.kt
index aad8804..7c24c95 100644
--- a/tests/cts/net/src/android/net/cts/CaptivePortalTest.kt
+++ b/tests/cts/net/src/android/net/cts/CaptivePortalTest.kt
@@ -47,6 +47,7 @@
 import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
 import androidx.test.runner.AndroidJUnit4
 import com.android.modules.utils.build.SdkLevel.isAtLeastR
+import com.android.testutils.DeviceConfigRule
 import com.android.testutils.RecorderCallback
 import com.android.testutils.TestHttpServer
 import com.android.testutils.TestHttpServer.Request
diff --git a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
index c7272f8..f796ecc 100644
--- a/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
+++ b/tests/cts/net/src/android/net/cts/ConnectivityManagerTest.java
@@ -192,6 +192,7 @@
 import com.android.testutils.ConnectivityModuleTest;
 import com.android.testutils.DevSdkIgnoreRule;
 import com.android.testutils.DevSdkIgnoreRule.IgnoreUpTo;
+import com.android.testutils.DeviceConfigRule;
 import com.android.testutils.DeviceInfoUtils;
 import com.android.testutils.DumpTestUtils;
 import com.android.testutils.RecorderCallback.CallbackEntry;
@@ -2377,8 +2378,9 @@
             super.expectAvailableCallbacks(network, false /* suspended */, true /* validated */,
                     BLOCKED_REASON_NONE, NETWORK_CALLBACK_TIMEOUT_MS);
         }
-        public void expectBlockedStatusCallback(Network network, int blockedStatus) {
-            super.expectBlockedStatusCallback(blockedStatus, network, NETWORK_CALLBACK_TIMEOUT_MS);
+        public void eventuallyExpectBlockedStatusCallback(Network network, int blockedStatus) {
+            super.eventuallyExpect(CallbackEntry.BLOCKED_STATUS_INT, NETWORK_CALLBACK_TIMEOUT_MS,
+                    (it) -> it.getNetwork().equals(network) && it.getBlocked() == blockedStatus);
         }
         public void onBlockedStatusChanged(Network network, int blockedReasons) {
             getHistory().add(new CallbackEntry.BlockedStatusInt(network, blockedReasons));
@@ -2423,12 +2425,14 @@
         final Range<Integer> otherUidRange = new Range<>(otherUid, otherUid);
 
         setRequireVpnForUids(true, List.of(myUidRange));
-        myUidCallback.expectBlockedStatusCallback(defaultNetwork, BLOCKED_REASON_LOCKDOWN_VPN);
+        myUidCallback.eventuallyExpectBlockedStatusCallback(defaultNetwork,
+                BLOCKED_REASON_LOCKDOWN_VPN);
         otherUidCallback.assertNoBlockedStatusCallback();
 
         setRequireVpnForUids(true, List.of(myUidRange, otherUidRange));
         myUidCallback.assertNoBlockedStatusCallback();
-        otherUidCallback.expectBlockedStatusCallback(defaultNetwork, BLOCKED_REASON_LOCKDOWN_VPN);
+        otherUidCallback.eventuallyExpectBlockedStatusCallback(defaultNetwork,
+                BLOCKED_REASON_LOCKDOWN_VPN);
 
         // setRequireVpnForUids does no deduplication or refcounting. Removing myUidRange does not
         // unblock myUid because it was added to the blocked ranges twice.
@@ -2437,8 +2441,8 @@
         otherUidCallback.assertNoBlockedStatusCallback();
 
         setRequireVpnForUids(false, List.of(myUidRange, otherUidRange));
-        myUidCallback.expectBlockedStatusCallback(defaultNetwork, BLOCKED_REASON_NONE);
-        otherUidCallback.expectBlockedStatusCallback(defaultNetwork, BLOCKED_REASON_NONE);
+        myUidCallback.eventuallyExpectBlockedStatusCallback(defaultNetwork, BLOCKED_REASON_NONE);
+        otherUidCallback.eventuallyExpectBlockedStatusCallback(defaultNetwork, BLOCKED_REASON_NONE);
 
         myUidCallback.assertNoBlockedStatusCallback();
         otherUidCallback.assertNoBlockedStatusCallback();
diff --git a/tests/cts/net/src/android/net/cts/DeviceConfigRule.kt b/tests/cts/net/src/android/net/cts/DeviceConfigRule.kt
deleted file mode 100644
index 3a36cee..0000000
--- a/tests/cts/net/src/android/net/cts/DeviceConfigRule.kt
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (C) 2022 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 android.net.cts
-
-import android.Manifest.permission.READ_DEVICE_CONFIG
-import android.Manifest.permission.WRITE_DEVICE_CONFIG
-import android.provider.DeviceConfig
-import android.util.Log
-import com.android.modules.utils.build.SdkLevel
-import com.android.testutils.FunctionalUtils.ThrowingRunnable
-import com.android.testutils.runAsShell
-import com.android.testutils.tryTest
-import org.junit.rules.TestRule
-import org.junit.runner.Description
-import org.junit.runners.model.Statement
-import java.util.concurrent.CompletableFuture
-import java.util.concurrent.Executor
-import java.util.concurrent.TimeUnit
-
-private val TAG = DeviceConfigRule::class.simpleName
-
-/**
- * A [TestRule] that helps set [DeviceConfig] for tests and clean up the test configuration
- * automatically on teardown.
- *
- * The rule can also optionally retry tests when they fail following an external change of
- * DeviceConfig before S; this typically happens because device config flags are synced while the
- * test is running, and DisableConfigSyncTargetPreparer is only usable starting from S.
- *
- * @param retryCountBeforeSIfConfigChanged if > 0, when the test fails before S, check if
- *        the configs that were set through this rule were changed, and retry the test
- *        up to the specified number of times if yes.
- */
-class DeviceConfigRule @JvmOverloads constructor(
-    val retryCountBeforeSIfConfigChanged: Int = 0
-) : TestRule {
-    // Maps (namespace, key) -> value
-    private val originalConfig = mutableMapOf<Pair<String, String>, String?>()
-    private val usedConfig = mutableMapOf<Pair<String, String>, String?>()
-
-    /**
-     * Actions to be run after cleanup of the config, for the current test only.
-     */
-    private val currentTestCleanupActions = mutableListOf<ThrowingRunnable>()
-
-    override fun apply(base: Statement, description: Description): Statement {
-        return TestValidationUrlStatement(base, description)
-    }
-
-    private inner class TestValidationUrlStatement(
-        private val base: Statement,
-        private val description: Description
-    ) : Statement() {
-        override fun evaluate() {
-            var retryCount = if (SdkLevel.isAtLeastS()) 1 else retryCountBeforeSIfConfigChanged + 1
-            while (retryCount > 0) {
-                retryCount--
-                tryTest {
-                    base.evaluate()
-                    // Can't use break/return out of a loop here because this is a tryTest lambda,
-                    // so set retryCount to exit instead
-                    retryCount = 0
-                }.catch<Throwable> { e -> // junit AssertionFailedError does not extend Exception
-                    if (retryCount == 0) throw e
-                    usedConfig.forEach { (key, value) ->
-                        val currentValue = runAsShell(READ_DEVICE_CONFIG) {
-                            DeviceConfig.getProperty(key.first, key.second)
-                        }
-                        if (currentValue != value) {
-                            Log.w(TAG, "Test failed with unexpected device config change, retrying")
-                            return@catch
-                        }
-                    }
-                    throw e
-                } cleanupStep {
-                    runAsShell(WRITE_DEVICE_CONFIG) {
-                        originalConfig.forEach { (key, value) ->
-                            DeviceConfig.setProperty(
-                                    key.first, key.second, value, false /* makeDefault */)
-                        }
-                    }
-                } cleanupStep {
-                    originalConfig.clear()
-                    usedConfig.clear()
-                } cleanup {
-                    // Fold all cleanup actions into cleanup steps of an empty tryTest, so they are
-                    // all run even if exceptions are thrown, and exceptions are reported properly.
-                    currentTestCleanupActions.fold(tryTest { }) {
-                        tryBlock, action -> tryBlock.cleanupStep { action.run() }
-                    }.cleanup {
-                        currentTestCleanupActions.clear()
-                    }
-                }
-            }
-        }
-    }
-
-    /**
-     * Set a configuration key/value. After the test case ends, it will be restored to the value it
-     * had when this method was first called.
-     */
-    fun setConfig(namespace: String, key: String, value: String?): String? {
-        Log.i(TAG, "Setting config \"$key\" to \"$value\"")
-        val readWritePermissions = arrayOf(READ_DEVICE_CONFIG, WRITE_DEVICE_CONFIG)
-
-        val keyPair = Pair(namespace, key)
-        val existingValue = runAsShell(*readWritePermissions) {
-            DeviceConfig.getProperty(namespace, key)
-        }
-        if (!originalConfig.containsKey(keyPair)) {
-            originalConfig[keyPair] = existingValue
-        }
-        usedConfig[keyPair] = value
-        if (existingValue == value) {
-            // Already the correct value. There may be a race if a change is already in flight,
-            // but if multiple threads update the config there is no way to fix that anyway.
-            Log.i(TAG, "\"$key\" already had value \"$value\"")
-            return value
-        }
-
-        val future = CompletableFuture<String>()
-        val listener = DeviceConfig.OnPropertiesChangedListener {
-            // The listener receives updates for any change to any key, so don't react to
-            // changes that do not affect the relevant key
-            if (!it.keyset.contains(key)) return@OnPropertiesChangedListener
-            // "null" means absent in DeviceConfig : there is no such thing as a present but
-            // null value, so the following works even if |value| is null.
-            if (it.getString(key, null) == value) {
-                future.complete(value)
-            }
-        }
-
-        return tryTest {
-            runAsShell(*readWritePermissions) {
-                DeviceConfig.addOnPropertiesChangedListener(
-                        DeviceConfig.NAMESPACE_CONNECTIVITY,
-                        inlineExecutor,
-                        listener)
-                DeviceConfig.setProperty(
-                        DeviceConfig.NAMESPACE_CONNECTIVITY,
-                        key,
-                        value,
-                        false /* makeDefault */)
-                // Don't drop the permission until the config is applied, just in case
-                future.get(NetworkValidationTestUtil.TIMEOUT_MS, TimeUnit.MILLISECONDS)
-            }.also {
-                Log.i(TAG, "Config \"$key\" successfully set to \"$value\"")
-            }
-        } cleanup {
-            DeviceConfig.removeOnPropertiesChangedListener(listener)
-        }
-    }
-
-    private val inlineExecutor get() = Executor { r -> r.run() }
-
-    /**
-     * Add an action to be run after config cleanup when the current test case ends.
-     */
-    fun runAfterNextCleanup(action: ThrowingRunnable) {
-        currentTestCleanupActions.add(action)
-    }
-}
diff --git a/tests/cts/net/src/android/net/cts/NetworkValidationTestUtil.kt b/tests/cts/net/src/android/net/cts/NetworkValidationTestUtil.kt
index 375bfb8..a0b40aa 100644
--- a/tests/cts/net/src/android/net/cts/NetworkValidationTestUtil.kt
+++ b/tests/cts/net/src/android/net/cts/NetworkValidationTestUtil.kt
@@ -20,6 +20,7 @@
 import android.provider.DeviceConfig
 import android.provider.DeviceConfig.NAMESPACE_CONNECTIVITY
 import com.android.net.module.util.NetworkStackConstants
+import com.android.testutils.DeviceConfigRule
 import com.android.testutils.runAsShell
 
 /**
@@ -27,7 +28,6 @@
  */
 internal object NetworkValidationTestUtil {
     val TAG = NetworkValidationTestUtil::class.simpleName
-    const val TIMEOUT_MS = 20_000L
 
     /**
      * Clear the test network validation URLs.
diff --git a/tests/cts/net/src/android/net/cts/TestUtils.java b/tests/cts/net/src/android/net/cts/TestUtils.java
index 001aa01..6180845 100644
--- a/tests/cts/net/src/android/net/cts/TestUtils.java
+++ b/tests/cts/net/src/android/net/cts/TestUtils.java
@@ -16,8 +16,6 @@
 
 package android.net.cts;
 
-import static com.android.testutils.DevSdkIgnoreRuleKt.SC_V2;
-
 import android.os.Build;
 
 import com.android.modules.utils.build.SdkLevel;
@@ -37,11 +35,18 @@
     }
 
     /**
-     * Whether to test T+ APIs. This requires a) that the test be running on an S+ device, and
+     * Whether to test T+ APIs. This requires a) that the test be running on an T+ device, and
      * b) that the code be compiled against shims new enough to access these APIs.
      */
     public static boolean shouldTestTApis() {
-        // TODO: replace SC_V2 with Build.VERSION_CODES.S_V2 when it's available in mainline branch.
-        return SdkLevel.isAtLeastT() && ConstantsShim.VERSION > SC_V2;
+        return SdkLevel.isAtLeastT() && ConstantsShim.VERSION > Build.VERSION_CODES.S_V2;
+    }
+
+    /**
+     * Whether to test U+ APIs. This requires a) that the test be running on an U+ device, and
+     * b) that the code be compiled against shims new enough to access these APIs.
+     */
+    public static boolean shouldTestUApis() {
+        return SdkLevel.isAtLeastU() && ConstantsShim.VERSION > Build.VERSION_CODES.TIRAMISU;
     }
 }
diff --git a/tests/unit/java/android/net/NetworkTemplateTest.kt b/tests/unit/java/android/net/NetworkTemplateTest.kt
index 6c39169..666da53 100644
--- a/tests/unit/java/android/net/NetworkTemplateTest.kt
+++ b/tests/unit/java/android/net/NetworkTemplateTest.kt
@@ -231,10 +231,15 @@
         val mobileImsi1 = buildMobileNetworkState(TEST_IMSI1)
         val identMobile1 = buildNetworkIdentity(mockContext, mobileImsi1,
                 false /* defaultNetwork */, TelephonyManager.NETWORK_TYPE_UMTS)
+        val mobileImsi2 = buildMobileNetworkState(TEST_IMSI2)
+        val identMobile2 = buildNetworkIdentity(mockContext, mobileImsi2,
+                false /* defaultNetwork */, TelephonyManager.NETWORK_TYPE_LTE)
 
         // Verify that the template matches any subscriberId.
         templateMobileWildcard.assertMatches(identMobile1)
         templateMobileNullImsiWithRatType.assertMatches(identMobile1)
+        templateMobileWildcard.assertMatches(identMobile2)
+        templateMobileNullImsiWithRatType.assertDoesNotMatch(identMobile2)
 
         val identWifiImsi1Key1 = buildNetworkIdentity(
                 mockContext, buildWifiNetworkState(TEST_IMSI1, TEST_WIFI_KEY1), true, 0)
diff --git a/tests/unit/java/android/net/VpnTransportInfoTest.java b/tests/unit/java/android/net/VpnTransportInfoTest.java
index b4c7ac4..0510209 100644
--- a/tests/unit/java/android/net/VpnTransportInfoTest.java
+++ b/tests/unit/java/android/net/VpnTransportInfoTest.java
@@ -19,10 +19,13 @@
 import static android.net.NetworkCapabilities.REDACT_FOR_NETWORK_SETTINGS;
 import static android.net.NetworkCapabilities.REDACT_NONE;
 
+import static com.android.testutils.MiscAsserts.assertThrows;
 import static com.android.testutils.ParcelUtils.assertParcelSane;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
 
 import android.os.Build;
 
@@ -31,6 +34,7 @@
 import com.android.testutils.DevSdkIgnoreRule;
 import com.android.testutils.DevSdkIgnoreRunner;
 
+import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
@@ -38,36 +42,67 @@
 @SmallTest
 @DevSdkIgnoreRule.IgnoreUpTo(Build.VERSION_CODES.R)
 public class VpnTransportInfoTest {
+    @Rule
+    public final DevSdkIgnoreRule ignoreRule = new DevSdkIgnoreRule();
 
     @Test
     public void testParceling() {
-        VpnTransportInfo v = new VpnTransportInfo(VpnManager.TYPE_VPN_PLATFORM, "12345");
-        assertParcelSane(v, 2 /* fieldCount */);
+        final VpnTransportInfo v = new VpnTransportInfo(VpnManager.TYPE_VPN_PLATFORM, "12345");
+        assertParcelSane(v, 3 /* fieldCount */);
+
+        final VpnTransportInfo v2 =
+                new VpnTransportInfo(VpnManager.TYPE_VPN_PLATFORM, "12345", true);
+        assertParcelSane(v2, 3 /* fieldCount */);
     }
 
     @Test
     public void testEqualsAndHashCode() {
         String session1 = "12345";
         String session2 = "6789";
-        VpnTransportInfo v11 = new VpnTransportInfo(VpnManager.TYPE_VPN_PLATFORM, session1);
-        VpnTransportInfo v12 = new VpnTransportInfo(VpnManager.TYPE_VPN_SERVICE, session1);
-        VpnTransportInfo v13 = new VpnTransportInfo(VpnManager.TYPE_VPN_PLATFORM, session1);
-        VpnTransportInfo v14 = new VpnTransportInfo(VpnManager.TYPE_VPN_LEGACY, session1);
-        VpnTransportInfo v15 = new VpnTransportInfo(VpnManager.TYPE_VPN_OEM, session1);
-        VpnTransportInfo v21 = new VpnTransportInfo(VpnManager.TYPE_VPN_LEGACY, session2);
+        final VpnTransportInfo v11 = new VpnTransportInfo(VpnManager.TYPE_VPN_PLATFORM, session1);
+        final VpnTransportInfo v12 = new VpnTransportInfo(VpnManager.TYPE_VPN_SERVICE, session1);
+        final VpnTransportInfo v13 = new VpnTransportInfo(VpnManager.TYPE_VPN_PLATFORM, session1);
+        final VpnTransportInfo v14 = new VpnTransportInfo(VpnManager.TYPE_VPN_LEGACY, session1);
+        final VpnTransportInfo v15 = new VpnTransportInfo(VpnManager.TYPE_VPN_OEM, session1);
+        final VpnTransportInfo v16 = new VpnTransportInfo(VpnManager.TYPE_VPN_OEM, session1, true);
+        final VpnTransportInfo v17 = new VpnTransportInfo(VpnManager.TYPE_VPN_OEM, session1, true);
+        final VpnTransportInfo v21 = new VpnTransportInfo(VpnManager.TYPE_VPN_LEGACY, session2);
 
-        VpnTransportInfo v31 = v11.makeCopy(REDACT_FOR_NETWORK_SETTINGS);
-        VpnTransportInfo v32 = v13.makeCopy(REDACT_FOR_NETWORK_SETTINGS);
+        final VpnTransportInfo v31 = v11.makeCopy(REDACT_FOR_NETWORK_SETTINGS);
+        final VpnTransportInfo v32 = v13.makeCopy(REDACT_FOR_NETWORK_SETTINGS);
+        final VpnTransportInfo v33 = v16.makeCopy(REDACT_FOR_NETWORK_SETTINGS);
+        final VpnTransportInfo v34 = v17.makeCopy(REDACT_FOR_NETWORK_SETTINGS);
 
         assertNotEquals(v11, v12);
         assertNotEquals(v13, v14);
         assertNotEquals(v14, v15);
         assertNotEquals(v14, v21);
+        assertNotEquals(v15, v16);
 
         assertEquals(v11, v13);
         assertEquals(v31, v32);
+        assertEquals(v33, v34);
         assertEquals(v11.hashCode(), v13.hashCode());
+        assertEquals(v16.hashCode(), v17.hashCode());
         assertEquals(REDACT_FOR_NETWORK_SETTINGS, v32.getApplicableRedactions());
         assertEquals(session1, v15.makeCopy(REDACT_NONE).getSessionId());
     }
+
+    @DevSdkIgnoreRule.IgnoreAfter(Build.VERSION_CODES.TIRAMISU)
+    @Test
+    public void testGetBypassable_beforeU() {
+        final VpnTransportInfo v = new VpnTransportInfo(VpnManager.TYPE_VPN_PLATFORM, "12345");
+        assertThrows(UnsupportedOperationException.class, () -> v.getBypassable());
+    }
+
+    @DevSdkIgnoreRule.IgnoreUpTo(Build.VERSION_CODES.TIRAMISU)
+    @Test
+    public void testGetBypassable_afterU() {
+        final VpnTransportInfo v = new VpnTransportInfo(VpnManager.TYPE_VPN_PLATFORM, "12345");
+        assertFalse(v.getBypassable());
+
+        final VpnTransportInfo v2 =
+                new VpnTransportInfo(VpnManager.TYPE_VPN_PLATFORM, "12345", true);
+        assertTrue(v2.getBypassable());
+    }
 }
diff --git a/tests/unit/java/com/android/server/ConnectivityServiceTest.java b/tests/unit/java/com/android/server/ConnectivityServiceTest.java
index 8c9917e..f80b9bd 100755
--- a/tests/unit/java/com/android/server/ConnectivityServiceTest.java
+++ b/tests/unit/java/com/android/server/ConnectivityServiceTest.java
@@ -5034,9 +5034,6 @@
 
     @Test
     public void testRegisterDefaultNetworkCallback() throws Exception {
-        // NETWORK_SETTINGS is necessary to call registerSystemDefaultNetworkCallback.
-        mServiceContext.setPermission(NETWORK_SETTINGS, PERMISSION_GRANTED);
-
         final TestNetworkCallback defaultNetworkCallback = new TestNetworkCallback();
         mCm.registerDefaultNetworkCallback(defaultNetworkCallback);
         defaultNetworkCallback.assertNoCallback();
@@ -8287,9 +8284,6 @@
 
     @Test
     public void testVpnNetworkActive() throws Exception {
-        // NETWORK_SETTINGS is necessary to call registerSystemDefaultNetworkCallback.
-        mServiceContext.setPermission(NETWORK_SETTINGS, PERMISSION_GRANTED);
-
         final int uid = Process.myUid();
 
         final TestNetworkCallback genericNetworkCallback = new TestNetworkCallback();
@@ -9634,8 +9628,6 @@
     public void testLegacyLockdownVpn() throws Exception {
         mServiceContext.setPermission(
                 Manifest.permission.CONTROL_VPN, PERMISSION_GRANTED);
-        // For LockdownVpnTracker to call registerSystemDefaultNetworkCallback.
-        mServiceContext.setPermission(NETWORK_SETTINGS, PERMISSION_GRANTED);
 
         final NetworkRequest request = new NetworkRequest.Builder().clearCapabilities().build();
         final TestNetworkCallback callback = new TestNetworkCallback();
@@ -13133,8 +13125,6 @@
             throw new IllegalStateException("Default network callbacks already registered");
         }
 
-        // Using Manifest.permission.NETWORK_SETTINGS for registerSystemDefaultNetworkCallback()
-        mServiceContext.setPermission(NETWORK_SETTINGS, PERMISSION_GRANTED);
         mSystemDefaultNetworkCallback = new TestNetworkCallback();
         mDefaultNetworkCallback = new TestNetworkCallback();
         mProfileDefaultNetworkCallback = new TestNetworkCallback();
diff --git a/tests/unit/java/com/android/server/connectivity/VpnTest.java b/tests/unit/java/com/android/server/connectivity/VpnTest.java
index 3c23d7b..e6745d1 100644
--- a/tests/unit/java/com/android/server/connectivity/VpnTest.java
+++ b/tests/unit/java/com/android/server/connectivity/VpnTest.java
@@ -1853,6 +1853,7 @@
 
         // Check if allowBypass is set or not.
         assertTrue(nacCaptor.getValue().isBypassableVpn());
+        assertTrue(((VpnTransportInfo) ncCaptor.getValue().getTransportInfo()).getBypassable());
 
         return new PlatformVpnSnapshot(vpn, nwCb, ikeCb, childCb);
     }
diff --git a/tests/unit/java/com/android/server/ethernet/EthernetServiceImplTest.java b/tests/unit/java/com/android/server/ethernet/EthernetServiceImplTest.java
index 9bf893a..de0af94 100644
--- a/tests/unit/java/com/android/server/ethernet/EthernetServiceImplTest.java
+++ b/tests/unit/java/com/android/server/ethernet/EthernetServiceImplTest.java
@@ -312,14 +312,15 @@
     @Test
     public void testEnableInterface() {
         mEthernetServiceImpl.enableInterface(TEST_IFACE, NULL_LISTENER);
-        verify(mEthernetTracker).enableInterface(eq(TEST_IFACE),
+        verify(mEthernetTracker).setInterfaceEnabled(eq(TEST_IFACE), eq(true),
                 any(EthernetCallback.class));
     }
 
     @Test
     public void testDisableInterface() {
         mEthernetServiceImpl.disableInterface(TEST_IFACE, NULL_LISTENER);
-        verify(mEthernetTracker).disableInterface(eq(TEST_IFACE), any(EthernetCallback.class));
+        verify(mEthernetTracker).setInterfaceEnabled(eq(TEST_IFACE), eq(false),
+                any(EthernetCallback.class));
     }
 
     @Test
@@ -384,7 +385,7 @@
         denyManageEthPermission();
 
         mEthernetServiceImpl.enableInterface(TEST_IFACE, NULL_LISTENER);
-        verify(mEthernetTracker).enableInterface(eq(TEST_IFACE),
+        verify(mEthernetTracker).setInterfaceEnabled(eq(TEST_IFACE), eq(true),
                 any(EthernetCallback.class));
     }
 
@@ -395,7 +396,7 @@
         denyManageEthPermission();
 
         mEthernetServiceImpl.disableInterface(TEST_IFACE, NULL_LISTENER);
-        verify(mEthernetTracker).disableInterface(eq(TEST_IFACE),
+        verify(mEthernetTracker).setInterfaceEnabled(eq(TEST_IFACE), eq(false),
                 any(EthernetCallback.class));
     }
 
diff --git a/tools/gn2bp/Android.bp.swp b/tools/gn2bp/Android.bp.swp
index 529f53f..2821a8c 100644
--- a/tools/gn2bp/Android.bp.swp
+++ b/tools/gn2bp/Android.bp.swp
@@ -117,63 +117,7 @@
 // GN: //base/allocator/partition_allocator:partition_alloc
 cc_library_static {
     name: "cronet_aml_base_allocator_partition_allocator_partition_alloc",
-    srcs: [
-        ":cronet_aml_third_party_android_ndk_cpu_features",
-        "base/allocator/partition_allocator/address_pool_manager.cc",
-        "base/allocator/partition_allocator/address_pool_manager_bitmap.cc",
-        "base/allocator/partition_allocator/address_space_randomization.cc",
-        "base/allocator/partition_allocator/allocation_guard.cc",
-        "base/allocator/partition_allocator/dangling_raw_ptr_checks.cc",
-        "base/allocator/partition_allocator/gwp_asan_support.cc",
-        "base/allocator/partition_allocator/memory_reclaimer.cc",
-        "base/allocator/partition_allocator/oom.cc",
-        "base/allocator/partition_allocator/oom_callback.cc",
-        "base/allocator/partition_allocator/page_allocator.cc",
-        "base/allocator/partition_allocator/page_allocator_internals_posix.cc",
-        "base/allocator/partition_allocator/partition_address_space.cc",
-        "base/allocator/partition_allocator/partition_alloc.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/check.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/cpu.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/debug/alias.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/files/file_path.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/files/file_util_posix.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/logging.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/native_library.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/native_library_posix.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/pkey.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/posix/safe_strerror.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/rand_util.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/rand_util_posix.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/strings/stringprintf.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/time/time.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/time/time_android.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/time/time_conversion_posix.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/time/time_now_posix.cc",
-        "base/allocator/partition_allocator/partition_alloc_base/time/time_override.cc",
-        "base/allocator/partition_allocator/partition_alloc_hooks.cc",
-        "base/allocator/partition_allocator/partition_bucket.cc",
-        "base/allocator/partition_allocator/partition_oom.cc",
-        "base/allocator/partition_allocator/partition_page.cc",
-        "base/allocator/partition_allocator/partition_root.cc",
-        "base/allocator/partition_allocator/partition_stats.cc",
-        "base/allocator/partition_allocator/random.cc",
-        "base/allocator/partition_allocator/reservation_offset_table.cc",
-        "base/allocator/partition_allocator/spinning_mutex.cc",
-        "base/allocator/partition_allocator/starscan/metadata_allocator.cc",
-        "base/allocator/partition_allocator/starscan/pcscan.cc",
-        "base/allocator/partition_allocator/starscan/pcscan_internal.cc",
-        "base/allocator/partition_allocator/starscan/pcscan_scheduling.cc",
-        "base/allocator/partition_allocator/starscan/snapshot.cc",
-        "base/allocator/partition_allocator/starscan/stack/asm/x64/push_registers_asm.cc",
-        "base/allocator/partition_allocator/starscan/stack/stack.cc",
-        "base/allocator/partition_allocator/starscan/stats_collector.cc",
-        "base/allocator/partition_allocator/starscan/write_protector.cc",
-        "base/allocator/partition_allocator/tagging.cc",
-        "base/allocator/partition_allocator/thread_cache.cc",
-    ],
+    host_supported: true,
     generated_headers: [
         "cronet_aml_base_allocator_partition_allocator_chromecast_buildflags",
         "cronet_aml_base_allocator_partition_allocator_chromeos_buildflags",
@@ -196,13 +140,20 @@
         "-DANDROID_NDK_VERSION_ROLL=r23_1",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
         "-DHAVE_SYS_UIO_H",
         "-DIS_PARTITION_ALLOC_IMPL",
         "-DPA_PCSCAN_STACK_SUPPORTED",
+        "-DUSE_AURA=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -217,14 +168,128 @@
         "buildtools/third_party/libc++abi/trunk/include",
         "third_party/android_ndk/sources/android/cpufeatures/",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
+    arch: {
+        x86: {
+            srcs: [
+                ":cronet_aml_third_party_android_ndk_cpu_features",
+                "base/allocator/partition_allocator/address_pool_manager.cc",
+                "base/allocator/partition_allocator/address_pool_manager_bitmap.cc",
+                "base/allocator/partition_allocator/address_space_randomization.cc",
+                "base/allocator/partition_allocator/allocation_guard.cc",
+                "base/allocator/partition_allocator/dangling_raw_ptr_checks.cc",
+                "base/allocator/partition_allocator/gwp_asan_support.cc",
+                "base/allocator/partition_allocator/memory_reclaimer.cc",
+                "base/allocator/partition_allocator/oom.cc",
+                "base/allocator/partition_allocator/oom_callback.cc",
+                "base/allocator/partition_allocator/page_allocator.cc",
+                "base/allocator/partition_allocator/page_allocator_internals_posix.cc",
+                "base/allocator/partition_allocator/partition_address_space.cc",
+                "base/allocator/partition_allocator/partition_alloc.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/check.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/cpu.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/debug/alias.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/files/file_util_posix.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/logging.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/pkey.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/posix/safe_strerror.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/rand_util.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/rand_util_posix.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/strings/stringprintf.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/time/time.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/time/time_conversion_posix.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/time/time_now_posix.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/time/time_override.cc",
+                "base/allocator/partition_allocator/partition_alloc_hooks.cc",
+                "base/allocator/partition_allocator/partition_bucket.cc",
+                "base/allocator/partition_allocator/partition_oom.cc",
+                "base/allocator/partition_allocator/partition_page.cc",
+                "base/allocator/partition_allocator/partition_root.cc",
+                "base/allocator/partition_allocator/partition_stats.cc",
+                "base/allocator/partition_allocator/random.cc",
+                "base/allocator/partition_allocator/reservation_offset_table.cc",
+                "base/allocator/partition_allocator/spinning_mutex.cc",
+                "base/allocator/partition_allocator/starscan/metadata_allocator.cc",
+                "base/allocator/partition_allocator/starscan/pcscan.cc",
+                "base/allocator/partition_allocator/starscan/pcscan_internal.cc",
+                "base/allocator/partition_allocator/starscan/pcscan_scheduling.cc",
+                "base/allocator/partition_allocator/starscan/snapshot.cc",
+                "base/allocator/partition_allocator/starscan/stack/asm/x86/push_registers_asm.cc",
+                "base/allocator/partition_allocator/starscan/stack/stack.cc",
+                "base/allocator/partition_allocator/starscan/stats_collector.cc",
+                "base/allocator/partition_allocator/starscan/write_protector.cc",
+                "base/allocator/partition_allocator/tagging.cc",
+                "base/allocator/partition_allocator/thread_cache.cc",
+            ],
+        },
+        x86_64: {
+            srcs: [
+                ":cronet_aml_third_party_android_ndk_cpu_features",
+                "base/allocator/partition_allocator/address_pool_manager.cc",
+                "base/allocator/partition_allocator/address_pool_manager_bitmap.cc",
+                "base/allocator/partition_allocator/address_space_randomization.cc",
+                "base/allocator/partition_allocator/allocation_guard.cc",
+                "base/allocator/partition_allocator/dangling_raw_ptr_checks.cc",
+                "base/allocator/partition_allocator/gwp_asan_support.cc",
+                "base/allocator/partition_allocator/memory_reclaimer.cc",
+                "base/allocator/partition_allocator/oom.cc",
+                "base/allocator/partition_allocator/oom_callback.cc",
+                "base/allocator/partition_allocator/page_allocator.cc",
+                "base/allocator/partition_allocator/page_allocator_internals_posix.cc",
+                "base/allocator/partition_allocator/partition_address_space.cc",
+                "base/allocator/partition_allocator/partition_alloc.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/check.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/cpu.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/debug/alias.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/files/file_util_posix.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/logging.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/memory/ref_counted.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/pkey.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/posix/safe_strerror.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/rand_util.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/rand_util_posix.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/strings/stringprintf.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/threading/platform_thread_posix.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/time/time.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/time/time_conversion_posix.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/time/time_now_posix.cc",
+                "base/allocator/partition_allocator/partition_alloc_base/time/time_override.cc",
+                "base/allocator/partition_allocator/partition_alloc_hooks.cc",
+                "base/allocator/partition_allocator/partition_bucket.cc",
+                "base/allocator/partition_allocator/partition_oom.cc",
+                "base/allocator/partition_allocator/partition_page.cc",
+                "base/allocator/partition_allocator/partition_root.cc",
+                "base/allocator/partition_allocator/partition_stats.cc",
+                "base/allocator/partition_allocator/random.cc",
+                "base/allocator/partition_allocator/reservation_offset_table.cc",
+                "base/allocator/partition_allocator/spinning_mutex.cc",
+                "base/allocator/partition_allocator/starscan/metadata_allocator.cc",
+                "base/allocator/partition_allocator/starscan/pcscan.cc",
+                "base/allocator/partition_allocator/starscan/pcscan_internal.cc",
+                "base/allocator/partition_allocator/starscan/pcscan_scheduling.cc",
+                "base/allocator/partition_allocator/starscan/snapshot.cc",
+                "base/allocator/partition_allocator/starscan/stack/asm/x64/push_registers_asm.cc",
+                "base/allocator/partition_allocator/starscan/stack/stack.cc",
+                "base/allocator/partition_allocator/starscan/stats_collector.cc",
+                "base/allocator/partition_allocator/starscan/write_protector.cc",
+                "base/allocator/partition_allocator/tagging.cc",
+                "base/allocator/partition_allocator/thread_cache.cc",
+            ],
+        },
+    },
 }
 
 // GN: //base/allocator/partition_allocator:partition_alloc_buildflags
 genrule {
     name: "cronet_aml_base_allocator_partition_allocator_partition_alloc_buildflags",
-    cmd: "echo '--flags ENABLE_PARTITION_ALLOC_AS_MALLOC_SUPPORT=\"true\" ENABLE_BACKUP_REF_PTR_SUPPORT=\"true\" ENABLE_BACKUP_REF_PTR_SLOW_CHECKS=\"false\" ENABLE_DANGLING_RAW_PTR_CHECKS=\"false\" PUT_REF_COUNT_IN_PREVIOUS_SLOT=\"true\" ENABLE_GWP_ASAN_SUPPORT=\"true\" ENABLE_MTE_CHECKED_PTR_SUPPORT=\"false\" RECORD_ALLOC_INFO=\"false\" USE_FREESLOT_BITMAP=\"false\" GLUE_CORE_POOLS=\"false\" ENABLE_SHADOW_METADATA_FOR_64_BITS_POINTERS=\"false\" STARSCAN=\"true\" PA_USE_BASE_TRACING=\"true\" ENABLE_PKEYS=\"false\"' | " +
+    cmd: "echo '--flags ENABLE_PARTITION_ALLOC_AS_MALLOC_SUPPORT=\"true\" ENABLE_BACKUP_REF_PTR_SUPPORT=\"true\" ENABLE_BACKUP_REF_PTR_SLOW_CHECKS=\"false\" ENABLE_DANGLING_RAW_PTR_CHECKS=\"false\" PUT_REF_COUNT_IN_PREVIOUS_SLOT=\"true\" ENABLE_GWP_ASAN_SUPPORT=\"true\" ENABLE_MTE_CHECKED_PTR_SUPPORT=\"false\" RECORD_ALLOC_INFO=\"false\" USE_FREESLOT_BITMAP=\"false\" GLUE_CORE_POOLS=\"false\" ENABLE_SHADOW_METADATA_FOR_64_BITS_POINTERS=\"false\" STARSCAN=\"true\" PA_USE_BASE_TRACING=\"true\" ENABLE_PKEYS=\"true\"' | " +
          "$(location build/write_buildflag_header.py) --output " +
          "$(out) " +
          "--rulename " +
@@ -244,7 +309,7 @@
 // GN: //base:anchor_functions_buildflags
 genrule {
     name: "cronet_aml_base_anchor_functions_buildflags",
-    cmd: "echo '--flags USE_LLD=\"true\" SUPPORTS_CODE_ORDERING=\"true\"' | " +
+    cmd: "echo '--flags USE_LLD=\"true\" SUPPORTS_CODE_ORDERING=\"false\"' | " +
          "$(location build/write_buildflag_header.py) --output " +
          "$(out) " +
          "--rulename " +
@@ -422,69 +487,11 @@
         "base/allocator/dispatcher/internal/dispatch_data.cc",
         "base/allocator/dispatcher/reentry_guard.cc",
         "base/allocator/partition_allocator/shim/allocator_shim.cc",
-        "base/allocator/partition_allocator/shim/allocator_shim_default_dispatch_to_linker_wrapped_symbols.cc",
-        "base/android/android_hardware_buffer_compat.cc",
-        "base/android/android_image_reader_compat.cc",
-        "base/android/apk_assets.cc",
-        "base/android/application_status_listener.cc",
-        "base/android/base_feature_list.cc",
-        "base/android/base_features.cc",
-        "base/android/base_jni_onload.cc",
-        "base/android/build_info.cc",
-        "base/android/bundle_utils.cc",
-        "base/android/callback_android.cc",
-        "base/android/child_process_service.cc",
-        "base/android/command_line_android.cc",
-        "base/android/content_uri_utils.cc",
-        "base/android/cpu_features.cc",
-        "base/android/early_trace_event_binding.cc",
-        "base/android/event_log.cc",
-        "base/android/feature_list_jni.cc",
-        "base/android/features_jni.cc",
-        "base/android/field_trial_list.cc",
-        "base/android/important_file_writer_android.cc",
-        "base/android/int_string_callback.cc",
-        "base/android/jank_metric_uma_recorder.cc",
-        "base/android/java_exception_reporter.cc",
-        "base/android/java_handler_thread.cc",
-        "base/android/java_heap_dump_generator.cc",
-        "base/android/java_runtime.cc",
-        "base/android/jni_android.cc",
-        "base/android/jni_array.cc",
-        "base/android/jni_registrar.cc",
-        "base/android/jni_string.cc",
-        "base/android/jni_utils.cc",
-        "base/android/jni_weak_ref.cc",
-        "base/android/library_loader/anchor_functions.cc",
-        "base/android/library_loader/library_loader_hooks.cc",
-        "base/android/library_loader/library_prefetcher.cc",
-        "base/android/library_loader/library_prefetcher_hooks.cc",
-        "base/android/locale_utils.cc",
-        "base/android/memory_pressure_listener_android.cc",
-        "base/android/native_uma_recorder.cc",
-        "base/android/path_service_android.cc",
-        "base/android/path_utils.cc",
-        "base/android/radio_utils.cc",
-        "base/android/reached_addresses_bitset.cc",
-        "base/android/reached_code_profiler_stub.cc",
-        "base/android/remove_stale_data.cc",
-        "base/android/scoped_hardware_buffer_fence_sync.cc",
-        "base/android/scoped_hardware_buffer_handle.cc",
-        "base/android/scoped_java_ref.cc",
-        "base/android/statistics_recorder_android.cc",
-        "base/android/sys_utils.cc",
-        "base/android/task_scheduler/post_task_android.cc",
-        "base/android/task_scheduler/task_runner_android.cc",
-        "base/android/thread_instruction_count.cc",
-        "base/android/timezone_utils.cc",
-        "base/android/trace_event_binding.cc",
-        "base/android/unguessable_token_android.cc",
         "base/at_exit.cc",
         "base/barrier_closure.cc",
         "base/base64.cc",
         "base/base64url.cc",
         "base/base_paths.cc",
-        "base/base_paths_android.cc",
         "base/big_endian.cc",
         "base/build_time.cc",
         "base/callback_list.cc",
@@ -511,7 +518,6 @@
         "base/debug/proc_maps_linux.cc",
         "base/debug/profiler.cc",
         "base/debug/stack_trace.cc",
-        "base/debug/stack_trace_android.cc",
         "base/debug/task_trace.cc",
         "base/environment.cc",
         "base/feature_list.cc",
@@ -529,7 +535,6 @@
         "base/files/file_proxy.cc",
         "base/files/file_tracing.cc",
         "base/files/file_util.cc",
-        "base/files/file_util_android.cc",
         "base/files/file_util_posix.cc",
         "base/files/important_file_writer.cc",
         "base/files/important_file_writer_cleaner.cc",
@@ -537,7 +542,6 @@
         "base/files/memory_mapped_file_posix.cc",
         "base/files/safe_base_name.cc",
         "base/files/scoped_file.cc",
-        "base/files/scoped_file_android.cc",
         "base/files/scoped_temp_dir.cc",
         "base/functional/callback_helpers.cc",
         "base/functional/callback_internal.cc",
@@ -569,9 +573,7 @@
         "base/memory/nonscannable_memory.cc",
         "base/memory/page_size_posix.cc",
         "base/memory/platform_shared_memory_handle.cc",
-        "base/memory/platform_shared_memory_mapper_android.cc",
         "base/memory/platform_shared_memory_region.cc",
-        "base/memory/platform_shared_memory_region_android.cc",
         "base/memory/raw_ptr.cc",
         "base/memory/raw_ptr_asan_bound_arg_tracker.cc",
         "base/memory/raw_ptr_asan_service.cc",
@@ -587,7 +589,6 @@
         "base/memory/weak_ptr.cc",
         "base/memory/writable_shared_memory_region.cc",
         "base/message_loop/message_pump.cc",
-        "base/message_loop/message_pump_android.cc",
         "base/message_loop/message_pump_default.cc",
         "base/message_loop/message_pump_epoll.cc",
         "base/message_loop/message_pump_libevent.cc",
@@ -623,7 +624,6 @@
         "base/observer_list_threadsafe.cc",
         "base/observer_list_types.cc",
         "base/one_shot_event.cc",
-        "base/os_compat_android.cc",
         "base/path_service.cc",
         "base/pending_task.cc",
         "base/pickle.cc",
@@ -637,7 +637,6 @@
         "base/power_monitor/moving_average.cc",
         "base/power_monitor/power_monitor.cc",
         "base/power_monitor/power_monitor_device_source.cc",
-        "base/power_monitor/power_monitor_device_source_android.cc",
         "base/power_monitor/power_monitor_features.cc",
         "base/power_monitor/power_monitor_source.cc",
         "base/power_monitor/sampling_event_source.cc",
@@ -650,7 +649,6 @@
         "base/process/launch_posix.cc",
         "base/process/memory.cc",
         "base/process/memory_linux.cc",
-        "base/process/process_android.cc",
         "base/process/process_handle.cc",
         "base/process/process_handle_linux.cc",
         "base/process/process_handle_posix.cc",
@@ -673,7 +671,6 @@
         "base/profiler/stack_copier_signal.cc",
         "base/profiler/stack_copier_suspend.cc",
         "base/profiler/stack_sampler.cc",
-        "base/profiler/stack_sampler_android.cc",
         "base/profiler/stack_sampler_impl.cc",
         "base/profiler/stack_sampling_profiler.cc",
         "base/profiler/thread_delegate_posix.cc",
@@ -720,7 +717,6 @@
         "base/synchronization/waitable_event_watcher_posix.cc",
         "base/syslog_logging.cc",
         "base/system/sys_info.cc",
-        "base/system/sys_info_android.cc",
         "base/system/sys_info_linux.cc",
         "base/system/sys_info_posix.cc",
         "base/system/system_monitor.cc",
@@ -799,7 +795,6 @@
         "base/third_party/superfasthash/superfasthash.c",
         "base/threading/hang_watcher.cc",
         "base/threading/platform_thread.cc",
-        "base/threading/platform_thread_android.cc",
         "base/threading/platform_thread_internal_posix.cc",
         "base/threading/platform_thread_posix.cc",
         "base/threading/platform_thread_ref.cc",
@@ -826,7 +821,6 @@
         "base/time/default_tick_clock.cc",
         "base/time/tick_clock.cc",
         "base/time/time.cc",
-        "base/time/time_android.cc",
         "base/time/time_conversion_posix.cc",
         "base/time/time_delta_from_string.cc",
         "base/time/time_exploded_icu.cc",
@@ -851,21 +845,21 @@
         "base/version.cc",
         "base/vlog.cc",
     ],
-    shared_libs: [
-        "libandroid",
-        "liblog",
-    ],
     static_libs: [
         "cronet_aml_base_allocator_partition_allocator_partition_alloc",
         "cronet_aml_base_base_static",
         "cronet_aml_base_third_party_double_conversion_double_conversion",
         "cronet_aml_base_third_party_dynamic_annotations_dynamic_annotations",
+        "cronet_aml_base_third_party_symbolize_symbolize",
+        "cronet_aml_base_third_party_xdg_mime_xdg_mime",
+        "cronet_aml_base_third_party_xdg_user_dirs_xdg_user_dirs",
+        "cronet_aml_third_party_boringssl_boringssl",
         "cronet_aml_third_party_icu_icui18n",
         "cronet_aml_third_party_icu_icuuc_private",
         "cronet_aml_third_party_libevent_libevent",
         "cronet_aml_third_party_modp_b64_modp_b64",
-        "libssl",
     ],
+    host_supported: true,
     generated_headers: [
         "cronet_aml_base_allocator_buildflags",
         "cronet_aml_base_allocator_partition_allocator_chromecast_buildflags",
@@ -936,18 +930,27 @@
         "-DBASE_IMPLEMENTATION",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
+        "-DGLOG_EXPORT=",
         "-DHAVE_SYS_UIO_H",
         "-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE",
+        "-DUSE_AURA=1",
         "-DUSE_CHROMIUM_ICU=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_SYMBOLIZE",
+        "-DUSE_UDEV",
         "-DU_ENABLE_DYLOAD=0",
         "-DU_ENABLE_RESOURCE_TRACING=0",
         "-DU_ENABLE_TRACING=1",
         "-DU_STATIC_IMPLEMENTATION",
         "-DU_USING_ICU_NAMESPACE=0",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -966,11 +969,21 @@
         "third_party/icu/source/common/",
         "third_party/icu/source/i18n/",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     header_libs: [
         "jni_headers",
     ],
     cpp_std: "c++20",
+    target: {
+        android: {
+            shared_libs: [
+                "libandroid",
+                "liblog",
+            ],
+        },
+    },
 }
 
 // GN: //base:base_jni_headers
@@ -1244,6 +1257,7 @@
     srcs: [
         "base/base_switches.cc",
     ],
+    host_supported: true,
     generated_headers: [
         "cronet_aml_build_chromeos_buildflags",
     ],
@@ -1258,11 +1272,18 @@
         "-DANDROID_NDK_VERSION_ROLL=r23_1",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
         "-DHAVE_SYS_UIO_H",
+        "-DUSE_AURA=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -1276,6 +1297,8 @@
         "buildtools/third_party/libc++/trunk/include",
         "buildtools/third_party/libc++abi/trunk/include",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
 }
@@ -1336,7 +1359,7 @@
 // GN: //base:debugging_buildflags
 genrule {
     name: "cronet_aml_base_debugging_buildflags",
-    cmd: "echo '--flags DCHECK_IS_CONFIGURABLE=\"false\" ENABLE_LOCATION_SOURCE=\"true\" ENABLE_PROFILING=\"false\" CAN_UNWIND_WITH_FRAME_POINTERS=\"false\" UNSAFE_DEVELOPER_BUILD=\"true\" CAN_UNWIND_WITH_CFI_TABLE=\"false\" EXCLUDE_UNWIND_TABLES=\"false\" ENABLE_GDBINIT_WARNING=\"true\" ENABLE_LLDBINIT_WARNING=\"false\" EXPENSIVE_DCHECKS_ARE_ON=\"true\" ENABLE_STACK_TRACE_LINE_NUMBERS=\"false\"' | " +
+    cmd: "echo '--flags DCHECK_IS_CONFIGURABLE=\"false\" ENABLE_LOCATION_SOURCE=\"true\" ENABLE_PROFILING=\"false\" CAN_UNWIND_WITH_FRAME_POINTERS=\"true\" UNSAFE_DEVELOPER_BUILD=\"true\" CAN_UNWIND_WITH_CFI_TABLE=\"false\" EXCLUDE_UNWIND_TABLES=\"false\" ENABLE_GDBINIT_WARNING=\"true\" ENABLE_LLDBINIT_WARNING=\"false\" EXPENSIVE_DCHECKS_ARE_ON=\"true\" ENABLE_STACK_TRACE_LINE_NUMBERS=\"false\"' | " +
          "$(location build/write_buildflag_header.py) --output " +
          "$(out) " +
          "--rulename " +
@@ -1571,6 +1594,7 @@
         "base/third_party/double_conversion/double-conversion/string-to-double.cc",
         "base/third_party/double_conversion/double-conversion/strtod.cc",
     ],
+    host_supported: true,
     defaults: [
         "cronet_aml_defaults",
     ],
@@ -1579,11 +1603,18 @@
         "-DANDROID_NDK_VERSION_ROLL=r23_1",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
         "-DHAVE_SYS_UIO_H",
+        "-DUSE_AURA=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -1597,6 +1628,8 @@
         "buildtools/third_party/libc++/trunk/include",
         "buildtools/third_party/libc++abi/trunk/include",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
 }
@@ -1607,6 +1640,7 @@
     srcs: [
         "base/third_party/dynamic_annotations/dynamic_annotations.c",
     ],
+    host_supported: true,
     defaults: [
         "cronet_aml_defaults",
     ],
@@ -1615,11 +1649,18 @@
         "-DANDROID_NDK_VERSION_ROLL=r23_1",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
         "-DHAVE_SYS_UIO_H",
+        "-DUSE_AURA=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -1631,6 +1672,8 @@
         "buildtools/third_party/libc++/trunk/include",
         "buildtools/third_party/libc++abi/trunk/include",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
 }
@@ -1642,6 +1685,8 @@
         "base/third_party/symbolize/demangle.cc",
         "base/third_party/symbolize/symbolize.cc",
     ],
+    host_supported: true,
+    device_supported: false,
     defaults: [
         "cronet_aml_defaults",
     ],
@@ -1664,12 +1709,14 @@
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
         "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
+        "-UANDROID",
     ],
     local_include_dirs: [
         "./",
         "buildtools/third_party/libc++/",
         "buildtools/third_party/libc++/trunk/include",
         "buildtools/third_party/libc++abi/trunk/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
         "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
@@ -1688,6 +1735,8 @@
         "base/third_party/xdg_mime/xdgmimemagic.c",
         "base/third_party/xdg_mime/xdgmimeparent.c",
     ],
+    host_supported: true,
+    device_supported: false,
     defaults: [
         "cronet_aml_defaults",
     ],
@@ -1709,12 +1758,14 @@
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
         "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
+        "-UANDROID",
     ],
     local_include_dirs: [
         "./",
         "buildtools/third_party/libc++/",
         "buildtools/third_party/libc++/trunk/include",
         "buildtools/third_party/libc++abi/trunk/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
         "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
@@ -1726,6 +1777,8 @@
     srcs: [
         "base/third_party/xdg_user_dirs/xdg_user_dir_lookup.cc",
     ],
+    host_supported: true,
+    device_supported: false,
     defaults: [
         "cronet_aml_defaults",
     ],
@@ -1749,12 +1802,14 @@
         "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D__STDC_CONSTANT_MACROS",
         "-D__STDC_FORMAT_MACROS",
+        "-UANDROID",
     ],
     local_include_dirs: [
         "./",
         "buildtools/third_party/libc++/",
         "buildtools/third_party/libc++/trunk/include",
         "buildtools/third_party/libc++abi/trunk/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
         "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
@@ -1763,7 +1818,7 @@
 // GN: //base:tracing_buildflags
 genrule {
     name: "cronet_aml_base_tracing_buildflags",
-    cmd: "echo '--flags ENABLE_BASE_TRACING=\"false\" USE_PERFETTO_CLIENT_LIBRARY=\"false\" OPTIONAL_TRACE_EVENTS_ENABLED=\"false\"' | " +
+    cmd: "echo '--flags ENABLE_BASE_TRACING=\"false\" USE_PERFETTO_CLIENT_LIBRARY=\"false\" OPTIONAL_TRACE_EVENTS_ENABLED=\"true\"' | " +
          "$(location build/write_buildflag_header.py) --output " +
          "$(out) " +
          "--rulename " +
@@ -1848,7 +1903,7 @@
 // GN: //build/config/compiler:compiler_buildflags
 genrule {
     name: "cronet_aml_build_config_compiler_compiler_buildflags",
-    cmd: "echo '--flags CLANG_PGO=\"0\" SYMBOL_LEVEL=\"1\"' | " +
+    cmd: "echo '--flags CLANG_PGO=\"0\" SYMBOL_LEVEL=\"2\"' | " +
          "$(location build/write_buildflag_header.py) --output " +
          "$(out) " +
          "--rulename " +
@@ -1918,7 +1973,6 @@
 filegroup {
     name: "cronet_aml_buildtools_third_party_libc__abi_libc__abi",
     srcs: [
-        "buildtools/third_party/libc++abi/cxa_demangle_stub.cc",
         "buildtools/third_party/libc++abi/trunk/src/abort_message.cpp",
         "buildtools/third_party/libc++abi/trunk/src/cxa_aux_runtime.cpp",
         "buildtools/third_party/libc++abi/trunk/src/cxa_default_handlers.cpp",
@@ -2002,17 +2056,24 @@
         "cronet_aml_base_base_static",
         "cronet_aml_base_third_party_double_conversion_double_conversion",
         "cronet_aml_base_third_party_dynamic_annotations_dynamic_annotations",
+        "cronet_aml_base_third_party_symbolize_symbolize",
+        "cronet_aml_base_third_party_xdg_mime_xdg_mime",
+        "cronet_aml_base_third_party_xdg_user_dirs_xdg_user_dirs",
         "cronet_aml_components_prefs_prefs",
+        "cronet_aml_crypto_crypto",
         "cronet_aml_net_net",
+        "cronet_aml_net_preload_decoder",
         "cronet_aml_net_third_party_quiche_quiche",
         "cronet_aml_net_uri_template",
+        "cronet_aml_third_party_boringssl_boringssl",
+        "cronet_aml_third_party_brotli_common",
+        "cronet_aml_third_party_brotli_dec",
         "cronet_aml_third_party_icu_icui18n",
         "cronet_aml_third_party_icu_icuuc_private",
         "cronet_aml_third_party_libevent_libevent",
         "cronet_aml_third_party_modp_b64_modp_b64",
         "cronet_aml_third_party_zlib_zlib",
         "cronet_aml_url_url",
-        "libssl",
     ],
     generated_headers: [
         "cronet_aml_base_debugging_buildflags",
@@ -2331,6 +2392,26 @@
     ],
 }
 
+// GN: //components/nacl/common:buildflags
+genrule {
+    name: "cronet_aml_components_nacl_common_buildflags",
+    cmd: "echo '--flags ENABLE_NACL=\"true\" IS_MINIMAL_TOOLCHAIN=\"false\"' | " +
+         "$(location build/write_buildflag_header.py) --output " +
+         "$(out) " +
+         "--rulename " +
+         "//components/nacl/common:buildflags " +
+         "--gen-dir " +
+         ". " +
+         "--definitions " +
+         "/dev/stdin",
+    out: [
+        "components/nacl/common/buildflags.h",
+    ],
+    tool_files: [
+        "build/write_buildflag_header.py",
+    ],
+}
+
 // GN: //components/prefs/android:jni_headers
 genrule {
     name: "cronet_aml_components_prefs_android_jni_headers",
@@ -2398,11 +2479,11 @@
         "cronet_aml_base_base_static",
         "cronet_aml_base_third_party_double_conversion_double_conversion",
         "cronet_aml_base_third_party_dynamic_annotations_dynamic_annotations",
+        "cronet_aml_third_party_boringssl_boringssl",
         "cronet_aml_third_party_icu_icui18n",
         "cronet_aml_third_party_icu_icuuc_private",
         "cronet_aml_third_party_libevent_libevent",
         "cronet_aml_third_party_modp_b64_modp_b64",
-        "libssl",
     ],
     generated_headers: [
         "cronet_aml_base_debugging_buildflags",
@@ -2455,7 +2536,7 @@
 // GN: //crypto:buildflags
 genrule {
     name: "cronet_aml_crypto_buildflags",
-    cmd: "echo '--flags USE_NSS_CERTS=\"false\"' | " +
+    cmd: "echo '--flags USE_NSS_CERTS=\"true\"' | " +
          "$(location build/write_buildflag_header.py) --output " +
          "$(out) " +
          "--rulename " +
@@ -2496,26 +2577,30 @@
         "crypto/unexportable_key.cc",
         "crypto/unexportable_key_metrics.cc",
     ],
-    shared_libs: [
-        "libandroid",
-        "liblog",
-    ],
     static_libs: [
         "cronet_aml_base_allocator_partition_allocator_partition_alloc",
         "cronet_aml_base_base",
         "cronet_aml_base_base_static",
         "cronet_aml_base_third_party_double_conversion_double_conversion",
         "cronet_aml_base_third_party_dynamic_annotations_dynamic_annotations",
+        "cronet_aml_base_third_party_symbolize_symbolize",
+        "cronet_aml_base_third_party_xdg_mime_xdg_mime",
+        "cronet_aml_base_third_party_xdg_user_dirs_xdg_user_dirs",
+        "cronet_aml_third_party_boringssl_boringssl",
         "cronet_aml_third_party_icu_icui18n",
         "cronet_aml_third_party_icu_icuuc_private",
         "cronet_aml_third_party_libevent_libevent",
         "cronet_aml_third_party_modp_b64_modp_b64",
-        "libssl",
     ],
+    host_supported: true,
     generated_headers: [
+        "cronet_aml_build_chromeos_buildflags",
+        "cronet_aml_components_nacl_common_buildflags",
         "cronet_aml_crypto_buildflags",
     ],
     export_generated_headers: [
+        "cronet_aml_build_chromeos_buildflags",
+        "cronet_aml_components_nacl_common_buildflags",
         "cronet_aml_crypto_buildflags",
     ],
     defaults: [
@@ -2527,11 +2612,18 @@
         "-DCRYPTO_IMPLEMENTATION",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
         "-DHAVE_SYS_UIO_H",
+        "-DUSE_AURA=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -2541,14 +2633,26 @@
     ],
     local_include_dirs: [
         "./",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/nspr",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/nss",
         "buildtools/third_party/libc++/",
         "buildtools/third_party/libc++/trunk/include",
         "buildtools/third_party/libc++abi/trunk/include",
         "third_party/abseil-cpp/",
         "third_party/boringssl/src/include/",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
+    target: {
+        android: {
+            shared_libs: [
+                "libandroid",
+                "liblog",
+            ],
+        },
+    },
 }
 
 // GN: //gn:default_deps
@@ -2557,6 +2661,7 @@
     cflags: [
         "-DGOOGLE_PROTOBUF_NO_RTTI",
         "-O2",
+        "-Wno-ambiguous-reversed-operator",
         "-Wno-deprecated-non-prototype",
         "-Wno-error=return-type",
         "-Wno-macro-redefined",
@@ -2564,6 +2669,7 @@
         "-Wno-non-virtual-dtor",
         "-Wno-sign-compare",
         "-Wno-sign-promo",
+        "-Wno-unreachable-code-loop-increment",
         "-Wno-unused-parameter",
         "-fvisibility=hidden",
     ],
@@ -2674,41 +2780,6 @@
     ],
 }
 
-// GN: //net/cert:root_store_proto_full
-genrule {
-    name: "cronet_aml_net_cert_root_store_proto_full_gen",
-    srcs: [
-        "net/cert/root_store.proto",
-    ],
-    tools: [
-        "aprotoc",
-    ],
-    cmd: "$(location aprotoc) --proto_path=external/chromium_org/net/cert --cpp_out=lite=true:$(genDir)/external/chromium_org/net/cert/ $(in)",
-    out: [
-        "external/chromium_org/net/cert/root_store.pb.cc",
-    ],
-}
-
-// GN: //net/cert:root_store_proto_full
-genrule {
-    name: "cronet_aml_net_cert_root_store_proto_full_gen_headers",
-    srcs: [
-        "net/cert/root_store.proto",
-    ],
-    tools: [
-        "aprotoc",
-    ],
-    cmd: "$(location aprotoc) --proto_path=external/chromium_org/net/cert --cpp_out=lite=true:$(genDir)/external/chromium_org/net/cert/ $(in)",
-    out: [
-        "external/chromium_org/net/cert/root_store.pb.h",
-    ],
-    export_include_dirs: [
-        ".",
-        "net/cert",
-        "protos",
-    ],
-}
-
 // GN: //net:constants
 filegroup {
     name: "cronet_aml_net_constants",
@@ -3393,10 +3464,14 @@
         "cronet_aml_base_base_static",
         "cronet_aml_base_third_party_double_conversion_double_conversion",
         "cronet_aml_base_third_party_dynamic_annotations_dynamic_annotations",
+        "cronet_aml_base_third_party_symbolize_symbolize",
+        "cronet_aml_base_third_party_xdg_mime_xdg_mime",
+        "cronet_aml_base_third_party_xdg_user_dirs_xdg_user_dirs",
         "cronet_aml_crypto_crypto",
         "cronet_aml_net_preload_decoder",
         "cronet_aml_net_third_party_quiche_quiche",
         "cronet_aml_net_uri_template",
+        "cronet_aml_third_party_boringssl_boringssl",
         "cronet_aml_third_party_brotli_common",
         "cronet_aml_third_party_brotli_dec",
         "cronet_aml_third_party_icu_icui18n",
@@ -3405,7 +3480,7 @@
         "cronet_aml_third_party_modp_b64_modp_b64",
         "cronet_aml_third_party_zlib_zlib",
         "cronet_aml_url_url",
-        "libssl",
+        "libprotobuf-cpp-lite",
     ],
     generated_headers: [
         "cronet_aml_base_debugging_buildflags",
@@ -3655,11 +3730,11 @@
         "cronet_aml_base_base_static",
         "cronet_aml_base_third_party_double_conversion_double_conversion",
         "cronet_aml_base_third_party_dynamic_annotations_dynamic_annotations",
+        "cronet_aml_third_party_boringssl_boringssl",
         "cronet_aml_third_party_icu_icui18n",
         "cronet_aml_third_party_icu_icuuc_private",
         "cronet_aml_third_party_libevent_libevent",
         "cronet_aml_third_party_modp_b64_modp_b64",
-        "libssl",
     ],
     defaults: [
         "cronet_aml_defaults",
@@ -4179,13 +4254,14 @@
         "cronet_aml_base_third_party_double_conversion_double_conversion",
         "cronet_aml_base_third_party_dynamic_annotations_dynamic_annotations",
         "cronet_aml_net_uri_template",
+        "cronet_aml_third_party_boringssl_boringssl",
         "cronet_aml_third_party_icu_icui18n",
         "cronet_aml_third_party_icu_icuuc_private",
         "cronet_aml_third_party_libevent_libevent",
         "cronet_aml_third_party_modp_b64_modp_b64",
         "cronet_aml_third_party_zlib_zlib",
         "cronet_aml_url_url",
-        "libssl",
+        "libprotobuf-cpp-lite",
     ],
     generated_headers: [
         "cronet_aml_build_chromeos_buildflags",
@@ -4237,87 +4313,6 @@
     cpp_std: "c++20",
 }
 
-// GN: //net/tools/root_store_tool:root_store_tool
-cc_binary {
-    name: "cronet_aml_net_tools_root_store_tool_root_store_tool",
-    srcs: [
-        ":cronet_aml_buildtools_third_party_libc___libc__",
-        ":cronet_aml_buildtools_third_party_libc__abi_libc__abi",
-        ":cronet_aml_net_cert_root_store_proto_full_gen",
-        "net/tools/root_store_tool/root_store_tool.cc",
-    ],
-    shared_libs: [
-        "libprotobuf-cpp-lite",
-    ],
-    static_libs: [
-        "cronet_aml_base_allocator_partition_allocator_partition_alloc",
-        "cronet_aml_base_base",
-        "cronet_aml_base_base_static",
-        "cronet_aml_base_third_party_double_conversion_double_conversion",
-        "cronet_aml_base_third_party_dynamic_annotations_dynamic_annotations",
-        "cronet_aml_base_third_party_symbolize_symbolize",
-        "cronet_aml_base_third_party_xdg_mime_xdg_mime",
-        "cronet_aml_base_third_party_xdg_user_dirs_xdg_user_dirs",
-        "cronet_aml_crypto_crypto",
-        "cronet_aml_third_party_icu_icui18n",
-        "cronet_aml_third_party_icu_icuuc_private",
-        "cronet_aml_third_party_libevent_libevent",
-        "cronet_aml_third_party_modp_b64_modp_b64",
-        "libssl",
-    ],
-    generated_headers: [
-        "cronet_aml_net_cert_root_store_proto_full_gen_headers",
-    ],
-    defaults: [
-        "cronet_aml_defaults",
-    ],
-    cflags: [
-        "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
-        "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
-        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
-        "-DDCHECK_ALWAYS_ON=1",
-        "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
-        "-DGOOGLE_PROTOBUF_INTERNAL_DONATE_STEAL_INLINE=0",
-        "-DGOOGLE_PROTOBUF_NO_RTTI",
-        "-DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER",
-        "-DHAVE_PTHREAD",
-        "-DLIBCXXABI_SILENT_TERMINATE",
-        "-DLIBCXX_BUILDING_LIBCXXABI",
-        "-DUSE_AURA=1",
-        "-DUSE_OZONE=1",
-        "-DUSE_UDEV",
-        "-D_DEBUG",
-        "-D_FILE_OFFSET_BITS=64",
-        "-D_GNU_SOURCE",
-        "-D_LARGEFILE64_SOURCE",
-        "-D_LARGEFILE_SOURCE",
-        "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
-        "-D_LIBCPP_BUILDING_LIBRARY",
-        "-D_LIBCPP_CONSTINIT=constinit",
-        "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
-        "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
-        "-D_LIBCPP_OVERRIDABLE_FUNC_VIS=__attribute__((__visibility__(\"default\")))",
-        "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
-        "-D__STDC_CONSTANT_MACROS",
-        "-D__STDC_FORMAT_MACROS",
-    ],
-    local_include_dirs: [
-        "./",
-        "buildtools/third_party/libc++/",
-        "buildtools/third_party/libc++/trunk/include",
-        "buildtools/third_party/libc++/trunk/src/",
-        "buildtools/third_party/libc++abi/trunk/include",
-        "third_party/abseil-cpp/",
-        "third_party/boringssl/src/include/",
-        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
-    ],
-    cpp_std: "c++20",
-    cppflags: [
-        "-fexceptions",
-    ],
-    rtti: true,
-}
-
 // GN: //net/traffic_annotation:traffic_annotation
 filegroup {
     name: "cronet_aml_net_traffic_annotation_traffic_annotation",
@@ -4342,11 +4337,11 @@
         "cronet_aml_base_base_static",
         "cronet_aml_base_third_party_double_conversion_double_conversion",
         "cronet_aml_base_third_party_dynamic_annotations_dynamic_annotations",
+        "cronet_aml_third_party_boringssl_boringssl",
         "cronet_aml_third_party_icu_icui18n",
         "cronet_aml_third_party_icu_icuuc_private",
         "cronet_aml_third_party_libevent_libevent",
         "cronet_aml_third_party_modp_b64_modp_b64",
-        "libssl",
     ],
     defaults: [
         "cronet_aml_defaults",
@@ -5148,6 +5143,659 @@
     ],
 }
 
+// GN: //third_party/boringssl:boringssl
+cc_library_static {
+    name: "cronet_aml_third_party_boringssl_boringssl",
+    host_supported: true,
+    defaults: [
+        "cronet_aml_defaults",
+    ],
+    cflags: [
+        "-DANDROID",
+        "-DANDROID_NDK_VERSION_ROLL=r23_1",
+        "-DBORINGSSL_ALLOW_CXX_RUNTIME",
+        "-DBORINGSSL_IMPLEMENTATION",
+        "-DBORINGSSL_NO_STATIC_INITIALIZER",
+        "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
+        "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
+        "-DDCHECK_ALWAYS_ON=1",
+        "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
+        "-DHAVE_SYS_UIO_H",
+        "-DOPENSSL_SMALL",
+        "-DUSE_AURA=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
+        "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
+        "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
+        "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
+        "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
+        "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
+        "-D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS",
+        "-D__STDC_CONSTANT_MACROS",
+        "-D__STDC_FORMAT_MACROS",
+    ],
+    local_include_dirs: [
+        "./",
+        "buildtools/third_party/libc++/",
+        "buildtools/third_party/libc++/trunk/include",
+        "buildtools/third_party/libc++abi/trunk/include",
+        "third_party/boringssl/src/include/",
+        "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
+    ],
+    cpp_std: "c++20",
+    arch: {
+        x86: {
+            srcs: [
+                ":cronet_aml_third_party_boringssl_boringssl_asm_x86",
+                ":cronet_aml_third_party_boringssl_src_third_party_fiat_fiat_license",
+                "third_party/boringssl/err_data.c",
+                "third_party/boringssl/src/crypto/asn1/a_bitstr.c",
+                "third_party/boringssl/src/crypto/asn1/a_bool.c",
+                "third_party/boringssl/src/crypto/asn1/a_d2i_fp.c",
+                "third_party/boringssl/src/crypto/asn1/a_dup.c",
+                "third_party/boringssl/src/crypto/asn1/a_gentm.c",
+                "third_party/boringssl/src/crypto/asn1/a_i2d_fp.c",
+                "third_party/boringssl/src/crypto/asn1/a_int.c",
+                "third_party/boringssl/src/crypto/asn1/a_mbstr.c",
+                "third_party/boringssl/src/crypto/asn1/a_object.c",
+                "third_party/boringssl/src/crypto/asn1/a_octet.c",
+                "third_party/boringssl/src/crypto/asn1/a_print.c",
+                "third_party/boringssl/src/crypto/asn1/a_strex.c",
+                "third_party/boringssl/src/crypto/asn1/a_strnid.c",
+                "third_party/boringssl/src/crypto/asn1/a_time.c",
+                "third_party/boringssl/src/crypto/asn1/a_type.c",
+                "third_party/boringssl/src/crypto/asn1/a_utctm.c",
+                "third_party/boringssl/src/crypto/asn1/a_utf8.c",
+                "third_party/boringssl/src/crypto/asn1/asn1_lib.c",
+                "third_party/boringssl/src/crypto/asn1/asn1_par.c",
+                "third_party/boringssl/src/crypto/asn1/asn_pack.c",
+                "third_party/boringssl/src/crypto/asn1/f_int.c",
+                "third_party/boringssl/src/crypto/asn1/f_string.c",
+                "third_party/boringssl/src/crypto/asn1/posix_time.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_dec.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_enc.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_fre.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_new.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_typ.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_utl.c",
+                "third_party/boringssl/src/crypto/base64/base64.c",
+                "third_party/boringssl/src/crypto/bio/bio.c",
+                "third_party/boringssl/src/crypto/bio/bio_mem.c",
+                "third_party/boringssl/src/crypto/bio/connect.c",
+                "third_party/boringssl/src/crypto/bio/fd.c",
+                "third_party/boringssl/src/crypto/bio/file.c",
+                "third_party/boringssl/src/crypto/bio/hexdump.c",
+                "third_party/boringssl/src/crypto/bio/pair.c",
+                "third_party/boringssl/src/crypto/bio/printf.c",
+                "third_party/boringssl/src/crypto/bio/socket.c",
+                "third_party/boringssl/src/crypto/bio/socket_helper.c",
+                "third_party/boringssl/src/crypto/blake2/blake2.c",
+                "third_party/boringssl/src/crypto/bn_extra/bn_asn1.c",
+                "third_party/boringssl/src/crypto/bn_extra/convert.c",
+                "third_party/boringssl/src/crypto/buf/buf.c",
+                "third_party/boringssl/src/crypto/bytestring/asn1_compat.c",
+                "third_party/boringssl/src/crypto/bytestring/ber.c",
+                "third_party/boringssl/src/crypto/bytestring/cbb.c",
+                "third_party/boringssl/src/crypto/bytestring/cbs.c",
+                "third_party/boringssl/src/crypto/bytestring/unicode.c",
+                "third_party/boringssl/src/crypto/chacha/chacha.c",
+                "third_party/boringssl/src/crypto/cipher_extra/cipher_extra.c",
+                "third_party/boringssl/src/crypto/cipher_extra/derive_key.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_aesctrhmac.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_chacha20poly1305.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_des.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_null.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_rc2.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_rc4.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_tls.c",
+                "third_party/boringssl/src/crypto/cipher_extra/tls_cbc.c",
+                "third_party/boringssl/src/crypto/conf/conf.c",
+                "third_party/boringssl/src/crypto/cpu_aarch64_apple.c",
+                "third_party/boringssl/src/crypto/cpu_aarch64_fuchsia.c",
+                "third_party/boringssl/src/crypto/cpu_aarch64_linux.c",
+                "third_party/boringssl/src/crypto/cpu_aarch64_win.c",
+                "third_party/boringssl/src/crypto/cpu_arm.c",
+                "third_party/boringssl/src/crypto/cpu_arm_linux.c",
+                "third_party/boringssl/src/crypto/cpu_intel.c",
+                "third_party/boringssl/src/crypto/cpu_ppc64le.c",
+                "third_party/boringssl/src/crypto/crypto.c",
+                "third_party/boringssl/src/crypto/curve25519/curve25519.c",
+                "third_party/boringssl/src/crypto/curve25519/spake25519.c",
+                "third_party/boringssl/src/crypto/des/des.c",
+                "third_party/boringssl/src/crypto/dh_extra/dh_asn1.c",
+                "third_party/boringssl/src/crypto/dh_extra/params.c",
+                "third_party/boringssl/src/crypto/digest_extra/digest_extra.c",
+                "third_party/boringssl/src/crypto/dsa/dsa.c",
+                "third_party/boringssl/src/crypto/dsa/dsa_asn1.c",
+                "third_party/boringssl/src/crypto/ec_extra/ec_asn1.c",
+                "third_party/boringssl/src/crypto/ec_extra/ec_derive.c",
+                "third_party/boringssl/src/crypto/ec_extra/hash_to_curve.c",
+                "third_party/boringssl/src/crypto/ecdh_extra/ecdh_extra.c",
+                "third_party/boringssl/src/crypto/ecdsa_extra/ecdsa_asn1.c",
+                "third_party/boringssl/src/crypto/engine/engine.c",
+                "third_party/boringssl/src/crypto/err/err.c",
+                "third_party/boringssl/src/crypto/evp/evp.c",
+                "third_party/boringssl/src/crypto/evp/evp_asn1.c",
+                "third_party/boringssl/src/crypto/evp/evp_ctx.c",
+                "third_party/boringssl/src/crypto/evp/p_dsa_asn1.c",
+                "third_party/boringssl/src/crypto/evp/p_ec.c",
+                "third_party/boringssl/src/crypto/evp/p_ec_asn1.c",
+                "third_party/boringssl/src/crypto/evp/p_ed25519.c",
+                "third_party/boringssl/src/crypto/evp/p_ed25519_asn1.c",
+                "third_party/boringssl/src/crypto/evp/p_hkdf.c",
+                "third_party/boringssl/src/crypto/evp/p_rsa.c",
+                "third_party/boringssl/src/crypto/evp/p_rsa_asn1.c",
+                "third_party/boringssl/src/crypto/evp/p_x25519.c",
+                "third_party/boringssl/src/crypto/evp/p_x25519_asn1.c",
+                "third_party/boringssl/src/crypto/evp/pbkdf.c",
+                "third_party/boringssl/src/crypto/evp/print.c",
+                "third_party/boringssl/src/crypto/evp/scrypt.c",
+                "third_party/boringssl/src/crypto/evp/sign.c",
+                "third_party/boringssl/src/crypto/ex_data.c",
+                "third_party/boringssl/src/crypto/fipsmodule/bcm.c",
+                "third_party/boringssl/src/crypto/fipsmodule/fips_shared_support.c",
+                "third_party/boringssl/src/crypto/hkdf/hkdf.c",
+                "third_party/boringssl/src/crypto/hpke/hpke.c",
+                "third_party/boringssl/src/crypto/hrss/hrss.c",
+                "third_party/boringssl/src/crypto/lhash/lhash.c",
+                "third_party/boringssl/src/crypto/mem.c",
+                "third_party/boringssl/src/crypto/obj/obj.c",
+                "third_party/boringssl/src/crypto/obj/obj_xref.c",
+                "third_party/boringssl/src/crypto/pem/pem_all.c",
+                "third_party/boringssl/src/crypto/pem/pem_info.c",
+                "third_party/boringssl/src/crypto/pem/pem_lib.c",
+                "third_party/boringssl/src/crypto/pem/pem_oth.c",
+                "third_party/boringssl/src/crypto/pem/pem_pk8.c",
+                "third_party/boringssl/src/crypto/pem/pem_pkey.c",
+                "third_party/boringssl/src/crypto/pem/pem_x509.c",
+                "third_party/boringssl/src/crypto/pem/pem_xaux.c",
+                "third_party/boringssl/src/crypto/pkcs7/pkcs7.c",
+                "third_party/boringssl/src/crypto/pkcs7/pkcs7_x509.c",
+                "third_party/boringssl/src/crypto/pkcs8/p5_pbev2.c",
+                "third_party/boringssl/src/crypto/pkcs8/pkcs8.c",
+                "third_party/boringssl/src/crypto/pkcs8/pkcs8_x509.c",
+                "third_party/boringssl/src/crypto/poly1305/poly1305.c",
+                "third_party/boringssl/src/crypto/poly1305/poly1305_arm.c",
+                "third_party/boringssl/src/crypto/poly1305/poly1305_vec.c",
+                "third_party/boringssl/src/crypto/pool/pool.c",
+                "third_party/boringssl/src/crypto/rand_extra/deterministic.c",
+                "third_party/boringssl/src/crypto/rand_extra/forkunsafe.c",
+                "third_party/boringssl/src/crypto/rand_extra/fuchsia.c",
+                "third_party/boringssl/src/crypto/rand_extra/passive.c",
+                "third_party/boringssl/src/crypto/rand_extra/rand_extra.c",
+                "third_party/boringssl/src/crypto/rand_extra/windows.c",
+                "third_party/boringssl/src/crypto/rc4/rc4.c",
+                "third_party/boringssl/src/crypto/refcount_c11.c",
+                "third_party/boringssl/src/crypto/refcount_lock.c",
+                "third_party/boringssl/src/crypto/rsa_extra/rsa_asn1.c",
+                "third_party/boringssl/src/crypto/rsa_extra/rsa_print.c",
+                "third_party/boringssl/src/crypto/siphash/siphash.c",
+                "third_party/boringssl/src/crypto/stack/stack.c",
+                "third_party/boringssl/src/crypto/thread.c",
+                "third_party/boringssl/src/crypto/thread_none.c",
+                "third_party/boringssl/src/crypto/thread_pthread.c",
+                "third_party/boringssl/src/crypto/thread_win.c",
+                "third_party/boringssl/src/crypto/trust_token/pmbtoken.c",
+                "third_party/boringssl/src/crypto/trust_token/trust_token.c",
+                "third_party/boringssl/src/crypto/trust_token/voprf.c",
+                "third_party/boringssl/src/crypto/x509/a_digest.c",
+                "third_party/boringssl/src/crypto/x509/a_sign.c",
+                "third_party/boringssl/src/crypto/x509/a_verify.c",
+                "third_party/boringssl/src/crypto/x509/algorithm.c",
+                "third_party/boringssl/src/crypto/x509/asn1_gen.c",
+                "third_party/boringssl/src/crypto/x509/by_dir.c",
+                "third_party/boringssl/src/crypto/x509/by_file.c",
+                "third_party/boringssl/src/crypto/x509/i2d_pr.c",
+                "third_party/boringssl/src/crypto/x509/name_print.c",
+                "third_party/boringssl/src/crypto/x509/rsa_pss.c",
+                "third_party/boringssl/src/crypto/x509/t_crl.c",
+                "third_party/boringssl/src/crypto/x509/t_req.c",
+                "third_party/boringssl/src/crypto/x509/t_x509.c",
+                "third_party/boringssl/src/crypto/x509/t_x509a.c",
+                "third_party/boringssl/src/crypto/x509/x509.c",
+                "third_party/boringssl/src/crypto/x509/x509_att.c",
+                "third_party/boringssl/src/crypto/x509/x509_cmp.c",
+                "third_party/boringssl/src/crypto/x509/x509_d2.c",
+                "third_party/boringssl/src/crypto/x509/x509_def.c",
+                "third_party/boringssl/src/crypto/x509/x509_ext.c",
+                "third_party/boringssl/src/crypto/x509/x509_lu.c",
+                "third_party/boringssl/src/crypto/x509/x509_obj.c",
+                "third_party/boringssl/src/crypto/x509/x509_req.c",
+                "third_party/boringssl/src/crypto/x509/x509_set.c",
+                "third_party/boringssl/src/crypto/x509/x509_trs.c",
+                "third_party/boringssl/src/crypto/x509/x509_txt.c",
+                "third_party/boringssl/src/crypto/x509/x509_v3.c",
+                "third_party/boringssl/src/crypto/x509/x509_vfy.c",
+                "third_party/boringssl/src/crypto/x509/x509_vpm.c",
+                "third_party/boringssl/src/crypto/x509/x509cset.c",
+                "third_party/boringssl/src/crypto/x509/x509name.c",
+                "third_party/boringssl/src/crypto/x509/x509rset.c",
+                "third_party/boringssl/src/crypto/x509/x509spki.c",
+                "third_party/boringssl/src/crypto/x509/x_algor.c",
+                "third_party/boringssl/src/crypto/x509/x_all.c",
+                "third_party/boringssl/src/crypto/x509/x_attrib.c",
+                "third_party/boringssl/src/crypto/x509/x_crl.c",
+                "third_party/boringssl/src/crypto/x509/x_exten.c",
+                "third_party/boringssl/src/crypto/x509/x_info.c",
+                "third_party/boringssl/src/crypto/x509/x_name.c",
+                "third_party/boringssl/src/crypto/x509/x_pkey.c",
+                "third_party/boringssl/src/crypto/x509/x_pubkey.c",
+                "third_party/boringssl/src/crypto/x509/x_req.c",
+                "third_party/boringssl/src/crypto/x509/x_sig.c",
+                "third_party/boringssl/src/crypto/x509/x_spki.c",
+                "third_party/boringssl/src/crypto/x509/x_val.c",
+                "third_party/boringssl/src/crypto/x509/x_x509.c",
+                "third_party/boringssl/src/crypto/x509/x_x509a.c",
+                "third_party/boringssl/src/crypto/x509v3/pcy_cache.c",
+                "third_party/boringssl/src/crypto/x509v3/pcy_data.c",
+                "third_party/boringssl/src/crypto/x509v3/pcy_map.c",
+                "third_party/boringssl/src/crypto/x509v3/pcy_node.c",
+                "third_party/boringssl/src/crypto/x509v3/pcy_tree.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_akey.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_akeya.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_alt.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_bcons.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_bitst.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_conf.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_cpols.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_crld.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_enum.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_extku.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_genn.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_ia5.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_info.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_int.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_lib.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_ncons.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_ocsp.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_pci.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_pcia.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_pcons.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_pmaps.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_prn.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_purp.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_skey.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_utl.c",
+                "third_party/boringssl/src/ssl/bio_ssl.cc",
+                "third_party/boringssl/src/ssl/d1_both.cc",
+                "third_party/boringssl/src/ssl/d1_lib.cc",
+                "third_party/boringssl/src/ssl/d1_pkt.cc",
+                "third_party/boringssl/src/ssl/d1_srtp.cc",
+                "third_party/boringssl/src/ssl/dtls_method.cc",
+                "third_party/boringssl/src/ssl/dtls_record.cc",
+                "third_party/boringssl/src/ssl/encrypted_client_hello.cc",
+                "third_party/boringssl/src/ssl/extensions.cc",
+                "third_party/boringssl/src/ssl/handoff.cc",
+                "third_party/boringssl/src/ssl/handshake.cc",
+                "third_party/boringssl/src/ssl/handshake_client.cc",
+                "third_party/boringssl/src/ssl/handshake_server.cc",
+                "third_party/boringssl/src/ssl/s3_both.cc",
+                "third_party/boringssl/src/ssl/s3_lib.cc",
+                "third_party/boringssl/src/ssl/s3_pkt.cc",
+                "third_party/boringssl/src/ssl/ssl_aead_ctx.cc",
+                "third_party/boringssl/src/ssl/ssl_asn1.cc",
+                "third_party/boringssl/src/ssl/ssl_buffer.cc",
+                "third_party/boringssl/src/ssl/ssl_cert.cc",
+                "third_party/boringssl/src/ssl/ssl_cipher.cc",
+                "third_party/boringssl/src/ssl/ssl_file.cc",
+                "third_party/boringssl/src/ssl/ssl_key_share.cc",
+                "third_party/boringssl/src/ssl/ssl_lib.cc",
+                "third_party/boringssl/src/ssl/ssl_privkey.cc",
+                "third_party/boringssl/src/ssl/ssl_session.cc",
+                "third_party/boringssl/src/ssl/ssl_stat.cc",
+                "third_party/boringssl/src/ssl/ssl_transcript.cc",
+                "third_party/boringssl/src/ssl/ssl_versions.cc",
+                "third_party/boringssl/src/ssl/ssl_x509.cc",
+                "third_party/boringssl/src/ssl/t1_enc.cc",
+                "third_party/boringssl/src/ssl/tls13_both.cc",
+                "third_party/boringssl/src/ssl/tls13_client.cc",
+                "third_party/boringssl/src/ssl/tls13_enc.cc",
+                "third_party/boringssl/src/ssl/tls13_server.cc",
+                "third_party/boringssl/src/ssl/tls_method.cc",
+                "third_party/boringssl/src/ssl/tls_record.cc",
+            ],
+        },
+        x86_64: {
+            srcs: [
+                ":cronet_aml_third_party_boringssl_boringssl_asm",
+                ":cronet_aml_third_party_boringssl_src_third_party_fiat_fiat_license",
+                "third_party/boringssl/err_data.c",
+                "third_party/boringssl/src/crypto/asn1/a_bitstr.c",
+                "third_party/boringssl/src/crypto/asn1/a_bool.c",
+                "third_party/boringssl/src/crypto/asn1/a_d2i_fp.c",
+                "third_party/boringssl/src/crypto/asn1/a_dup.c",
+                "third_party/boringssl/src/crypto/asn1/a_gentm.c",
+                "third_party/boringssl/src/crypto/asn1/a_i2d_fp.c",
+                "third_party/boringssl/src/crypto/asn1/a_int.c",
+                "third_party/boringssl/src/crypto/asn1/a_mbstr.c",
+                "third_party/boringssl/src/crypto/asn1/a_object.c",
+                "third_party/boringssl/src/crypto/asn1/a_octet.c",
+                "third_party/boringssl/src/crypto/asn1/a_print.c",
+                "third_party/boringssl/src/crypto/asn1/a_strex.c",
+                "third_party/boringssl/src/crypto/asn1/a_strnid.c",
+                "third_party/boringssl/src/crypto/asn1/a_time.c",
+                "third_party/boringssl/src/crypto/asn1/a_type.c",
+                "third_party/boringssl/src/crypto/asn1/a_utctm.c",
+                "third_party/boringssl/src/crypto/asn1/a_utf8.c",
+                "third_party/boringssl/src/crypto/asn1/asn1_lib.c",
+                "third_party/boringssl/src/crypto/asn1/asn1_par.c",
+                "third_party/boringssl/src/crypto/asn1/asn_pack.c",
+                "third_party/boringssl/src/crypto/asn1/f_int.c",
+                "third_party/boringssl/src/crypto/asn1/f_string.c",
+                "third_party/boringssl/src/crypto/asn1/posix_time.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_dec.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_enc.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_fre.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_new.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_typ.c",
+                "third_party/boringssl/src/crypto/asn1/tasn_utl.c",
+                "third_party/boringssl/src/crypto/base64/base64.c",
+                "third_party/boringssl/src/crypto/bio/bio.c",
+                "third_party/boringssl/src/crypto/bio/bio_mem.c",
+                "third_party/boringssl/src/crypto/bio/connect.c",
+                "third_party/boringssl/src/crypto/bio/fd.c",
+                "third_party/boringssl/src/crypto/bio/file.c",
+                "third_party/boringssl/src/crypto/bio/hexdump.c",
+                "third_party/boringssl/src/crypto/bio/pair.c",
+                "third_party/boringssl/src/crypto/bio/printf.c",
+                "third_party/boringssl/src/crypto/bio/socket.c",
+                "third_party/boringssl/src/crypto/bio/socket_helper.c",
+                "third_party/boringssl/src/crypto/blake2/blake2.c",
+                "third_party/boringssl/src/crypto/bn_extra/bn_asn1.c",
+                "third_party/boringssl/src/crypto/bn_extra/convert.c",
+                "third_party/boringssl/src/crypto/buf/buf.c",
+                "third_party/boringssl/src/crypto/bytestring/asn1_compat.c",
+                "third_party/boringssl/src/crypto/bytestring/ber.c",
+                "third_party/boringssl/src/crypto/bytestring/cbb.c",
+                "third_party/boringssl/src/crypto/bytestring/cbs.c",
+                "third_party/boringssl/src/crypto/bytestring/unicode.c",
+                "third_party/boringssl/src/crypto/chacha/chacha.c",
+                "third_party/boringssl/src/crypto/cipher_extra/cipher_extra.c",
+                "third_party/boringssl/src/crypto/cipher_extra/derive_key.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_aesctrhmac.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_aesgcmsiv.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_chacha20poly1305.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_des.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_null.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_rc2.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_rc4.c",
+                "third_party/boringssl/src/crypto/cipher_extra/e_tls.c",
+                "third_party/boringssl/src/crypto/cipher_extra/tls_cbc.c",
+                "third_party/boringssl/src/crypto/conf/conf.c",
+                "third_party/boringssl/src/crypto/cpu_aarch64_apple.c",
+                "third_party/boringssl/src/crypto/cpu_aarch64_fuchsia.c",
+                "third_party/boringssl/src/crypto/cpu_aarch64_linux.c",
+                "third_party/boringssl/src/crypto/cpu_aarch64_win.c",
+                "third_party/boringssl/src/crypto/cpu_arm.c",
+                "third_party/boringssl/src/crypto/cpu_arm_linux.c",
+                "third_party/boringssl/src/crypto/cpu_intel.c",
+                "third_party/boringssl/src/crypto/cpu_ppc64le.c",
+                "third_party/boringssl/src/crypto/crypto.c",
+                "third_party/boringssl/src/crypto/curve25519/curve25519.c",
+                "third_party/boringssl/src/crypto/curve25519/spake25519.c",
+                "third_party/boringssl/src/crypto/des/des.c",
+                "third_party/boringssl/src/crypto/dh_extra/dh_asn1.c",
+                "third_party/boringssl/src/crypto/dh_extra/params.c",
+                "third_party/boringssl/src/crypto/digest_extra/digest_extra.c",
+                "third_party/boringssl/src/crypto/dsa/dsa.c",
+                "third_party/boringssl/src/crypto/dsa/dsa_asn1.c",
+                "third_party/boringssl/src/crypto/ec_extra/ec_asn1.c",
+                "third_party/boringssl/src/crypto/ec_extra/ec_derive.c",
+                "third_party/boringssl/src/crypto/ec_extra/hash_to_curve.c",
+                "third_party/boringssl/src/crypto/ecdh_extra/ecdh_extra.c",
+                "third_party/boringssl/src/crypto/ecdsa_extra/ecdsa_asn1.c",
+                "third_party/boringssl/src/crypto/engine/engine.c",
+                "third_party/boringssl/src/crypto/err/err.c",
+                "third_party/boringssl/src/crypto/evp/evp.c",
+                "third_party/boringssl/src/crypto/evp/evp_asn1.c",
+                "third_party/boringssl/src/crypto/evp/evp_ctx.c",
+                "third_party/boringssl/src/crypto/evp/p_dsa_asn1.c",
+                "third_party/boringssl/src/crypto/evp/p_ec.c",
+                "third_party/boringssl/src/crypto/evp/p_ec_asn1.c",
+                "third_party/boringssl/src/crypto/evp/p_ed25519.c",
+                "third_party/boringssl/src/crypto/evp/p_ed25519_asn1.c",
+                "third_party/boringssl/src/crypto/evp/p_hkdf.c",
+                "third_party/boringssl/src/crypto/evp/p_rsa.c",
+                "third_party/boringssl/src/crypto/evp/p_rsa_asn1.c",
+                "third_party/boringssl/src/crypto/evp/p_x25519.c",
+                "third_party/boringssl/src/crypto/evp/p_x25519_asn1.c",
+                "third_party/boringssl/src/crypto/evp/pbkdf.c",
+                "third_party/boringssl/src/crypto/evp/print.c",
+                "third_party/boringssl/src/crypto/evp/scrypt.c",
+                "third_party/boringssl/src/crypto/evp/sign.c",
+                "third_party/boringssl/src/crypto/ex_data.c",
+                "third_party/boringssl/src/crypto/fipsmodule/bcm.c",
+                "third_party/boringssl/src/crypto/fipsmodule/fips_shared_support.c",
+                "third_party/boringssl/src/crypto/hkdf/hkdf.c",
+                "third_party/boringssl/src/crypto/hpke/hpke.c",
+                "third_party/boringssl/src/crypto/hrss/hrss.c",
+                "third_party/boringssl/src/crypto/lhash/lhash.c",
+                "third_party/boringssl/src/crypto/mem.c",
+                "third_party/boringssl/src/crypto/obj/obj.c",
+                "third_party/boringssl/src/crypto/obj/obj_xref.c",
+                "third_party/boringssl/src/crypto/pem/pem_all.c",
+                "third_party/boringssl/src/crypto/pem/pem_info.c",
+                "third_party/boringssl/src/crypto/pem/pem_lib.c",
+                "third_party/boringssl/src/crypto/pem/pem_oth.c",
+                "third_party/boringssl/src/crypto/pem/pem_pk8.c",
+                "third_party/boringssl/src/crypto/pem/pem_pkey.c",
+                "third_party/boringssl/src/crypto/pem/pem_x509.c",
+                "third_party/boringssl/src/crypto/pem/pem_xaux.c",
+                "third_party/boringssl/src/crypto/pkcs7/pkcs7.c",
+                "third_party/boringssl/src/crypto/pkcs7/pkcs7_x509.c",
+                "third_party/boringssl/src/crypto/pkcs8/p5_pbev2.c",
+                "third_party/boringssl/src/crypto/pkcs8/pkcs8.c",
+                "third_party/boringssl/src/crypto/pkcs8/pkcs8_x509.c",
+                "third_party/boringssl/src/crypto/poly1305/poly1305.c",
+                "third_party/boringssl/src/crypto/poly1305/poly1305_arm.c",
+                "third_party/boringssl/src/crypto/poly1305/poly1305_vec.c",
+                "third_party/boringssl/src/crypto/pool/pool.c",
+                "third_party/boringssl/src/crypto/rand_extra/deterministic.c",
+                "third_party/boringssl/src/crypto/rand_extra/forkunsafe.c",
+                "third_party/boringssl/src/crypto/rand_extra/fuchsia.c",
+                "third_party/boringssl/src/crypto/rand_extra/passive.c",
+                "third_party/boringssl/src/crypto/rand_extra/rand_extra.c",
+                "third_party/boringssl/src/crypto/rand_extra/windows.c",
+                "third_party/boringssl/src/crypto/rc4/rc4.c",
+                "third_party/boringssl/src/crypto/refcount_c11.c",
+                "third_party/boringssl/src/crypto/refcount_lock.c",
+                "third_party/boringssl/src/crypto/rsa_extra/rsa_asn1.c",
+                "third_party/boringssl/src/crypto/rsa_extra/rsa_print.c",
+                "third_party/boringssl/src/crypto/siphash/siphash.c",
+                "third_party/boringssl/src/crypto/stack/stack.c",
+                "third_party/boringssl/src/crypto/thread.c",
+                "third_party/boringssl/src/crypto/thread_none.c",
+                "third_party/boringssl/src/crypto/thread_pthread.c",
+                "third_party/boringssl/src/crypto/thread_win.c",
+                "third_party/boringssl/src/crypto/trust_token/pmbtoken.c",
+                "third_party/boringssl/src/crypto/trust_token/trust_token.c",
+                "third_party/boringssl/src/crypto/trust_token/voprf.c",
+                "third_party/boringssl/src/crypto/x509/a_digest.c",
+                "third_party/boringssl/src/crypto/x509/a_sign.c",
+                "third_party/boringssl/src/crypto/x509/a_verify.c",
+                "third_party/boringssl/src/crypto/x509/algorithm.c",
+                "third_party/boringssl/src/crypto/x509/asn1_gen.c",
+                "third_party/boringssl/src/crypto/x509/by_dir.c",
+                "third_party/boringssl/src/crypto/x509/by_file.c",
+                "third_party/boringssl/src/crypto/x509/i2d_pr.c",
+                "third_party/boringssl/src/crypto/x509/name_print.c",
+                "third_party/boringssl/src/crypto/x509/rsa_pss.c",
+                "third_party/boringssl/src/crypto/x509/t_crl.c",
+                "third_party/boringssl/src/crypto/x509/t_req.c",
+                "third_party/boringssl/src/crypto/x509/t_x509.c",
+                "third_party/boringssl/src/crypto/x509/t_x509a.c",
+                "third_party/boringssl/src/crypto/x509/x509.c",
+                "third_party/boringssl/src/crypto/x509/x509_att.c",
+                "third_party/boringssl/src/crypto/x509/x509_cmp.c",
+                "third_party/boringssl/src/crypto/x509/x509_d2.c",
+                "third_party/boringssl/src/crypto/x509/x509_def.c",
+                "third_party/boringssl/src/crypto/x509/x509_ext.c",
+                "third_party/boringssl/src/crypto/x509/x509_lu.c",
+                "third_party/boringssl/src/crypto/x509/x509_obj.c",
+                "third_party/boringssl/src/crypto/x509/x509_req.c",
+                "third_party/boringssl/src/crypto/x509/x509_set.c",
+                "third_party/boringssl/src/crypto/x509/x509_trs.c",
+                "third_party/boringssl/src/crypto/x509/x509_txt.c",
+                "third_party/boringssl/src/crypto/x509/x509_v3.c",
+                "third_party/boringssl/src/crypto/x509/x509_vfy.c",
+                "third_party/boringssl/src/crypto/x509/x509_vpm.c",
+                "third_party/boringssl/src/crypto/x509/x509cset.c",
+                "third_party/boringssl/src/crypto/x509/x509name.c",
+                "third_party/boringssl/src/crypto/x509/x509rset.c",
+                "third_party/boringssl/src/crypto/x509/x509spki.c",
+                "third_party/boringssl/src/crypto/x509/x_algor.c",
+                "third_party/boringssl/src/crypto/x509/x_all.c",
+                "third_party/boringssl/src/crypto/x509/x_attrib.c",
+                "third_party/boringssl/src/crypto/x509/x_crl.c",
+                "third_party/boringssl/src/crypto/x509/x_exten.c",
+                "third_party/boringssl/src/crypto/x509/x_info.c",
+                "third_party/boringssl/src/crypto/x509/x_name.c",
+                "third_party/boringssl/src/crypto/x509/x_pkey.c",
+                "third_party/boringssl/src/crypto/x509/x_pubkey.c",
+                "third_party/boringssl/src/crypto/x509/x_req.c",
+                "third_party/boringssl/src/crypto/x509/x_sig.c",
+                "third_party/boringssl/src/crypto/x509/x_spki.c",
+                "third_party/boringssl/src/crypto/x509/x_val.c",
+                "third_party/boringssl/src/crypto/x509/x_x509.c",
+                "third_party/boringssl/src/crypto/x509/x_x509a.c",
+                "third_party/boringssl/src/crypto/x509v3/pcy_cache.c",
+                "third_party/boringssl/src/crypto/x509v3/pcy_data.c",
+                "third_party/boringssl/src/crypto/x509v3/pcy_map.c",
+                "third_party/boringssl/src/crypto/x509v3/pcy_node.c",
+                "third_party/boringssl/src/crypto/x509v3/pcy_tree.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_akey.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_akeya.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_alt.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_bcons.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_bitst.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_conf.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_cpols.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_crld.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_enum.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_extku.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_genn.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_ia5.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_info.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_int.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_lib.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_ncons.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_ocsp.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_pci.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_pcia.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_pcons.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_pmaps.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_prn.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_purp.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_skey.c",
+                "third_party/boringssl/src/crypto/x509v3/v3_utl.c",
+                "third_party/boringssl/src/ssl/bio_ssl.cc",
+                "third_party/boringssl/src/ssl/d1_both.cc",
+                "third_party/boringssl/src/ssl/d1_lib.cc",
+                "third_party/boringssl/src/ssl/d1_pkt.cc",
+                "third_party/boringssl/src/ssl/d1_srtp.cc",
+                "third_party/boringssl/src/ssl/dtls_method.cc",
+                "third_party/boringssl/src/ssl/dtls_record.cc",
+                "third_party/boringssl/src/ssl/encrypted_client_hello.cc",
+                "third_party/boringssl/src/ssl/extensions.cc",
+                "third_party/boringssl/src/ssl/handoff.cc",
+                "third_party/boringssl/src/ssl/handshake.cc",
+                "third_party/boringssl/src/ssl/handshake_client.cc",
+                "third_party/boringssl/src/ssl/handshake_server.cc",
+                "third_party/boringssl/src/ssl/s3_both.cc",
+                "third_party/boringssl/src/ssl/s3_lib.cc",
+                "third_party/boringssl/src/ssl/s3_pkt.cc",
+                "third_party/boringssl/src/ssl/ssl_aead_ctx.cc",
+                "third_party/boringssl/src/ssl/ssl_asn1.cc",
+                "third_party/boringssl/src/ssl/ssl_buffer.cc",
+                "third_party/boringssl/src/ssl/ssl_cert.cc",
+                "third_party/boringssl/src/ssl/ssl_cipher.cc",
+                "third_party/boringssl/src/ssl/ssl_file.cc",
+                "third_party/boringssl/src/ssl/ssl_key_share.cc",
+                "third_party/boringssl/src/ssl/ssl_lib.cc",
+                "third_party/boringssl/src/ssl/ssl_privkey.cc",
+                "third_party/boringssl/src/ssl/ssl_session.cc",
+                "third_party/boringssl/src/ssl/ssl_stat.cc",
+                "third_party/boringssl/src/ssl/ssl_transcript.cc",
+                "third_party/boringssl/src/ssl/ssl_versions.cc",
+                "third_party/boringssl/src/ssl/ssl_x509.cc",
+                "third_party/boringssl/src/ssl/t1_enc.cc",
+                "third_party/boringssl/src/ssl/tls13_both.cc",
+                "third_party/boringssl/src/ssl/tls13_client.cc",
+                "third_party/boringssl/src/ssl/tls13_enc.cc",
+                "third_party/boringssl/src/ssl/tls13_server.cc",
+                "third_party/boringssl/src/ssl/tls_method.cc",
+                "third_party/boringssl/src/ssl/tls_record.cc",
+            ],
+        },
+    },
+}
+
+// GN: //third_party/boringssl:boringssl_asm
+filegroup {
+    name: "cronet_aml_third_party_boringssl_boringssl_asm",
+    srcs: [
+        "third_party/boringssl/linux-x86_64/crypto/chacha/chacha-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/md5-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/x86_64-mont.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S",
+        "third_party/boringssl/linux-x86_64/crypto/test/trampoline-x86_64.S",
+        "third_party/boringssl/src/crypto/hrss/asm/poly_rq_mul.S",
+    ],
+}
+
+// GN: //third_party/boringssl:boringssl_asm(//build/toolchain/android:android_clang_x86)
+filegroup {
+    name: "cronet_aml_third_party_boringssl_boringssl_asm___build_toolchain_android_android_clang_x86__x86",
+    srcs: [
+        "third_party/boringssl/linux-x86_64/crypto/chacha/chacha-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/cipher_extra/aes128gcmsiv-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/cipher_extra/chacha20_poly1305_x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/aesni-gcm-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/aesni-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/ghash-ssse3-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/ghash-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/md5-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/p256-x86_64-asm.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/p256_beeu-x86_64-asm.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/rdrand-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/rsaz-avx2.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/sha1-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/sha256-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/sha512-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/vpaes-x86_64.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/x86_64-mont.S",
+        "third_party/boringssl/linux-x86_64/crypto/fipsmodule/x86_64-mont5.S",
+        "third_party/boringssl/linux-x86_64/crypto/test/trampoline-x86_64.S",
+        "third_party/boringssl/src/crypto/hrss/asm/poly_rq_mul.S",
+    ],
+}
+
+// GN: //third_party/boringssl/src/third_party/fiat:fiat_license
+filegroup {
+    name: "cronet_aml_third_party_boringssl_src_third_party_fiat_fiat_license",
+}
+
 // GN: //third_party/brotli:common
 cc_library_static {
     name: "cronet_aml_third_party_brotli_common",
@@ -5488,6 +6136,7 @@
     static_libs: [
         "cronet_aml_third_party_icu_icuuc_private",
     ],
+    host_supported: true,
     defaults: [
         "cronet_aml_defaults",
     ],
@@ -5496,6 +6145,7 @@
         "-DANDROID_NDK_VERSION_ROLL=r23_1",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
         "-DHAVE_DLOPEN=0",
@@ -5503,7 +6153,10 @@
         "-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE",
         "-DUCONFIG_ONLY_HTML_CONVERSION=1",
         "-DUCONFIG_USE_WINDOWS_LCID_MAPPING_API=0",
+        "-DUSE_AURA=1",
         "-DUSE_CHROMIUM_ICU=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
         "-DU_CHARSET_IS_UTF8=1",
         "-DU_ENABLE_DYLOAD=0",
         "-DU_ENABLE_RESOURCE_TRACING=0",
@@ -5512,7 +6165,10 @@
         "-DU_STATIC_IMPLEMENTATION",
         "-DU_USING_ICU_NAMESPACE=0",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -5526,6 +6182,8 @@
         "third_party/icu/source/common/",
         "third_party/icu/source/i18n/",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
     rtti: true,
@@ -5736,6 +6394,7 @@
         "third_party/icu/source/common/wintz.cpp",
         "third_party/icu/source/stubdata/stubdata.cpp",
     ],
+    host_supported: true,
     defaults: [
         "cronet_aml_defaults",
     ],
@@ -5744,6 +6403,7 @@
         "-DANDROID_NDK_VERSION_ROLL=r23_1",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
         "-DHAVE_DLOPEN=0",
@@ -5751,7 +6411,10 @@
         "-DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE",
         "-DUCONFIG_ONLY_HTML_CONVERSION=1",
         "-DUCONFIG_USE_WINDOWS_LCID_MAPPING_API=0",
+        "-DUSE_AURA=1",
         "-DUSE_CHROMIUM_ICU=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
         "-DU_CHARSET_IS_UTF8=1",
         "-DU_COMMON_IMPLEMENTATION",
         "-DU_ENABLE_DYLOAD=0",
@@ -5761,7 +6424,10 @@
         "-DU_STATIC_IMPLEMENTATION",
         "-DU_USING_ICU_NAMESPACE=0",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -5777,6 +6443,8 @@
         "third_party/icu/source/common/",
         "third_party/icu/source/i18n/",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
     rtti: true,
@@ -5806,6 +6474,7 @@
         "third_party/libevent/signal.c",
         "third_party/libevent/strlcpy.c",
     ],
+    host_supported: true,
     defaults: [
         "cronet_aml_defaults",
     ],
@@ -5814,12 +6483,19 @@
         "-DANDROID_NDK_VERSION_ROLL=r23_1",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
         "-DHAVE_CONFIG_H",
         "-DHAVE_SYS_UIO_H",
+        "-DUSE_AURA=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -5831,7 +6507,10 @@
         "buildtools/third_party/libc++/trunk/include",
         "buildtools/third_party/libc++abi/trunk/include",
         "third_party/libevent/android/",
+        "third_party/libevent/linux/",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
 }
@@ -5981,6 +6660,7 @@
     srcs: [
         "third_party/modp_b64/modp_b64.cc",
     ],
+    host_supported: true,
     defaults: [
         "cronet_aml_defaults",
     ],
@@ -5989,11 +6669,18 @@
         "-DANDROID_NDK_VERSION_ROLL=r23_1",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
         "-DHAVE_SYS_UIO_H",
+        "-DUSE_AURA=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -6007,6 +6694,8 @@
         "buildtools/third_party/libc++/trunk/include",
         "buildtools/third_party/libc++abi/trunk/include",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
 }
@@ -6037,6 +6726,7 @@
         "third_party/zlib/uncompr.c",
         "third_party/zlib/zutil.c",
     ],
+    host_supported: true,
     defaults: [
         "cronet_aml_defaults",
     ],
@@ -6047,17 +6737,24 @@
         "-DCRC32_SIMD_SSE42_PCLMUL",
         "-DCR_CLANG_REVISION=\"llvmorg-16-init-8697-g60809cd2-1\"",
         "-DCR_LIBCXX_REVISION=47b31179d10646029c260702650a25d24f555acc",
+        "-DCR_SYSROOT_KEY=20220331T153654Z-0",
         "-DDCHECK_ALWAYS_ON=1",
         "-DDEFLATE_SLIDE_HASH_SSE2",
         "-DDYNAMIC_ANNOTATIONS_ENABLED=1",
         "-DHAVE_SYS_UIO_H",
         "-DINFLATE_CHUNK_READ_64LE",
         "-DINFLATE_CHUNK_SIMD_SSE2",
+        "-DUSE_AURA=1",
+        "-DUSE_OZONE=1",
+        "-DUSE_UDEV",
         "-DX86_NOT_WINDOWS",
         "-DZLIB_DEBUG",
         "-DZLIB_IMPLEMENTATION",
         "-D_DEBUG",
+        "-D_FILE_OFFSET_BITS=64",
         "-D_GNU_SOURCE",
+        "-D_LARGEFILE64_SOURCE",
+        "-D_LARGEFILE_SOURCE",
         "-D_LIBCPP_AVAILABILITY_CUSTOM_VERBOSE_ABORT_PROVIDED=1",
         "-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS",
         "-D_LIBCPP_ENABLE_ASSERTIONS_DEFAULT=1",
@@ -6073,6 +6770,8 @@
         "third_party/android_ndk/sources/android/cpufeatures/",
         "third_party/zlib/",
         "third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include/x86_64-linux-gnu",
+        "build/linux/debian_bullseye_amd64-sysroot/usr/include",
     ],
     cpp_std: "c++20",
 }
@@ -6171,11 +6870,12 @@
         "cronet_aml_base_base_static",
         "cronet_aml_base_third_party_double_conversion_double_conversion",
         "cronet_aml_base_third_party_dynamic_annotations_dynamic_annotations",
+        "cronet_aml_third_party_boringssl_boringssl",
         "cronet_aml_third_party_icu_icui18n",
         "cronet_aml_third_party_icu_icuuc_private",
         "cronet_aml_third_party_libevent_libevent",
         "cronet_aml_third_party_modp_b64_modp_b64",
-        "libssl",
+        "cronet_aml_third_party_zlib_zlib",
     ],
     generated_headers: [
         "cronet_aml_base_debugging_buildflags",
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index d3b2a56..2479813 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -138,25 +138,18 @@
 
 
 def enable_protobuf_full(module):
-  if module.type == 'cc_binary_host':
+  if module.type not in ['genrule', 'filegroup']:
     module.static_libs.add('libprotobuf-cpp-full')
-  elif module.host_supported:
-    module.host.static_libs.add('libprotobuf-cpp-full')
-    module.android.shared_libs.add('libprotobuf-cpp-full')
-  elif module.type not in ['genrule', 'filegroup']:
-    module.shared_libs.add('libprotobuf-cpp-full')
 
 
 def enable_protobuf_lite(module):
   if module.type not in ['genrule', 'filegroup']:
-    module.shared_libs.add('libprotobuf-cpp-lite')
+    module.static_libs.add('libprotobuf-cpp-lite')
 
 
 def enable_protoc_lib(module):
-  if module.type == 'cc_binary_host':
+  if module.type not in ['genrule', 'filegroup']:
     module.static_libs.add('libprotoc')
-  else:
-    module.shared_libs.add('libprotoc')
 
 
 def enable_libunwindstack(module):
@@ -217,11 +210,6 @@
   module.header_libs.add('bionic_libc_platform_headers')
 
 
-def enable_boringssl(module):
-  if module.type not in ['genrule', 'filegroup']:
-    module.static_libs.add('libssl')
-
-
 # Android equivalents for third-party libraries that the upstream project
 # depends on.
 builtin_deps = {
@@ -241,18 +229,18 @@
         enable_zlib,
     '//gn:bionic_kernel_uapi_headers':
         enable_uapi_headers,
+    '//net/tools/root_store_tool:root_store_tool':
+        lambda x: None,
     '//src/profiling/memory:bionic_libc_platform_headers_on_android':
         enable_bionic_libc_platform_headers_on_android,
     '//third_party/protobuf:protoc':
-      lambda x: None,
+        lambda x: None,
     '//third_party/protobuf:protobuf_full':
         enable_protobuf_full,
     '//third_party/protobuf:protobuf_lite':
         enable_protobuf_lite,
     '//third_party/protobuf:protoc_lib':
         enable_protoc_lib,
-    '//third_party/boringssl:boringssl':
-        enable_boringssl,
 }
 
 # ----------------------------------------------------------------------------
@@ -351,7 +339,7 @@
     self.gn_target = gn_target
     self.name = name
     self.srcs = set()
-    self.comment = 'GN: ' + gn_utils.label_without_toolchain(gn_target)
+    self.comment = 'GN: ' + gn_target
     self.shared_libs = set()
     self.static_libs = set()
     self.whole_static_libs = set()
@@ -359,6 +347,7 @@
     self.tools = set()
     self.cmd = None
     self.host_supported = False
+    self.device_supported = True
     self.vendor_available = False
     self.init_rc = set()
     self.out = set()
@@ -396,6 +385,7 @@
     self.stubs = {}
     self.cppflags = set()
     self.rtti = False
+    self.arch = dict()
 
   def to_string(self, output):
     if self.comment:
@@ -411,6 +401,8 @@
     self._output_field(output, 'cmd', sort=False)
     if self.host_supported:
       self._output_field(output, 'host_supported')
+    if not self.device_supported:
+      self._output_field(output, 'device_supported')
     if self.vendor_available:
       self._output_field(output, 'vendor_available')
     self._output_field(output, 'init_rc')
@@ -442,6 +434,7 @@
     self._output_field(output, 'cppflags')
     if self.rtti:
       self._output_field(output, 'rtti')
+    self._output_field(output, 'arch')
 
     target_out = []
     self._output_field(target_out, 'android')
@@ -498,12 +491,13 @@
 
 def label_to_module_name(label):
   """Turn a GN label (e.g., //:perfetto_tests) into a module name."""
-  # If the label is explicibly listed in the default target list, don't prefix
-  # its name and return just the target name. This is so tools like
-  # "traceconv" stay as such in the Android tree.
-  label_without_toolchain = gn_utils.label_without_toolchain(label)
-  module = re.sub(r'^//:?', '', label_without_toolchain)
+  module = re.sub(r'^//:?', '', label)
   module = re.sub(r'[^a-zA-Z0-9_]', '_', module)
+
+  # If it's required to support multi toolchain for more targets, it's better to avoid hardcoding.
+  if label == "//third_party/boringssl:boringssl_asm(//build/toolchain/android:android_clang_x86)":
+    module += "_x86"
+
   if not module.startswith(module_prefix):
     return module_prefix + module
   return module
@@ -1048,6 +1042,11 @@
   cflags = {flag for flag in target.cflags if re.match(cflag_allowlist, flag)}
   # Consider proper allowlist or denylist if needed
   cflags |= set("-D%s" % define.replace("\"", "\\\"") for define in target.defines)
+  # -DANDROID is added by default but target.defines contain -DANDROID if it's required.
+  # So adding -UANDROID to cancel default -DANDROID if it's not specified.
+  # This is needed for some targets(e.g. symbolize)
+  if "ANDROID" not in target.defines:
+    cflags.add("-UANDROID")
   return cflags
 
 
@@ -1068,13 +1067,11 @@
   target = gn.get_target(gn_target_name)
   log.info('create modules for %s (%s)', target.name, target.type)
 
-  name_without_toolchain = gn_utils.label_without_toolchain(target.name)
   if target.type == 'executable':
-    if target.toolchain == gn_utils.HOST_TOOLCHAIN:
-      module_type = 'cc_binary_host'
-    elif target.testonly:
+    if target.testonly:
       module_type = 'cc_test'
     else:
+      # Can be used for both host and device targets.
       module_type = 'cc_binary'
     module = Module(module_type, bp_module_name, gn_target_name)
   elif target.type == 'static_library':
@@ -1094,10 +1091,10 @@
   elif target.type == 'action':
     if 'gen_amalgamated_sql_metrics' in target.name:
       module = create_amalgamated_sql_metrics_module(blueprint, target)
-    elif re.match('.*gen_cc_.*_descriptor$', name_without_toolchain):
+    elif re.match('.*gen_cc_.*_descriptor$', target.name):
       module = create_cc_proto_descriptor_module(blueprint, target)
     elif target.type == 'action' and \
-        name_without_toolchain == gn_utils.GEN_VERSION_TARGET:
+        target.name == gn_utils.GEN_VERSION_TARGET:
       module = create_gen_version_module(blueprint, target, bp_module_name)
     else:
       module = create_action_module(blueprint, target)
@@ -1116,7 +1113,6 @@
     raise Error('Unknown target %s (%s)' % (target.name, target.type))
 
   blueprint.add_module(module)
-  module.host_supported = (name_without_toolchain in target_host_supported)
   module.init_rc = target_initrc.get(target.name, [])
   module.srcs.update(
       gn_utils.label_to_path(src)
@@ -1153,10 +1149,16 @@
     # include. So adding sysroot include at the end.
     for flag in target.cflags:
       if '--sysroot' in flag:
-        module.local_include_dirs.append(flag[len('--sysroot=../../'):] + "/usr/include")
+        sysroot = flag[len('--sysroot=../../'):]
+        if sysroot == "build/linux/debian_bullseye_amd64-sysroot":
+          module.local_include_dirs.append(sysroot + "/usr/include/x86_64-linux-gnu")
+        module.local_include_dirs.append(sysroot + "/usr/include")
 
   module_is_compiled = module.type not in ('genrule', 'filegroup')
   if module_is_compiled:
+    module.host_supported = target.host_supported()
+    module.device_supported = target.device_supported()
+
     # Don't try to inject library/source dependencies into genrules or
     # filegroups because they are not compiled in the traditional sense.
     module.defaults = [defaults_module]
@@ -1188,8 +1190,8 @@
   for dep_name in all_deps:
     # |builtin_deps| override GN deps with Android-specific ones. See the
     # config in the top of this file.
-    if gn_utils.label_without_toolchain(dep_name) in builtin_deps:
-      builtin_deps[gn_utils.label_without_toolchain(dep_name)](module)
+    if dep_name in builtin_deps:
+      builtin_deps[dep_name](module)
       continue
 
     dep_module = create_modules_from_target(blueprint, gn, dep_name)
@@ -1229,6 +1231,25 @@
       raise Error('Unknown dep %s (%s) for target %s' %
                   (dep_module.name, dep_module.type, module.name))
 
+  # TODO: support arch difference in generic way
+  # Currently, it is expected that only a couple of modules (e.g. partition_alloc, boringssl)
+  # need arch condition. So, for now, hardcoding arch condition
+  if module.name == "cronet_aml_base_allocator_partition_allocator_partition_alloc":
+    x86_srcs = module.srcs.copy()
+    x86_srcs.discard(
+      "base/allocator/partition_allocator/starscan/stack/asm/x64/push_registers_asm.cc")
+    x86_srcs.add("base/allocator/partition_allocator/starscan/stack/asm/x86/push_registers_asm.cc")
+    module.arch['x86'] = {'srcs': x86_srcs}
+    module.arch['x86_64'] = {'srcs': module.srcs.copy()}
+    module.srcs.clear()
+  elif module.name == "cronet_aml_third_party_boringssl_boringssl":
+    x86_srcs = module.srcs.copy()
+    x86_srcs.remove(":cronet_aml_third_party_boringssl_boringssl_asm")
+    x86_srcs.add(":cronet_aml_third_party_boringssl_boringssl_asm_x86")
+    module.arch['x86'] = {'srcs': x86_srcs}
+    module.arch['x86_64'] = {'srcs': module.srcs.copy()}
+    module.srcs.clear()
+
   return module
 
 def create_java_module(blueprint, gn):
@@ -1280,6 +1301,8 @@
       '-Wno-unused-parameter',
       '-Wno-deprecated-non-prototype', # needed for zlib
       '-fvisibility=hidden',
+      '-Wno-ambiguous-reversed-operator', # needed for icui18n
+      '-Wno-unreachable-code-loop-increment', # needed for icui18n
       '-O2',
   ]
   defaults.stl = 'none'
@@ -1288,6 +1311,14 @@
   for target in targets:
     create_modules_from_target(blueprint, gn, target)
 
+  # Currently, multi tool chain is not supported for all targets and create_modules_from_target can
+  # not reach to this target by following the dependency.
+  # So it's required to specify explicitly.
+  boringssl_gn_target_name = ('//third_party/boringssl:boringssl_asm' +
+                             '(//build/toolchain/android:android_clang_x86)')
+  gn.parse_gn_desc(desc, boringssl_gn_target_name)
+  create_modules_from_target(blueprint, gn, boringssl_gn_target_name)
+
   create_java_module(blueprint, gn)
   update_jni_registration_module(blueprint, gn)
 
@@ -1349,8 +1380,13 @@
   with open(args.desc) as f:
     desc = json.load(f)
 
-  gn = gn_utils.GnParser(desc)
-  blueprint = create_blueprint_for_targets(gn, desc, args.targets or default_targets)
+  gn = gn_utils.GnParser()
+  targets = args.targets or default_targets
+  for target in targets:
+    # TODO: pass desc to parse_gn_desc() to support parsing multiple desc files
+    # for different target architectures.
+    gn.parse_gn_desc(desc, target)
+  blueprint = create_blueprint_for_targets(gn, desc, targets)
   project_root = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
   tool_name = os.path.relpath(os.path.abspath(__file__), project_root)
 
diff --git a/tools/gn2bp/gn_utils.py b/tools/gn2bp/gn_utils.py
index 1399fcf..27fbdb2 100644
--- a/tools/gn2bp/gn_utils.py
+++ b/tools/gn2bp/gn_utils.py
@@ -29,8 +29,6 @@
 
 BUILDFLAGS_TARGET = '//gn:gen_buildflags'
 GEN_VERSION_TARGET = '//src/base:version_gen_h'
-TARGET_TOOLCHAIN = '//gn/standalone/toolchain:gcc_like_host'
-HOST_TOOLCHAIN = '//gn/standalone/toolchain:gcc_like_host'
 LINKER_UNIT_TYPES = ('executable', 'shared_library', 'static_library')
 
 # TODO(primiano): investigate these, they require further componentization.
@@ -94,6 +92,12 @@
         Maked properties are propagated up the dependency chain when a
         source_set dependency is encountered.
         """
+    class Arch():
+      """Architecture-dependent properties
+        """
+      def __init__(self):
+        self.sources = set()
+
 
     def __init__(self, name, type):
       self.name = name  # e.g. //src/ipc:ipc
@@ -144,6 +148,17 @@
       # placeholder target once we hit //gn:protoc or similar.
       self.is_third_party_dep_ = False
 
+      # TODO: come up with a better way to only run this once.
+      # is_finalized tracks whether finalize() was called on this target.
+      self.is_finalized = False
+      self.arch = dict()
+
+    def host_supported(self):
+      return 'host' in self.arch
+
+    def device_supported(self):
+      return any([name.startswith('android') for name in self.arch.keys()])
+
     def __lt__(self, other):
       if isinstance(other, self.__class__):
         return self.name < other.name
@@ -165,8 +180,24 @@
                   'libs', 'proto_paths'):
         self.__dict__[key].update(other.__dict__.get(key, []))
 
-  def __init__(self, gn_desc):
-    self.gn_desc_ = gn_desc
+    def finalize(self):
+      """Move common properties out of arch-dependent subobjects to Target object.
+
+        TODO: find a better name for this function.
+        """
+      if self.is_finalized:
+        return
+      self.is_finalized = True
+
+      # Target contains the intersection of arch-dependent properties
+      self.sources = set.intersection(*[arch.sources for arch in self.arch.values()])
+
+      # Deduplicate arch-dependent properties
+      for arch in self.arch.keys():
+        self.arch[arch].sources -= self.sources
+
+
+  def __init__(self):
     self.all_targets = {}
     self.linker_units = {}  # Executables, shared or static libraries.
     self.source_sets = {}
@@ -195,39 +226,53 @@
     # TODO: There are some other possible variations we might need to support.
     return target.type == 'group' and re.match('.*_java$', target.name)
 
+  def _get_arch(self, toolchain):
+    if toolchain == '//build/toolchain/android:android_clang_x86':
+      return 'android_x86'
+    elif toolchain == '//build/toolchain/android:android_clang_x64':
+      return 'android_x86_64'
+    elif toolchain == '//build/toolchain/android:android_clang_arm':
+      return 'android_arm'
+    elif toolchain == '//build/toolchain/android:android_clang_arm64':
+      return 'android_arm64'
+    else:
+      return 'host'
 
   def get_target(self, gn_target_name):
     """Returns a Target object from the fully qualified GN target name.
 
+      get_target() requires that parse_gn_desc() has already been called.
+      """
+    # Run this every time as parse_gn_desc can be called at any time.
+    for target in self.all_targets.values():
+      target.finalize()
+
+    return self.all_targets[label_without_toolchain(gn_target_name)]
+
+  def parse_gn_desc(self, gn_desc, gn_target_name):
+    """Parses a gn desc tree and resolves all target dependencies.
+
         It bubbles up variables from source_set dependencies as described in the
         class-level comments.
         """
-    target = self.all_targets.get(gn_target_name)
-    if target is not None:
+    # Use name without toolchain for targets to support targets built for
+    # multiple archs.
+    target_name = label_without_toolchain(gn_target_name)
+    target = self.all_targets.get(target_name)
+    desc = gn_desc[gn_target_name]
+    arch = self._get_arch(desc['toolchain'])
+    if target is None:
+      target = GnParser.Target(target_name, desc['type'])
+      self.all_targets[target_name] = target
+
+    if arch not in target.arch:
+      target.arch[arch] = GnParser.Target.Arch()
+    else:
       return target  # Target already processed.
 
-    desc = self.gn_desc_[gn_target_name]
-    target = GnParser.Target(gn_target_name, desc['type'])
     target.testonly = desc.get('testonly', False)
-    target.toolchain = desc.get('toolchain', None)
-    self.all_targets[gn_target_name] = target
 
-    # TODO: determine if below comment should apply for cronet builds in Android.
-    # We should never have GN targets directly depend on buidtools. They
-    # should hop via //gn:xxx, so we can give generators an opportunity to
-    # override them.
-    # Specifically allow targets to depend on libc++ and libunwind.
-    if not any(match in gn_target_name for match in ['libc++', 'libunwind']):
-      assert (not gn_target_name.startswith('//buildtools'))
-
-
-    # Don't descend further into third_party targets. Genrators are supposed
-    # to either ignore them or route to other externally-provided targets.
-    if gn_target_name.startswith('//gn'):
-      target.is_third_party_dep_ = True
-      return target
-
-    proto_target_type, proto_desc = self.get_proto_target_type(target)
+    proto_target_type, proto_desc = self.get_proto_target_type(gn_desc, gn_target_name)
     if proto_target_type is not None:
       self.proto_libs[target.name] = target
       target.type = 'proto_library'
@@ -235,18 +280,18 @@
       target.proto_paths.update(self.get_proto_paths(proto_desc))
       target.proto_exports.update(self.get_proto_exports(proto_desc))
       target.proto_in_dir = self.get_proto_in_dir(proto_desc)
-      target.sources.update(proto_desc.get('sources', []))
-      assert (all(x.endswith('.proto') for x in target.sources))
+      target.arch[arch].sources.update(proto_desc.get('sources', []))
+      assert (all(x.endswith('.proto') for x in target.arch[arch].sources))
     elif target.type == 'source_set':
       self.source_sets[gn_target_name] = target
-      target.sources.update(desc.get('sources', []))
+      target.arch[arch].sources.update(desc.get('sources', []))
     elif target.type in LINKER_UNIT_TYPES:
       self.linker_units[gn_target_name] = target
-      target.sources.update(desc.get('sources', []))
+      target.arch[arch].sources.update(desc.get('sources', []))
     elif target.type in ['action', 'action_foreach']:
       self.actions[gn_target_name] = target
       target.inputs.update(desc.get('inputs', []))
-      target.sources.update(desc.get('sources', []))
+      target.arch[arch].sources.update(desc.get('sources', []))
       outs = [re.sub('^//out/.+?/gen/', '', x) for x in desc['outputs']]
       target.outputs.update(outs)
       target.script = desc['script']
@@ -276,8 +321,9 @@
     target.include_dirs.update(desc.get('include_dirs', []))
 
     # Recurse in dependencies.
-    for dep_name in desc.get('deps', []):
-      dep = self.get_target(dep_name)
+    for gn_dep_name in desc.get('deps', []):
+      dep = self.parse_gn_desc(gn_desc, gn_dep_name)
+      dep_name = label_without_toolchain(gn_dep_name)
       if dep.is_third_party_dep_:
         target.deps.add(dep_name)
       elif dep.type == 'proto_library':
@@ -304,9 +350,12 @@
       if dep.type == 'static_library':
         # Bubble up static_libs. Necessary, since soong does not propagate
         # static_libs up the build tree.
-        target.transitive_static_libs_deps.add(dep_name)
-        target.transitive_static_libs_deps.update(dep.transitive_static_libs_deps)
-        target.deps.update(target.transitive_static_libs_deps)
+        # Protobuf dependencies are handled separately.
+        if '//third_party/protobuf' not in dep_name:
+          target.transitive_static_libs_deps.add(dep_name)
+
+      target.transitive_static_libs_deps.update(dep.transitive_static_libs_deps)
+      target.deps.update(target.transitive_static_libs_deps)
 
       # Collect java sources. Java sources are kept inside the __compile_java target.
       # This target can be used for both host and target compilation; only add
@@ -337,7 +386,7 @@
     args = proto_desc.get('args')
     return re.sub('^\.\./\.\./', '', args[args.index('--proto-in-dir') + 1])
 
-  def get_proto_target_type(self, target):
+  def get_proto_target_type(self, gn_desc, gn_target_name):
     """ Checks if the target is a proto library and return the plugin.
 
         Returns:
@@ -347,13 +396,13 @@
             json desc of the target with the .proto sources (_gen target for
             non-descriptor types or the target itself for descriptor type).
         """
-    parts = target.name.split('(', 1)
+    parts = gn_target_name.split('(', 1)
     name = parts[0]
     toolchain = '(' + parts[1] if len(parts) > 1 else ''
 
     # Descriptor targets don't have a _gen target; instead we look for the
     # characteristic flag in the args of the target itself.
-    desc = self.gn_desc_.get(target.name)
+    desc = gn_desc.get(gn_target_name)
     if '--descriptor_set_out' in desc.get('args', []):
       return 'descriptor', desc
 
@@ -365,7 +414,7 @@
 
     # In all other cases, we want to look at the _gen target as that has the
     # important information.
-    gen_desc = self.gn_desc_.get('%s_gen%s' % (name, toolchain))
+    gen_desc = gn_desc.get('%s_gen%s' % (name, toolchain))
     if gen_desc is None or gen_desc['type'] != 'action':
       return None, None
     if gen_desc['script'] != '//tools/protoc_wrapper/protoc_wrapper.py':