Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 013fa056 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Revert Android.bp changes."

parents 8da6741a 4ab5d534
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -10,7 +10,6 @@ package {
cc_defaults {
cc_defaults {
    name: "installd_defaults",
    name: "installd_defaults",


    cpp_std: "c++2a",
    cflags: [
    cflags: [
        "-Wall",
        "-Wall",
        "-Werror",
        "-Werror",
@@ -42,7 +41,6 @@ cc_defaults {
        "libbinder",
        "libbinder",
        "libcrypto",
        "libcrypto",
        "libcutils",
        "libcutils",
        "libext2_uuid",
        "liblog",
        "liblog",
        "liblogwrap",
        "liblogwrap",
        "libprocessgroup",
        "libprocessgroup",
@@ -53,6 +51,7 @@ cc_defaults {
    ],
    ],
    static_libs: [
    static_libs: [
        "libasync_safe",
        "libasync_safe",
        "libext2_uuid",
    ],
    ],
    export_shared_lib_headers: [
    export_shared_lib_headers: [
        "libbinder",
        "libbinder",
@@ -241,8 +240,6 @@ cc_library_static {


cc_binary {
cc_binary {
    name: "otapreopt",
    name: "otapreopt",

    cpp_std: "c++2a",
    cflags: [
    cflags: [
        "-Wall",
        "-Wall",
        "-Werror",
        "-Werror",
@@ -266,13 +263,13 @@ cc_binary {
        "libasync_safe",
        "libasync_safe",
        "libdiskusage",
        "libdiskusage",
        "libotapreoptparameters",
        "libotapreoptparameters",
        "libext2_uuid",
    ],
    ],


    shared_libs: [
    shared_libs: [
        "libbase",
        "libbase",
        "libcrypto",
        "libcrypto",
        "libcutils",
        "libcutils",
        "libext2_uuid",
        "liblog",
        "liblog",
        "liblogwrap",
        "liblogwrap",
        "libprocessgroup",
        "libprocessgroup",
+62 −19
Original line number Original line Diff line number Diff line
@@ -8,54 +8,56 @@ package {
    default_applicable_licenses: ["frameworks_native_license"],
    default_applicable_licenses: ["frameworks_native_license"],
}
}


cc_defaults {
cc_test {
    name: "installd_tests_defaults",
    name: "installd_utils_test",
    test_suites: ["device-tests"],
    test_suites: ["device-tests"],
    clang: true,
    clang: true,
    cpp_std: "c++2a",
    srcs: ["installd_utils_test.cpp"],
    cflags: [
    cflags: [
        "-Wall",
        "-Wall",
        "-Werror",
        "-Werror",
    ],
    ],
    shared_libs: [
    shared_libs: [
        "libbase",
        "libbase",
        "libcutils",
        "libext2_uuid",
        "libutils",
        "libutils",
        "libcutils",
    ],
    ],
    static_libs: [
        "liblog",
    ],
}

cc_test {
    name: "installd_utils_test",
    defaults: ["installd_tests_defaults"],
    srcs: ["installd_utils_test.cpp"],
    static_libs: [
    static_libs: [
        "libasync_safe",
        "libasync_safe",
        "libdiskusage",
        "libdiskusage",
        "libext2_uuid",
        "libinstalld",
        "libinstalld",
        "liblog",
    ],
    ],
    test_config: "installd_utils_test.xml",
    test_config: "installd_utils_test.xml",
}
}


cc_test {
cc_test {
    name: "installd_cache_test",
    name: "installd_cache_test",
    defaults: ["installd_tests_defaults"],
    test_suites: ["device-tests"],
    clang: true,
    srcs: ["installd_cache_test.cpp"],
    srcs: ["installd_cache_test.cpp"],
    cflags: [
        "-Wall",
        "-Werror",
    ],
    shared_libs: [
    shared_libs: [
        "libbase",
        "libbinder",
        "libbinder",
        "libcrypto",
        "libcrypto",
        "libcutils",
        "libprocessgroup",
        "libprocessgroup",
        "libselinux",
        "libselinux",
        "libutils",
        "server_configurable_flags",
        "server_configurable_flags",
    ],
    ],
    static_libs: [
    static_libs: [
        "libasync_safe",
        "libasync_safe",
        "libdiskusage",
        "libdiskusage",
        "libext2_uuid",
        "libinstalld",
        "libinstalld",
        "libziparchive",
        "libziparchive",
        "liblog",
        "liblogwrap",
        "liblogwrap",
    ],
    ],
    test_config: "installd_cache_test.xml",
    test_config: "installd_cache_test.xml",
@@ -78,21 +80,31 @@ cc_test {


cc_test {
cc_test {
    name: "installd_service_test",
    name: "installd_service_test",
    defaults: ["installd_tests_defaults"],
    test_suites: ["device-tests"],
    clang: true,
    srcs: ["installd_service_test.cpp"],
    srcs: ["installd_service_test.cpp"],
    cflags: [
        "-Wall",
        "-Werror",
    ],
    shared_libs: [
    shared_libs: [
        "libbase",
        "libbinder",
        "libbinder",
        "libcrypto",
        "libcrypto",
        "libcutils",
        "libprocessgroup",
        "libprocessgroup",
        "libselinux",
        "libselinux",
        "libutils",
        "packagemanager_aidl-cpp",
        "packagemanager_aidl-cpp",
        "server_configurable_flags",
        "server_configurable_flags",
    ],
    ],
    static_libs: [
    static_libs: [
        "libasync_safe",
        "libasync_safe",
        "libdiskusage",
        "libdiskusage",
        "libext2_uuid",
        "libinstalld",
        "libinstalld",
        "libziparchive",
        "libziparchive",
        "liblog",
        "liblogwrap",
        "liblogwrap",
    ],
    ],
    test_config: "installd_service_test.xml",
    test_config: "installd_service_test.xml",
@@ -115,19 +127,29 @@ cc_test {


cc_test {
cc_test {
    name: "installd_dexopt_test",
    name: "installd_dexopt_test",
    defaults: ["installd_tests_defaults"],
    test_suites: ["device-tests"],
    clang: true,
    srcs: ["installd_dexopt_test.cpp"],
    srcs: ["installd_dexopt_test.cpp"],
    cflags: [
        "-Wall",
        "-Werror",
    ],
    shared_libs: [
    shared_libs: [
        "libbase",
        "libbinder",
        "libbinder",
        "libcrypto",
        "libcrypto",
        "libcutils",
        "libprocessgroup",
        "libprocessgroup",
        "libselinux",
        "libselinux",
        "libutils",
        "server_configurable_flags",
        "server_configurable_flags",
    ],
    ],
    static_libs: [
    static_libs: [
        "libasync_safe",
        "libasync_safe",
        "libdiskusage",
        "libdiskusage",
        "libext2_uuid",
        "libinstalld",
        "libinstalld",
        "liblog",
        "liblogwrap",
        "liblogwrap",
        "libziparchive",
        "libziparchive",
        "libz",
        "libz",
@@ -152,21 +174,42 @@ cc_test {


cc_test {
cc_test {
    name: "installd_otapreopt_test",
    name: "installd_otapreopt_test",
    defaults: ["installd_tests_defaults"],
    test_suites: ["device-tests"],
    clang: true,
    srcs: ["installd_otapreopt_test.cpp"],
    srcs: ["installd_otapreopt_test.cpp"],
    cflags: [
        "-Wall",
        "-Werror",
    ],
    shared_libs: [
    shared_libs: [
        "libbase",
        "libcutils",
        "libutils",
        "server_configurable_flags",
        "server_configurable_flags",
    ],
    ],
    static_libs: [
    static_libs: [
        "liblog",
        "libotapreoptparameters",
        "libotapreoptparameters",
    ],
    ],
}
}


cc_test {
cc_test {
    name: "installd_file_test",
    name: "installd_file_test",
    defaults: ["installd_tests_defaults"],
    test_suites: ["device-tests"],
    clang: true,
    srcs: ["installd_file_test.cpp"],
    srcs: ["installd_file_test.cpp"],
    cflags: [
        "-Wall",
        "-Werror",
    ],
    shared_libs: [
        "libbase",
        "libcutils",
        "libutils",
    ],
    static_libs: [
    static_libs: [
        "libext2_uuid",
        "libinstalld",
        "libinstalld",
        "liblog",
    ],
    ],
}
}
+1 −1
Original line number Original line Diff line number Diff line
@@ -156,7 +156,7 @@ static bool find_file(const char* path, Pred&& pred) {
}
}


static bool exists_renamed_deleted_dir() {
static bool exists_renamed_deleted_dir() {
    return find_file(kTestPath, [](std::string_view name, bool is_dir) {
    return find_file(kTestPath, [](const std::string& name, bool is_dir) {
        return is_dir && is_renamed_deleted_dir(name);
        return is_dir && is_renamed_deleted_dir(name);
    });
    });
}
}
+18 −0
Original line number Original line Diff line number Diff line
@@ -555,6 +555,24 @@ TEST_F(UtilsTest, MatchExtension_Invalid) {
    EXPECT_EQ(0, MatchExtension("docx"));
    EXPECT_EQ(0, MatchExtension("docx"));
}
}


TEST_F(UtilsTest, TestIsRenamedDeletedDir) {
    EXPECT_FALSE(is_renamed_deleted_dir(""));
    EXPECT_FALSE(is_renamed_deleted_dir("1"));
    EXPECT_FALSE(is_renamed_deleted_dir("="));
    EXPECT_FALSE(is_renamed_deleted_dir("=="));
    EXPECT_FALSE(is_renamed_deleted_dir("d=="));
    EXPECT_FALSE(is_renamed_deleted_dir("ed=="));
    EXPECT_FALSE(is_renamed_deleted_dir("ted=="));
    EXPECT_FALSE(is_renamed_deleted_dir("eted=="));
    EXPECT_FALSE(is_renamed_deleted_dir("leted=="));
    EXPECT_FALSE(is_renamed_deleted_dir("eleted=="));
    EXPECT_FALSE(is_renamed_deleted_dir("deleted=="));
    EXPECT_FALSE(is_renamed_deleted_dir("=deleted=="));
    EXPECT_TRUE(is_renamed_deleted_dir("==deleted=="));
    EXPECT_TRUE(is_renamed_deleted_dir("123==deleted=="));
    EXPECT_TRUE(is_renamed_deleted_dir("5b14b6458a44==deleted=="));
}

TEST_F(UtilsTest, TestRollbackPaths) {
TEST_F(UtilsTest, TestRollbackPaths) {
    EXPECT_EQ("/data/misc_ce/0/rollback/239/com.foo",
    EXPECT_EQ("/data/misc_ce/0/rollback/239/com.foo",
            create_data_misc_ce_rollback_package_path(nullptr, 0, 239, "com.foo"));
            create_data_misc_ce_rollback_package_path(nullptr, 0, 239, "com.foo"));
+6 −2
Original line number Original line Diff line number Diff line
@@ -637,8 +637,12 @@ static int rename_delete_dir_contents(const std::string& pathname,
    return delete_dir_contents(temp_dir_path.c_str(), 1, exclusion_predicate, ignore_if_missing);
    return delete_dir_contents(temp_dir_path.c_str(), 1, exclusion_predicate, ignore_if_missing);
}
}


bool is_renamed_deleted_dir(std::string_view path) {
bool is_renamed_deleted_dir(const std::string& path) {
    return path.ends_with(deletedSuffix);
    if (path.size() < deletedSuffix.size()) {
        return false;
    }
    std::string_view pathSuffix{path.c_str() + path.size() - deletedSuffix.size()};
    return pathSuffix == deletedSuffix;
}
}


int rename_delete_dir_contents_and_dir(const std::string& pathname, bool ignore_if_missing) {
int rename_delete_dir_contents_and_dir(const std::string& pathname, bool ignore_if_missing) {
Loading