profman: inclusive language updates

Based on:
  https://source.android.com/setup/contribute/respectful-code

Bug: 161336379
Bug: 161896447
Test: m
Change-Id: I7aad8b4a68ff046b4710c39643960650a58aff28
diff --git a/profman/boot_image_profile.cc b/profman/boot_image_profile.cc
index 3f9665f..7596367 100644
--- a/profman/boot_image_profile.cc
+++ b/profman/boot_image_profile.cc
@@ -189,9 +189,9 @@
                                       uint32_t max_aggregation_count,
                                       const FlattenProfileData::ItemMetadata& metadata,
                                       const BootImageOptions& options) {
-  bool blacklisted = options.preloaded_classes_blacklist.find(class_name) !=
-      options.preloaded_classes_blacklist.end();
-  return !blacklisted && IncludeItemInProfile(
+  bool denylisted = options.preloaded_classes_denylist.find(class_name) !=
+      options.preloaded_classes_denylist.end();
+  return !denylisted && IncludeItemInProfile(
       max_aggregation_count, options.preloaded_class_threshold, metadata, options);
 }
 
diff --git a/profman/boot_image_profile.h b/profman/boot_image_profile.h
index a3dd52c..19cdb2f 100644
--- a/profman/boot_image_profile.h
+++ b/profman/boot_image_profile.h
@@ -66,7 +66,7 @@
   bool append_package_use_list = false;
 
   // The set of classes that should not be preloaded in Zygote
-  std::set<std::string> preloaded_classes_blacklist;
+  std::set<std::string> preloaded_classes_denylist;
 };
 
 // Generate a boot image profile according to the specified options.
diff --git a/profman/profile_assistant_test.cc b/profman/profile_assistant_test.cc
index 2f3f58d..c289ae6 100644
--- a/profman/profile_assistant_test.cc
+++ b/profman/profile_assistant_test.cc
@@ -763,8 +763,8 @@
       "Ljava/lang/Object;->toString()Ljava/lang/String;";
   // Method used by a special package which will get a different threshold;
   const std::string kUncommonSpecialPackageMethod = "Ljava/lang/Object;->hashCode()I";
-  // Blacklisted class
-  const std::string kPreloadedBlacklistedClass = "Ljava/lang/Thread;";
+  // Denylisted class
+  const std::string kPreloadedDenylistedClass = "Ljava/lang/Thread;";
 
   // Thresholds for this test.
   static const size_t kDirtyThreshold = 100;
@@ -782,42 +782,42 @@
       "{dex1}H" + kCommonHotMethod,
       "{dex1}P" + kStartupMethodForUpgrade,
       "{dex1}" + kUncommonDirtyClass,
-      "{dex1}" + kPreloadedBlacklistedClass,
+      "{dex1}" + kPreloadedDenylistedClass,
 
       "{dex2}" + kCleanClass,
       "{dex2}" + kDirtyClass,
       "{dex2}P" + kCommonHotMethod,
       "{dex2}P" + kStartupMethodForUpgrade,
       "{dex2}" + kUncommonDirtyClass,
-      "{dex2}" + kPreloadedBlacklistedClass,
+      "{dex2}" + kPreloadedDenylistedClass,
 
       "{dex3}P" + kUncommonMethod,
       "{dex3}PS" + kStartupMethodForUpgrade,
       "{dex3}S" + kCommonHotMethod,
       "{dex3}S" + kSpecialPackageStartupMethod,
       "{dex3}" + kDirtyClass,
-      "{dex3}" + kPreloadedBlacklistedClass,
+      "{dex3}" + kPreloadedDenylistedClass,
 
       "{dex4}" + kDirtyClass,
       "{dex4}P" + kCommonHotMethod,
       "{dex4}S" + kSpecialPackageStartupMethod,
       "{dex4}P" + kUncommonSpecialPackageMethod,
-      "{dex4}" + kPreloadedBlacklistedClass,
+      "{dex4}" + kPreloadedDenylistedClass,
   };
   std::string input_file_contents = JoinProfileLines(input_data);
 
-  ScratchFile preloaded_class_blacklist;
-  std::string blacklist_content = DescriptorToDot(kPreloadedBlacklistedClass.c_str());
-  EXPECT_TRUE(preloaded_class_blacklist.GetFile()->WriteFully(
-      blacklist_content.c_str(), blacklist_content.length()));
+  ScratchFile preloaded_class_denylist;
+  std::string denylist_content = DescriptorToDot(kPreloadedDenylistedClass.c_str());
+  EXPECT_TRUE(preloaded_class_denylist.GetFile()->WriteFully(
+      denylist_content.c_str(), denylist_content.length()));
 
