Merge "init.rc: start tombstoned before switching mount namespace"
diff --git a/init/reboot.cpp b/init/reboot.cpp
index 49baf9e..4699eca 100644
--- a/init/reboot.cpp
+++ b/init/reboot.cpp
@@ -853,7 +853,7 @@
         sub_reason = "apex";
         return result;
     }
-    if (!SwitchToMountNamespaceIfNeeded(NS_BOOTSTRAP)) {
+    if (!SwitchToMountNamespaceIfNeeded(NS_BOOTSTRAP).ok()) {
         sub_reason = "ns_switch";
         return Error() << "Failed to switch to bootstrap namespace";
     }
diff --git a/libnetutils/Android.bp b/libnetutils/Android.bp
index 65371fa..eec2415 100644
--- a/libnetutils/Android.bp
+++ b/libnetutils/Android.bp
@@ -21,6 +21,11 @@
     cflags: ["-Werror"],
 
     export_include_dirs: ["include"],
+    // TODO: remove connectivity module dependency, or have this lib build against the ndk
+    apex_available: [
+        "//apex_available:platform",
+        "com.android.tethering",
+    ],
 }
 
 cc_library_static {
diff --git a/trusty/coverage/Android.bp b/trusty/coverage/Android.bp
index 3d2caa6..6038d44 100644
--- a/trusty/coverage/Android.bp
+++ b/trusty/coverage/Android.bp
@@ -14,6 +14,7 @@
 
 cc_library {
     name: "libtrusty_coverage",
+    vendor_available: true,
     srcs: [
         "coverage.cpp",
     ],
@@ -21,8 +22,9 @@
         "include",
     ],
     static_libs: [
-        "libtrusty_test",
+        "libtrusty",
     ],
+
     shared_libs: [
         "libbase",
         "liblog",
@@ -36,7 +38,7 @@
     ],
     static_libs: [
         "libtrusty_coverage",
-        "libtrusty_test",
+        "libtrusty",
     ],
     shared_libs: [
         "libbase",
diff --git a/trusty/coverage/coverage.cpp b/trusty/coverage/coverage.cpp
index 9413ce3..f383dd1 100644
--- a/trusty/coverage/coverage.cpp
+++ b/trusty/coverage/coverage.cpp
@@ -142,7 +142,7 @@
 
 void CoverageRecord::ResetFullRecord() {
     auto header_region = GetRegionBounds(COV_START);
-    if (!header_region) {
+    if (!header_region.ok()) {
         // If the header cannot be parsed, we can't reset the proper region yet.
         return;
     }
@@ -202,7 +202,7 @@
 
 void CoverageRecord::GetRawCounts(volatile uint8_t** begin, volatile uint8_t** end) {
     auto region = GetRegionBounds(COV_8BIT_COUNTERS);
-    if (!region) {
+    if (!region.ok()) {
         *begin = 0;
         *end = 0;
         return;
@@ -216,7 +216,7 @@
 
 void CoverageRecord::GetRawPCs(volatile uintptr_t** begin, volatile uintptr_t** end) {
     auto region = GetRegionBounds(COV_INSTR_PCS);
-    if (!region) {
+    if (!region.ok()) {
         *begin = 0;
         *end = 0;
         return;
diff --git a/trusty/fuzz/Android.bp b/trusty/fuzz/Android.bp
index 4df77af..ad13816 100644
--- a/trusty/fuzz/Android.bp
+++ b/trusty/fuzz/Android.bp
@@ -39,7 +39,7 @@
     export_include_dirs: ["include"],
     static_libs: [
         "libFuzzer",
-        "libtrusty_test",
+        "libtrusty",
     ],
     shared_libs: [
         "libtrusty_coverage",
diff --git a/trusty/libtrusty/Android.bp b/trusty/libtrusty/Android.bp
index 708fdbd..e0161a5 100644
--- a/trusty/libtrusty/Android.bp
+++ b/trusty/libtrusty/Android.bp
@@ -26,13 +26,8 @@
 
 cc_library {
     name: "libtrusty",
-    vendor: true,
-    defaults: ["libtrusty_defaults"],
-}
-
-// TODO(b/170753563): cc_fuzz can't deal with vendor components. Build libtrusty
-// for system.
-cc_test_library {
-    name: "libtrusty_test",
+    // TODO(b/170753563): cc_fuzz can't deal with vendor components. Build
+    // libtrusty for system and vendor.
+    vendor_available: true,
     defaults: ["libtrusty_defaults"],
 }