Don't log error when deleting a profile that doesn't exist.

Before this change, after `std::filesystem::remove` returns false, artd
logs an error message unless the `ec` out-parameter is ENOENT. However,
when the file doesn't exist, the function actually sets `ec` to 0
instead of ENOENT. This CL fixes the check.

Bug: 266036814
Test: m test-art-host-gtest-art_artd_tests
Ignore-AOSP-First: ART Services.
Change-Id: I259ba7ea55dcdae7f7e269a3a5331a253c23737f
diff --git a/artd/artd.cc b/artd/artd.cc
index ffa30f4..fd2da31 100644
--- a/artd/artd.cc
+++ b/artd/artd.cc
@@ -555,7 +555,8 @@
   std::string profile_path = OR_RETURN_FATAL(BuildProfileOrDmPath(in_profile));
 
   std::error_code ec;
-  if (!std::filesystem::remove(profile_path, ec) && ec.value() != ENOENT) {
+  std::filesystem::remove(profile_path, ec);
+  if (ec) {
     LOG(ERROR) << "Failed to remove '{}': {}"_format(profile_path, ec.message());
   }
 
diff --git a/artd/artd_test.cc b/artd/artd_test.cc
index 2f85887..3fd7b24 100644
--- a/artd/artd_test.cc
+++ b/artd/artd_test.cc
@@ -1432,7 +1432,9 @@
 }
 
 TEST_F(ArtdTest, deleteProfileDoesNotExist) {
-  std::string profile_file = OR_FATAL(BuildProfileOrDmPath(profile_path_.value()));
+  auto scoped_set_logger = ScopedSetLogger(mock_logger_.AsStdFunction());
+  EXPECT_CALL(mock_logger_, Call).Times(0);
+
   EXPECT_TRUE(artd_->deleteProfile(profile_path_.value()).isOk());
 }
 
@@ -1442,6 +1444,10 @@
       mock_logger_,
       Call(_, _, _, _, _, ContainsRegex(R"re(Failed to remove .*primary\.prof\.12345\.tmp)re")));
 
+  std::string profile_file = OR_FATAL(BuildProfileOrDmPath(profile_path_.value()));
+  auto scoped_inaccessible = ScopedInaccessible(std::filesystem::path(profile_file).parent_path());
+  auto scoped_unroot = ScopedUnroot();
+
   EXPECT_TRUE(artd_->deleteProfile(profile_path_.value()).isOk());
 }