-  EXPECT_EQ(0, preloaded_class_blacklist.GetFile()->Flush());
-  EXPECT_TRUE(preloaded_class_blacklist.GetFile()->ResetOffset());
+  EXPECT_EQ(0, preloaded_class_denylist.GetFile()->Flush());
+  EXPECT_TRUE(preloaded_class_denylist.GetFile()->ResetOffset());
   // Expected data
   std::vector<std::string> expected_data = {
       kCleanClass,
       kDirtyClass,
-      kPreloadedBlacklistedClass,
+      kPreloadedDenylistedClass,
       "HSP" + kCommonHotMethod,
       "HS" + kSpecialPackageStartupMethod,
       "HSP" + kStartupMethodForUpgrade
@@ -854,7 +854,7 @@
   args.push_back("--out-preloaded-classes-path=" + out_preloaded_classes.GetFilename());
   args.push_back("--apk=" + core_dex);
   args.push_back("--dex-location=" + core_dex);
-  args.push_back("--preloaded-classes-blacklist=" + preloaded_class_blacklist.GetFilename());
+  args.push_back("--preloaded-classes-denylist=" + preloaded_class_denylist.GetFilename());
 
   std::string error;
   ASSERT_EQ(ExecAndReturnCode(args, &error), 0) << error;
diff --git a/profman/profman.cc b/profman/profman.cc
index a011cd0..2adf61f 100644
--- a/profman/profman.cc
+++ b/profman/profman.cc
@@ -161,7 +161,7 @@
   UsageError("  --preloaded-class-threshold=percentage between 0 and 100");
   UsageError("      what threshold to apply to the classes when deciding whether or not to");
   UsageError("      include it in the final preloaded classes.");
-  UsageError("  --preloaded-classes-blacklist=file");
+  UsageError("  --preloaded-classes-denylist=file");
   UsageError("      a file listing the classes that should not be preloaded in Zygote");
   UsageError("  --upgrade-startup-to-hot=true|false:");
   UsageError("      whether or not to upgrade startup methods to hot");
@@ -345,15 +345,15 @@
                         &boot_image_options_.preloaded_class_threshold,
                         0u,
                         100u);
-      } else if (StartsWith(option, "--preloaded-classes-blacklist=")) {
-        std::string preloaded_classes_blacklist =
-            std::string(option.substr(strlen("--preloaded-classes-blacklist=")));
+      } else if (StartsWith(option, "--preloaded-classes-denylist=")) {
+        std::string preloaded_classes_denylist =
+            std::string(option.substr(strlen("--preloaded-classes-denylist=")));
         // Read the user-specified list of methods.
         std::unique_ptr<std::set<std::string>>
-            blacklist(ReadCommentedInputFromFile<std::set<std::string>>(
-                preloaded_classes_blacklist.c_str(), nullptr));  // No post-processing.
-        boot_image_options_.preloaded_classes_blacklist.insert(
-            blacklist->begin(), blacklist->end());
+            denylist(ReadCommentedInputFromFile<std::set<std::string>>(
+                preloaded_classes_denylist.c_str(), nullptr));  // No post-processing.
+        boot_image_options_.preloaded_classes_denylist.insert(
+            denylist->begin(), denylist->end());
       } else if (StartsWith(option, "--upgrade-startup-to-hot=")) {
         ParseBoolOption(raw_option,
                         "--upgrade-startup-to-hot=",
diff --git a/tools/boot-image-profile-generate.sh b/tools/boot-image-profile-generate.sh
index de4dd42..20d0421 100755
--- a/tools/boot-image-profile-generate.sh
+++ b/tools/boot-image-profile-generate.sh
@@ -20,8 +20,8 @@
 #   1) the boot.zip file which contains the boot classpath and system server jars.
 #      This file can be obtained from running `m dist` or by configuring the device with
 #      the `art/tools/boot-image-profile-configure-device.sh` script.
-#   2) the preloaded classes blacklist which specify what clases should not be preloaded
-#      in Zygote. Usually located in usually in frameworks/base/config/preloaded-classes-blacklist
+#   2) the preloaded classes denylist which specify what clases should not be preloaded
+#      in Zygote. Usually located in usually in frameworks/base/config/preloaded-classes-denylist
 #   3) a list of raw boot image profiles extracted from devices. An example how to do that is
 #      by running `art/tools/boot-image-profile-extract-profile.sh` script.
 #
@@ -39,11 +39,11 @@
 fi
 
 if [[ "$#" -lt 4 ]]; then
-  echo "Usage $0 <output-dir> <boot.zip-location> <preloaded-blacklist-location> <profile-input1> <profile-input2> ... <profman args>"
+  echo "Usage $0 <output-dir> <boot.zip-location> <preloaded-denylist-location> <profile-input1> <profile-input2> ... <profman args>"
   echo "Without any profman args the script will use defaults."
-  echo "Example: $0 output-dir boot.zip frameworks/base/config/preloaded-classes-blacklist android1.prof android2.prof"
-  echo "         $0 output-dir boot.zip frameworks/base/config/preloaded-classes-blacklist android.prof --profman-arg --upgrade-startup-to-hot=true"
-  echo "preloaded.black-list is usually in frameworks/base/config/preloaded-classes-blacklist"
+  echo "Example: $0 output-dir boot.zip frameworks/base/config/preloaded-classes-denylist android1.prof android2.prof"
+  echo "         $0 output-dir boot.zip frameworks/base/config/preloaded-classes-denylist android.prof --profman-arg --upgrade-startup-to-hot=true"
+  echo "preloaded-deny-list-location is usually frameworks/base/config/preloaded-classes-denylist"
   exit 1
 fi
 
@@ -53,7 +53,7 @@
 
 OUT_DIR="$1"
 BOOT_ZIP="$2"
-PRELOADED_BLACKLIST="$3"
+PRELOADED_DENYLIST="$3"
 shift 3
 
 # Read the profile input args.
@@ -119,7 +119,7 @@
   "${profman_profile_input_args[@]}" \
   --out-profile-path="$OUT_BOOT_PROFILE" \
   --out-preloaded-classes-path="$OUT_PRELOADED_CLASSES" \
-  --preloaded-classes-blacklist="$PRELOADED_BLACKLIST" \
+  --preloaded-classes-denylist="$PRELOADED_DENYLIST" \
   --special-package=android:1 \
   --special-package=com.android.systemui:1 \
   "${profman_args[@]}"
@@ -147,4 +147,4 @@
 CLEAN_UP="${CLEAN_UP:-true}"
 if [[ "$CLEAN_UP" = "true" ]]; then
   rm -rf "$WORK_DIR"
-fi
\ No newline at end of file
+fi