From ea2912f187cec8d426cfc2ca715b9a503355fa37 Mon Sep 17 00:00:00 2001 From: xunchang Date: Sun, 17 Mar 2019 16:45:12 -0700 Subject: Create a FuseDataProvider base class The fuse data provider for adb/sdcard shares common code and structures. This cl creates a FuseDataProvider base class and provides implementations for adb and sdcard. In the follow cls, we can kill the provider_vtab struct; and also add another implementation to parse a block map file and provides data. Test: unit tests pass, sideload a package, apply a package from sdcard Change-Id: If8311666a52a2e3c0fbae0ee9688fa6d01e4ad09 --- tests/component/sideload_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/component') diff --git a/tests/component/sideload_test.cpp b/tests/component/sideload_test.cpp index d5e074c63..8d290dbcd 100644 --- a/tests/component/sideload_test.cpp +++ b/tests/component/sideload_test.cpp @@ -53,9 +53,9 @@ TEST(SideloadTest, run_fuse_sideload) { provider_vtab vtab; vtab.close = [](void) {}; vtab.read_block = [&blocks](uint32_t block, uint8_t* buffer, uint32_t fetch_size) { - if (block >= 4) return -1; + if (block >= 4) return false; blocks[block].copy(reinterpret_cast(buffer), fetch_size); - return 0; + return true; }; TemporaryDir mount_point; -- cgit v1.2.3