Merge "libsnapshot: Remove consistency check after merge" into main
diff --git a/fs_mgr/clean_scratch_files.rc b/fs_mgr/clean_scratch_files.rc
index 25a7e69..71708f8 100644
--- a/fs_mgr/clean_scratch_files.rc
+++ b/fs_mgr/clean_scratch_files.rc
@@ -1,2 +1,2 @@
-on post-fs-data && property:ro.debuggable=1
+on post-fs-data && property:ro.debuggable=1 && property:ro.boot.dynamic_partitions=true
     exec_background - root root -- /system/bin/clean_scratch_files
diff --git a/fs_mgr/libsnapshot/libsnapshot_cow/cow_format.cpp b/fs_mgr/libsnapshot/libsnapshot_cow/cow_format.cpp
index 5ab4f7a..b905291 100644
--- a/fs_mgr/libsnapshot/libsnapshot_cow/cow_format.cpp
+++ b/fs_mgr/libsnapshot/libsnapshot_cow/cow_format.cpp
@@ -23,6 +23,7 @@
 #include <android-base/stringprintf.h>
 #include <libsnapshot/cow_format.h>
 #include "writer_v2.h"
+#include "writer_v3.h"
 
 namespace android {
 namespace snapshot {
@@ -149,6 +150,9 @@
         case 2:
             base = std::make_unique<CowWriterV2>(options, std::move(fd));
             break;
+        case 3:
+            base = std::make_unique<CowWriterV3>(options, std::move(fd));
+            break;
         default:
             LOG(ERROR) << "Cannot create unknown cow version: " << version;
             return nullptr;
diff --git a/fs_mgr/libsnapshot/snapuserd/user-space-merge/snapuserd_core.cpp b/fs_mgr/libsnapshot/snapuserd/user-space-merge/snapuserd_core.cpp
index 97848fb..8208d67 100644
--- a/fs_mgr/libsnapshot/snapuserd/user-space-merge/snapuserd_core.cpp
+++ b/fs_mgr/libsnapshot/snapuserd/user-space-merge/snapuserd_core.cpp
@@ -16,8 +16,6 @@
 
 #include "snapuserd_core.h"
 
-#include <sys/utsname.h>
-
 #include <android-base/chrono_utils.h>
 #include <android-base/properties.h>
 #include <android-base/scopeguard.h>
@@ -26,6 +24,7 @@
 
 #include "merge_worker.h"
 #include "read_worker.h"
+#include "utility.h"
 
 namespace android {
 namespace snapshot {
@@ -421,22 +420,7 @@
 }
 
 bool SnapshotHandler::IsIouringSupported() {
-    struct utsname uts;
-    unsigned int major, minor;
-
-    if ((uname(&uts) != 0) || (sscanf(uts.release, "%u.%u", &major, &minor) != 2)) {
-        SNAP_LOG(ERROR) << "Could not parse the kernel version from uname. "
-                        << " io_uring not supported";
-        return false;
-    }
-
-    // We will only support kernels from 5.6 onwards as IOSQE_ASYNC flag and
-    // IO_URING_OP_READ/WRITE opcodes were introduced only on 5.6 kernel
-    if (major >= 5) {
-        if (major == 5 && minor < 6) {
-            return false;
-        }
-    } else {
+    if (!KernelSupportsIoUring()) {
         return false;
     }
 
diff --git a/fs_mgr/libsnapshot/snapuserd/user-space-merge/snapuserd_test.cpp b/fs_mgr/libsnapshot/snapuserd/user-space-merge/snapuserd_test.cpp
index 65f31cf..bed71cf 100644
--- a/fs_mgr/libsnapshot/snapuserd/user-space-merge/snapuserd_test.cpp
+++ b/fs_mgr/libsnapshot/snapuserd/user-space-merge/snapuserd_test.cpp
@@ -47,8 +47,6 @@
 #include "testing/temp_device.h"
 #include "utility.h"
 
-DEFINE_string(force_config, "", "Force testing mode with iouring disabled");
-
 namespace android {
 namespace snapshot {
 
@@ -62,7 +60,7 @@
 using testing::AssertionResult;
 using testing::AssertionSuccess;
 
-class SnapuserdTestBase : public ::testing::Test {
+class SnapuserdTestBase : public ::testing::TestWithParam<bool> {
   protected:
     void SetUp() override;
     void TearDown() override;
@@ -627,16 +625,11 @@
 }
 
 void SnapuserdTest::InitCowDevice() {
-    bool use_iouring = true;
-    if (FLAGS_force_config == "iouring_disabled") {
-        use_iouring = false;
-    }
-
     auto factory = harness_->GetBlockServerFactory();
     auto opener = factory->CreateOpener(system_device_ctrl_name_);
     auto handler =
             handlers_->AddHandler(system_device_ctrl_name_, cow_system_->path, base_dev_->GetPath(),
-                                  base_dev_->GetPath(), opener, 1, use_iouring, false);
+                                  base_dev_->GetPath(), opener, 1, GetParam(), false);
     ASSERT_NE(handler, nullptr);
     ASSERT_NE(handler->snapuserd(), nullptr);
 #ifdef __ANDROID__
@@ -780,7 +773,7 @@
     ASSERT_TRUE(Merge());
 }
 
-TEST_F(SnapuserdTest, Snapshot_IO_TEST) {
+TEST_P(SnapuserdTest, Snapshot_IO_TEST) {
     if (!harness_->HasUserDevice()) {
         GTEST_SKIP() << "Skipping snapshot read; not supported";
     }
@@ -794,7 +787,7 @@
     ASSERT_NO_FATAL_FAILURE(ReadSnapshotDeviceAndValidate());
 }
 
-TEST_F(SnapuserdTest, Snapshot_MERGE_IO_TEST) {
+TEST_P(SnapuserdTest, Snapshot_MERGE_IO_TEST) {
     if (!harness_->HasUserDevice()) {
         GTEST_SKIP() << "Skipping snapshot read; not supported";
     }
@@ -808,7 +801,7 @@
     read_future.wait();
 }
 
-TEST_F(SnapuserdTest, Snapshot_MERGE_IO_TEST_1) {
+TEST_P(SnapuserdTest, Snapshot_MERGE_IO_TEST_1) {
     if (!harness_->HasUserDevice()) {
         GTEST_SKIP() << "Skipping snapshot read; not supported";
     }
@@ -823,31 +816,31 @@
     read_future.wait();
 }
 
-TEST_F(SnapuserdTest, Snapshot_Merge_Resume) {
+TEST_P(SnapuserdTest, Snapshot_Merge_Resume) {
     ASSERT_NO_FATAL_FAILURE(SetupDefault());
     ASSERT_NO_FATAL_FAILURE(MergeInterrupt());
     ValidateMerge();
 }
 
-TEST_F(SnapuserdTest, Snapshot_COPY_Overlap_TEST_1) {
+TEST_P(SnapuserdTest, Snapshot_COPY_Overlap_TEST_1) {
     ASSERT_NO_FATAL_FAILURE(SetupCopyOverlap_1());
     ASSERT_TRUE(Merge());
     ValidateMerge();
 }
 
-TEST_F(SnapuserdTest, Snapshot_COPY_Overlap_TEST_2) {
+TEST_P(SnapuserdTest, Snapshot_COPY_Overlap_TEST_2) {
     ASSERT_NO_FATAL_FAILURE(SetupCopyOverlap_2());
     ASSERT_TRUE(Merge());
     ValidateMerge();
 }
 
-TEST_F(SnapuserdTest, Snapshot_COPY_Overlap_Merge_Resume_TEST) {
+TEST_P(SnapuserdTest, Snapshot_COPY_Overlap_Merge_Resume_TEST) {
     ASSERT_NO_FATAL_FAILURE(SetupCopyOverlap_1());
     ASSERT_NO_FATAL_FAILURE(MergeInterrupt());
     ValidateMerge();
 }
 
-TEST_F(SnapuserdTest, Snapshot_COPY_Overlap_Merge_Resume_IO_Validate_TEST) {
+TEST_P(SnapuserdTest, Snapshot_COPY_Overlap_Merge_Resume_IO_Validate_TEST) {
     if (!harness_->HasUserDevice()) {
         GTEST_SKIP() << "Skipping snapshot read; not supported";
     }
@@ -856,25 +849,25 @@
     ValidateMerge();
 }
 
-TEST_F(SnapuserdTest, Snapshot_Merge_Crash_Fixed_Ordered) {
+TEST_P(SnapuserdTest, Snapshot_Merge_Crash_Fixed_Ordered) {
     ASSERT_NO_FATAL_FAILURE(SetupOrderedOps());
     ASSERT_NO_FATAL_FAILURE(MergeInterruptFixed(300));
     ValidateMerge();
 }
 
-TEST_F(SnapuserdTest, Snapshot_Merge_Crash_Random_Ordered) {
+TEST_P(SnapuserdTest, Snapshot_Merge_Crash_Random_Ordered) {
     ASSERT_NO_FATAL_FAILURE(SetupOrderedOps());
     ASSERT_NO_FATAL_FAILURE(MergeInterruptRandomly(500));
     ValidateMerge();
 }
 
-TEST_F(SnapuserdTest, Snapshot_Merge_Crash_Fixed_Inverted) {
+TEST_P(SnapuserdTest, Snapshot_Merge_Crash_Fixed_Inverted) {
     ASSERT_NO_FATAL_FAILURE(SetupOrderedOpsInverted());
     ASSERT_NO_FATAL_FAILURE(MergeInterruptFixed(50));
     ValidateMerge();
 }
 
-TEST_F(SnapuserdTest, Snapshot_Merge_Crash_Random_Inverted) {
+TEST_P(SnapuserdTest, Snapshot_Merge_Crash_Random_Inverted) {
     ASSERT_NO_FATAL_FAILURE(SetupOrderedOpsInverted());
     ASSERT_NO_FATAL_FAILURE(MergeInterruptRandomly(50));
     ValidateMerge();
@@ -941,7 +934,7 @@
 }
 
 // This test mirrors ReadSnapshotDeviceAndValidate.
-TEST_F(HandlerTest, Read) {
+TEST_P(HandlerTest, Read) {
     std::unique_ptr<uint8_t[]> snapuserd_buffer = std::make_unique<uint8_t[]>(size_);
 
     // COPY
@@ -970,20 +963,41 @@
     ASSERT_EQ(memcmp(snapuserd_buffer.get(), (char*)orig_buffer_.get() + (size_ * 4), size_), 0);
 }
 
-TEST_F(HandlerTest, ReadUnalignedSector) {
+TEST_P(HandlerTest, ReadUnalignedSector) {
     std::unique_ptr<uint8_t[]> snapuserd_buffer = std::make_unique<uint8_t[]>(BLOCK_SZ);
 
     ASSERT_TRUE(ReadSectors(1, BLOCK_SZ, snapuserd_buffer.get()));
     ASSERT_EQ(memcmp(snapuserd_buffer.get(), orig_buffer_.get() + SECTOR_SIZE, BLOCK_SZ), 0);
 }
 
-TEST_F(HandlerTest, ReadUnalignedSize) {
+TEST_P(HandlerTest, ReadUnalignedSize) {
     std::unique_ptr<uint8_t[]> snapuserd_buffer = std::make_unique<uint8_t[]>(SECTOR_SIZE);
 
     ASSERT_TRUE(ReadSectors(0, SECTOR_SIZE, snapuserd_buffer.get()));
     ASSERT_EQ(memcmp(snapuserd_buffer.get(), orig_buffer_.get(), SECTOR_SIZE), 0);
 }
 
+std::vector<bool> GetIoUringConfigs() {
+#if __ANDROID__
+    if (!android::base::GetBoolProperty("ro.virtual_ab.io_uring.enabled", false)) {
+        return {false};
+    }
+#endif
+    if (!KernelSupportsIoUring()) {
+        return {false};
+    }
+    return {false, true};
+}
+
+std::string IoUringConfigName(const testing::TestParamInfo<SnapuserdTest::ParamType>& info) {
+    return info.param ? "io_uring" : "sync";
+}
+
+INSTANTIATE_TEST_SUITE_P(Io, SnapuserdTest, ::testing::ValuesIn(GetIoUringConfigs()),
+                         IoUringConfigName);
+INSTANTIATE_TEST_SUITE_P(Io, HandlerTest, ::testing::ValuesIn(GetIoUringConfigs()),
+                         IoUringConfigName);
+
 }  // namespace snapshot
 }  // namespace android
 
diff --git a/fs_mgr/libsnapshot/snapuserd/utility.cpp b/fs_mgr/libsnapshot/snapuserd/utility.cpp
index a84a7c1..fcdb69d 100644
--- a/fs_mgr/libsnapshot/snapuserd/utility.cpp
+++ b/fs_mgr/libsnapshot/snapuserd/utility.cpp
@@ -15,6 +15,7 @@
 #include "utility.h"
 
 #include <sys/resource.h>
+#include <sys/utsname.h>
 #include <unistd.h>
 
 #include <android-base/file.h>
@@ -32,5 +33,19 @@
 #endif
 }
 
+bool KernelSupportsIoUring() {
+    struct utsname uts {};
+    unsigned int major, minor;
+
+    uname(&uts);
+    if (sscanf(uts.release, "%u.%u", &major, &minor) != 2) {
+        return false;
+    }
+
+    // We will only support kernels from 5.6 onwards as IOSQE_ASYNC flag and
+    // IO_URING_OP_READ/WRITE opcodes were introduced only on 5.6 kernel
+    return major > 5 || (major == 5 && minor >= 6);
+}
+
 }  // namespace snapshot
 }  // namespace android
diff --git a/fs_mgr/libsnapshot/snapuserd/utility.h b/fs_mgr/libsnapshot/snapuserd/utility.h
index 58ec3e6..255aee1 100644
--- a/fs_mgr/libsnapshot/snapuserd/utility.h
+++ b/fs_mgr/libsnapshot/snapuserd/utility.h
@@ -18,6 +18,7 @@
 namespace snapshot {
 
 bool SetThreadPriority(int priority);
+bool KernelSupportsIoUring();
 
 }  // namespace snapshot
 }  // namespace android
diff --git a/libstats/OWNERS b/libstats/OWNERS
index d391679..efd3686 100644
--- a/libstats/OWNERS
+++ b/libstats/OWNERS
@@ -1,8 +1,8 @@
 jeffreyhuang@google.com
-jtnguyen@google.com
+monicamwang@google.com
 muhammadq@google.com
+rayhdez@google.com
 sharaienko@google.com
 singhtejinder@google.com
 tsaichristine@google.com
 yaochen@google.com
-yro@google.com
diff --git a/libutils/Android.bp b/libutils/Android.bp
index 2c05fbc..b3ddda3 100644
--- a/libutils/Android.bp
+++ b/libutils/Android.bp
@@ -132,25 +132,19 @@
     ],
     native_bridge_supported: true,
 
+    whole_static_libs: ["libutils_binder"],
+
     srcs: [
-        "Errors.cpp",
         "FileMap.cpp",
         "JenkinsHash.cpp",
         "LightRefBase.cpp",
         "NativeHandle.cpp",
         "Printer.cpp",
-        "RefBase.cpp",
-        "SharedBuffer.cpp",
         "StopWatch.cpp",
-        "String8.cpp",
-        "String16.cpp",
-        "StrongPointer.cpp",
         "SystemClock.cpp",
         "Threads.cpp",
         "Timers.cpp",
         "Tokenizer.cpp",
-        "Unicode.cpp",
-        "VectorImpl.cpp",
         "misc.cpp",
     ],
 
@@ -208,7 +202,6 @@
     defaults: ["libutils_impl_defaults"],
 
     cflags: [
-        "-DCALLSTACKS=1",
         "-DDEBUG_POLL_AND_WAKE=1",
         "-DDEBUG_REFS=1",
         "-DDEBUG_TOKENIZER=1",
@@ -275,24 +268,6 @@
 }
 
 cc_fuzz {
-    name: "libutils_fuzz_string8",
-    defaults: ["libutils_fuzz_defaults"],
-    srcs: ["String8_fuzz.cpp"],
-}
-
-cc_fuzz {
-    name: "libutils_fuzz_string16",
-    defaults: ["libutils_fuzz_defaults"],
-    srcs: ["String16_fuzz.cpp"],
-}
-
-cc_fuzz {
-    name: "libutils_fuzz_vector",
-    defaults: ["libutils_fuzz_defaults"],
-    srcs: ["Vector_fuzz.cpp"],
-}
-
-cc_fuzz {
     name: "libutils_fuzz_printer",
     defaults: ["libutils_fuzz_defaults"],
     srcs: ["Printer_fuzz.cpp"],
@@ -317,12 +292,6 @@
 }
 
 cc_fuzz {
-    name: "libutils_fuzz_refbase",
-    defaults: ["libutils_fuzz_defaults"],
-    srcs: ["RefBase_fuzz.cpp"],
-}
-
-cc_fuzz {
     name: "libutils_fuzz_lrucache",
     defaults: ["libutils_fuzz_defaults"],
     srcs: ["LruCache_fuzz.cpp"],
@@ -341,18 +310,11 @@
     srcs: [
         "BitSet_test.cpp",
         "CallStack_test.cpp",
-        "Errors_test.cpp",
         "FileMap_test.cpp",
         "LruCache_test.cpp",
         "Mutex_test.cpp",
-        "SharedBuffer_test.cpp",
         "Singleton_test.cpp",
-        "String16_test.cpp",
-        "String8_test.cpp",
-        "StrongPointer_test.cpp",
         "Timers_test.cpp",
-        "Unicode_test.cpp",
-        "Vector_test.cpp",
     ],
 
     target: {
@@ -374,7 +336,6 @@
         linux: {
             srcs: [
                 "Looper_test.cpp",
-                "RefBase_test.cpp",
             ],
         },
         host: {
@@ -428,9 +389,3 @@
     shared_libs: ["libutils_test_singleton1"],
     header_libs: ["libutils_headers"],
 }
-
-cc_benchmark {
-    name: "libutils_benchmark",
-    srcs: ["Vector_benchmark.cpp"],
-    shared_libs: ["libutils"],
-}
diff --git a/libutils/TEST_MAPPING b/libutils/TEST_MAPPING
index c8ef45c..472146f 100644
--- a/libutils/TEST_MAPPING
+++ b/libutils/TEST_MAPPING
@@ -2,6 +2,9 @@
   "presubmit": [
     {
       "name": "libutils_test"
+    },
+    {
+      "name": "libutils_binder_test"
     }
   ]
 }
diff --git a/libutils/binder/Android.bp b/libutils/binder/Android.bp
new file mode 100644
index 0000000..e2eddb3
--- /dev/null
+++ b/libutils/binder/Android.bp
@@ -0,0 +1,126 @@
+package {
+    default_applicable_licenses: ["system_core_libutils_license"],
+}
+
+cc_defaults {
+    name: "libutils_binder_impl_defaults",
+    defaults: [
+        "libutils_defaults",
+        "apex-lowest-min-sdk-version",
+    ],
+    native_bridge_supported: true,
+
+    srcs: [
+        "Errors.cpp",
+        "RefBase.cpp",
+        "SharedBuffer.cpp",
+        "String16.cpp",
+        "String8.cpp",
+        "StrongPointer.cpp",
+        "Unicode.cpp",
+        "VectorImpl.cpp",
+    ],
+
+    apex_available: [
+        "//apex_available:anyapex",
+        "//apex_available:platform",
+    ],
+
+    afdo: true,
+}
+
+cc_library {
+    name: "libutils_binder",
+    defaults: ["libutils_binder_impl_defaults"],
+}
+
+cc_library {
+    name: "libutils_binder_test_compile",
+    defaults: ["libutils_binder_impl_defaults"],
+
+    cflags: [
+        "-DDEBUG_REFS=1",
+    ],
+
+    visibility: [":__subpackages__"],
+}
+
+cc_fuzz {
+    name: "libutils_fuzz_string8",
+    defaults: ["libutils_fuzz_defaults"],
+    srcs: ["String8_fuzz.cpp"],
+}
+
+cc_fuzz {
+    name: "libutils_fuzz_string16",
+    defaults: ["libutils_fuzz_defaults"],
+    srcs: ["String16_fuzz.cpp"],
+}
+
+cc_fuzz {
+    name: "libutils_fuzz_vector",
+    defaults: ["libutils_fuzz_defaults"],
+    srcs: ["Vector_fuzz.cpp"],
+}
+
+cc_fuzz {
+    name: "libutils_fuzz_refbase",
+    defaults: ["libutils_fuzz_defaults"],
+    srcs: ["RefBase_fuzz.cpp"],
+}
+
+cc_test {
+    name: "libutils_binder_test",
+    host_supported: true,
+
+    srcs: [
+        "Errors_test.cpp",
+        "SharedBuffer_test.cpp",
+        "String16_test.cpp",
+        "String8_test.cpp",
+        "StrongPointer_test.cpp",
+        "Unicode_test.cpp",
+        "Vector_test.cpp",
+    ],
+
+    target: {
+        android: {
+            shared_libs: [
+                "libbase",
+                "libcutils",
+                "liblog",
+                "liblzma",
+                "libutils", // which includes libutils_binder
+                "libz",
+            ],
+        },
+        linux: {
+            srcs: [
+                "RefBase_test.cpp",
+            ],
+        },
+        host: {
+            static_libs: [
+                "libbase",
+                "liblog",
+                "liblzma",
+                "libutils", // which includes libutils_binder
+            ],
+        },
+    },
+
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+        "-Wthread-safety",
+    ],
+
+    test_suites: ["device-tests"],
+}
+
+cc_benchmark {
+    name: "libutils_binder_benchmark",
+    srcs: ["Vector_benchmark.cpp"],
+    shared_libs: ["libutils"],
+}
diff --git a/libutils/Errors.cpp b/libutils/binder/Errors.cpp
similarity index 100%
rename from libutils/Errors.cpp
rename to libutils/binder/Errors.cpp
diff --git a/libutils/Errors_test.cpp b/libutils/binder/Errors_test.cpp
similarity index 100%
rename from libutils/Errors_test.cpp
rename to libutils/binder/Errors_test.cpp
diff --git a/libutils/FuzzFormatTypes.h b/libutils/binder/FuzzFormatTypes.h
similarity index 100%
rename from libutils/FuzzFormatTypes.h
rename to libutils/binder/FuzzFormatTypes.h
diff --git a/libutils/RefBase.cpp b/libutils/binder/RefBase.cpp
similarity index 98%
rename from libutils/RefBase.cpp
rename to libutils/binder/RefBase.cpp
index e0a2846..c7055fb 100644
--- a/libutils/RefBase.cpp
+++ b/libutils/binder/RefBase.cpp
@@ -18,6 +18,7 @@
 // #define LOG_NDEBUG 0
 
 #include <memory>
+#include <mutex>
 
 #include <android-base/macros.h>
 
@@ -27,8 +28,6 @@
 #include <utils/RefBase.h>
 #include <utils/String8.h>
 
-#include <utils/Mutex.h>
-
 #ifndef __unused
 #define __unused __attribute__((__unused__))
 #endif
@@ -310,7 +309,7 @@
         String8 text;
 
         {
-            Mutex::Autolock _l(mMutex);
+            std::lock_guard<std::mutex> _l(mMutex);
             char buf[128];
             snprintf(buf, sizeof(buf),
                      "Strong references on RefBase %p (weakref_type %p):\n",
@@ -353,7 +352,7 @@
     void addRef(ref_entry** refs, const void* id, int32_t mRef)
     {
         if (mTrackEnabled) {
-            AutoMutex _l(mMutex);
+            std::lock_guard<std::mutex> _l(mMutex);
 
             ref_entry* ref = new ref_entry;
             // Reference count at the time of the snapshot, but before the
@@ -372,7 +371,7 @@
     void removeRef(ref_entry** refs, const void* id)
     {
         if (mTrackEnabled) {
-            AutoMutex _l(mMutex);
+            std::lock_guard<std::mutex> _l(mMutex);
 
             ref_entry* const head = *refs;
             ref_entry* ref = head;
@@ -406,7 +405,7 @@
     void renameRefsId(ref_entry* r, const void* old_id, const void* new_id)
     {
         if (mTrackEnabled) {
-            AutoMutex _l(mMutex);
+            std::lock_guard<std::mutex> _l(mMutex);
             ref_entry* ref = r;
             while (ref != NULL) {
                 if (ref->id == old_id) {
@@ -434,7 +433,7 @@
         }
     }
 
-    mutable Mutex mMutex;
+    mutable std::mutex mMutex;
     ref_entry* mStrongRefs;
     ref_entry* mWeakRefs;
 
diff --git a/libutils/RefBase_fuzz.cpp b/libutils/binder/RefBase_fuzz.cpp
similarity index 100%
rename from libutils/RefBase_fuzz.cpp
rename to libutils/binder/RefBase_fuzz.cpp
diff --git a/libutils/RefBase_test.cpp b/libutils/binder/RefBase_test.cpp
similarity index 100%
rename from libutils/RefBase_test.cpp
rename to libutils/binder/RefBase_test.cpp
diff --git a/libutils/SharedBuffer.cpp b/libutils/binder/SharedBuffer.cpp
similarity index 100%
rename from libutils/SharedBuffer.cpp
rename to libutils/binder/SharedBuffer.cpp
diff --git a/libutils/SharedBuffer.h b/libutils/binder/SharedBuffer.h
similarity index 100%
rename from libutils/SharedBuffer.h
rename to libutils/binder/SharedBuffer.h
diff --git a/libutils/SharedBuffer_test.cpp b/libutils/binder/SharedBuffer_test.cpp
similarity index 100%
rename from libutils/SharedBuffer_test.cpp
rename to libutils/binder/SharedBuffer_test.cpp
diff --git a/libutils/String16.cpp b/libutils/binder/String16.cpp
similarity index 100%
rename from libutils/String16.cpp
rename to libutils/binder/String16.cpp
diff --git a/libutils/String16_fuzz.cpp b/libutils/binder/String16_fuzz.cpp
similarity index 100%
rename from libutils/String16_fuzz.cpp
rename to libutils/binder/String16_fuzz.cpp
diff --git a/libutils/String16_test.cpp b/libutils/binder/String16_test.cpp
similarity index 100%
rename from libutils/String16_test.cpp
rename to libutils/binder/String16_test.cpp
diff --git a/libutils/String8.cpp b/libutils/binder/String8.cpp
similarity index 100%
rename from libutils/String8.cpp
rename to libutils/binder/String8.cpp
diff --git a/libutils/String8_fuzz.cpp b/libutils/binder/String8_fuzz.cpp
similarity index 100%
rename from libutils/String8_fuzz.cpp
rename to libutils/binder/String8_fuzz.cpp
diff --git a/libutils/String8_test.cpp b/libutils/binder/String8_test.cpp
similarity index 100%
rename from libutils/String8_test.cpp
rename to libutils/binder/String8_test.cpp
diff --git a/libutils/StrongPointer.cpp b/libutils/binder/StrongPointer.cpp
similarity index 100%
rename from libutils/StrongPointer.cpp
rename to libutils/binder/StrongPointer.cpp
diff --git a/libutils/StrongPointer_test.cpp b/libutils/binder/StrongPointer_test.cpp
similarity index 100%
rename from libutils/StrongPointer_test.cpp
rename to libutils/binder/StrongPointer_test.cpp
diff --git a/libutils/Unicode.cpp b/libutils/binder/Unicode.cpp
similarity index 100%
rename from libutils/Unicode.cpp
rename to libutils/binder/Unicode.cpp
diff --git a/libutils/Unicode_test.cpp b/libutils/binder/Unicode_test.cpp
similarity index 100%
rename from libutils/Unicode_test.cpp
rename to libutils/binder/Unicode_test.cpp
diff --git a/libutils/VectorImpl.cpp b/libutils/binder/VectorImpl.cpp
similarity index 100%
rename from libutils/VectorImpl.cpp
rename to libutils/binder/VectorImpl.cpp
diff --git a/libutils/Vector_benchmark.cpp b/libutils/binder/Vector_benchmark.cpp
similarity index 100%
rename from libutils/Vector_benchmark.cpp
rename to libutils/binder/Vector_benchmark.cpp
diff --git a/libutils/Vector_fuzz.cpp b/libutils/binder/Vector_fuzz.cpp
similarity index 100%
rename from libutils/Vector_fuzz.cpp
rename to libutils/binder/Vector_fuzz.cpp
diff --git a/libutils/Vector_test.cpp b/libutils/binder/Vector_test.cpp
similarity index 100%
rename from libutils/Vector_test.cpp
rename to libutils/binder/Vector_test.cpp
diff --git a/libutils/include/utils/Errors.h b/libutils/binder/include/utils/Errors.h
similarity index 100%
rename from libutils/include/utils/Errors.h
rename to libutils/binder/include/utils/Errors.h
diff --git a/libutils/include/utils/RefBase.h b/libutils/binder/include/utils/RefBase.h
similarity index 100%
rename from libutils/include/utils/RefBase.h
rename to libutils/binder/include/utils/RefBase.h
diff --git a/libutils/include/utils/String16.h b/libutils/binder/include/utils/String16.h
similarity index 100%
rename from libutils/include/utils/String16.h
rename to libutils/binder/include/utils/String16.h
diff --git a/libutils/include/utils/String8.h b/libutils/binder/include/utils/String8.h
similarity index 100%
rename from libutils/include/utils/String8.h
rename to libutils/binder/include/utils/String8.h
diff --git a/libutils/include/utils/StrongPointer.h b/libutils/binder/include/utils/StrongPointer.h
similarity index 100%
rename from libutils/include/utils/StrongPointer.h
rename to libutils/binder/include/utils/StrongPointer.h
diff --git a/libutils/include/utils/Unicode.h b/libutils/binder/include/utils/Unicode.h
similarity index 100%
rename from libutils/include/utils/Unicode.h
rename to libutils/binder/include/utils/Unicode.h
diff --git a/libutils/include/utils/Vector.h b/libutils/binder/include/utils/Vector.h
similarity index 100%
rename from libutils/include/utils/Vector.h
rename to libutils/binder/include/utils/Vector.h
diff --git a/libutils/include/utils/VectorImpl.h b/libutils/binder/include/utils/VectorImpl.h
similarity index 100%
rename from libutils/include/utils/VectorImpl.h
rename to libutils/binder/include/utils/VectorImpl.h
diff --git a/libutils/include/utils/Errors.h b/libutils/include/utils/Errors.h
new file mode 120000
index 0000000..2eba10b
--- /dev/null
+++ b/libutils/include/utils/Errors.h
@@ -0,0 +1 @@
+../../binder/include/utils/Errors.h
\ No newline at end of file
diff --git a/libutils/include/utils/RefBase.h b/libutils/include/utils/RefBase.h
new file mode 120000
index 0000000..86d72b1
--- /dev/null
+++ b/libutils/include/utils/RefBase.h
@@ -0,0 +1 @@
+../../binder/include/utils/RefBase.h
\ No newline at end of file
diff --git a/libutils/include/utils/String16.h b/libutils/include/utils/String16.h
new file mode 120000
index 0000000..b88792f
--- /dev/null
+++ b/libutils/include/utils/String16.h
@@ -0,0 +1 @@
+../../binder/include/utils/String16.h
\ No newline at end of file
diff --git a/libutils/include/utils/String8.h b/libutils/include/utils/String8.h
new file mode 120000
index 0000000..fa5a082
--- /dev/null
+++ b/libutils/include/utils/String8.h
@@ -0,0 +1 @@
+../../binder/include/utils/String8.h
\ No newline at end of file
diff --git a/libutils/include/utils/StrongPointer.h b/libutils/include/utils/StrongPointer.h
new file mode 120000
index 0000000..fd8bc60
--- /dev/null
+++ b/libutils/include/utils/StrongPointer.h
@@ -0,0 +1 @@
+../../binder/include/utils/StrongPointer.h
\ No newline at end of file
diff --git a/libutils/include/utils/Unicode.h b/libutils/include/utils/Unicode.h
new file mode 120000
index 0000000..8a480bc
--- /dev/null
+++ b/libutils/include/utils/Unicode.h
@@ -0,0 +1 @@
+../../binder/include/utils/Unicode.h
\ No newline at end of file
diff --git a/libutils/include/utils/Vector.h b/libutils/include/utils/Vector.h
new file mode 120000
index 0000000..e1571ef
--- /dev/null
+++ b/libutils/include/utils/Vector.h
@@ -0,0 +1 @@
+../../binder/include/utils/Vector.h
\ No newline at end of file
diff --git a/libutils/include/utils/VectorImpl.h b/libutils/include/utils/VectorImpl.h
new file mode 120000
index 0000000..4726446
--- /dev/null
+++ b/libutils/include/utils/VectorImpl.h
@@ -0,0 +1 @@
+../../binder/include/utils/VectorImpl.h
\ No newline at end of file