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

Commit cb7b7c1f authored by Shikha Malhotra's avatar Shikha Malhotra Committed by Automerger Merge Worker
Browse files

Merge "Check for IOCTL feature changed to not set inheritence" am: 2af771c3 am: 541fdb3d

parents f6f849b1 541fdb3d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3391,7 +3391,7 @@ bool check_if_ioctl_feature_is_supported() {
    auto temp_path = StringPrintf("%smisc/installd/ioctl_check", android_data_dir.c_str());
    if (access(temp_path.c_str(), F_OK) != 0) {
        open(temp_path.c_str(), O_CREAT | O_TRUNC | O_RDWR | O_CLOEXEC, 0644);
        result = set_quota_project_id(temp_path, 0, true) == 0;
        result = set_quota_project_id(temp_path, 0, false) == 0;
        // delete the temp file
        // remove the external file
        remove(temp_path.c_str());
+16 −0
Original line number Diff line number Diff line
@@ -535,6 +535,22 @@ TEST_F(ServiceTest, GetAppSizeProjectID_UID) {
        if (!usingProjectIds) {
            service->setFirstBoot();
        }

        if (access(using_project_ids.c_str(), F_OK) != 0) {
            // projectids is not used, so check that ioctl features should be absent
            auto temp_path = StringPrintf("%smisc/installd/ioctl_check", android_data_dir.c_str());

            if (access(temp_path.c_str(), F_OK) != 0) {
                open(temp_path.c_str(), O_CREAT | O_TRUNC | O_RDWR | O_CLOEXEC, 0644);
                bool result = set_quota_project_id(temp_path, 0, false) == 0;
                // delete the temp file
                // remove the external file
                remove(temp_path.c_str());
                // since using_project_ids file is not present, so ioctl settings should be absent
                //  that is denoted by the result of setting project id flag as false
                ASSERT_FALSE(result);
            }
        }
        // call the getAppSize to get the current size of the external storage owning app
        service->getAppSize(std::nullopt, packageNames, 0, InstalldNativeService::FLAG_USE_QUOTA,
                            externalStorageAppId, ceDataInodes, codePaths, &externalStorageSize);