Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)

Bug: 166295507
Merged-In: Ic072c06935a52c466d43fe4787cee7c7da73756c
Change-Id: Ia56c511912ee213555b170faf292f1640d90cb75
diff --git a/dictionaries/sample.combined b/dictionaries/sample.combined
index 4fa595e..9cbdd2a 100644
--- a/dictionaries/sample.combined
+++ b/dictionaries/sample.combined
@@ -14,7 +14,7 @@
 # should not be considered a typo, but that should never be suggested
 # explicitly. An entry may be made not a word by adding a `not_a_word'
 # field with a value of `true'. The main reason for putting such entries
-# into the dictionary is to add shortcut targets and maybe a whitelist
+# into the dictionary is to add shortcut targets and maybe an allowlist
 # replacement.
 #
 # Each word may or may not have any number of shortcut target lines
diff --git a/java/res/values/config-auto-correction-thresholds.xml b/java/res/values/config-auto-correction-thresholds.xml
index fc701c7..668f90e 100644
--- a/java/res/values/config-auto-correction-thresholds.xml
+++ b/java/res/values/config-auto-correction-thresholds.xml
@@ -37,7 +37,7 @@
     <!-- Chosen to be slightly less than the "aggressive" threshold. This is the threshold for
          a mildly plausible suggestion given the input; if no "plausible" suggestion is present
          for a language, it's a strong indicator the user is not typing in this language, so we
-         may be more forgiving of whitelist entries in another language. -->
+         may be more forgiving of allowlist entries in another language. -->
     <string name="plausibility_threshold" translatable="false">0.065</string>
 
     <!-- The index of the auto correction threshold values array. -->
diff --git a/java/res/values/emoji-categories.xml b/java/res/values/emoji-categories.xml
index ce82a8b..ae5ccc7 100644
--- a/java/res/values/emoji-categories.xml
+++ b/java/res/values/emoji-categories.xml
@@ -22,7 +22,7 @@
      There is another emoji code point list for JB-MR2 and KLP and later under
      res/xml/values-v1[89].-->
 <resources>
-    <!-- Dummy codeArrays for recents emoji keyboard.
+    <!-- Placeholder codeArrays for recents emoji keyboard.
          Do not remove these keys, because they are used as a template. -->
     <array
         name="emoji_recents"
diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml
index ea8f292..3d25f42 100644
--- a/java/res/xml-sw600dp/key_styles_common.xml
+++ b/java/res/xml-sw600dp/key_styles_common.xml
@@ -38,7 +38,7 @@
     <include
         latin:keyboardLayout="@xml/key_styles_settings" />
     <!-- Functional key styles -->
-    <!-- Base style for shift key. A single space is used for dummy label in moreKeys. -->
+    <!-- Base style for shift key. A single space is used for base label in moreKeys. -->
     <key-style
         latin:styleName="baseForShiftKeyStyle"
         latin:keyActionFlags="noKeyPreview"
diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml
index d85438d..fbc44da 100644
--- a/java/res/xml/key_styles_common.xml
+++ b/java/res/xml/key_styles_common.xml
@@ -38,7 +38,7 @@
     <include
         latin:keyboardLayout="@xml/key_styles_settings" />
     <!-- Functional key styles -->
-    <!-- Base style for shift key. A single space is used for dummy label in moreKeys. -->
+    <!-- Base style for shift key. A single space is used for base label in moreKeys. -->
     <key-style
         latin:styleName="baseForShiftKeyStyle"
         latin:keyActionFlags="noKeyPreview"
diff --git a/java/res/xml/prefs_screen_accounts.xml b/java/res/xml/prefs_screen_accounts.xml
index 75fff52..415b0b4 100644
--- a/java/res/xml/prefs_screen_accounts.xml
+++ b/java/res/xml/prefs_screen_accounts.xml
@@ -19,7 +19,7 @@
     xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
     android:title="@string/settings_screen_accounts">
 
-    <!-- This preference is a dummy view of the underlying preference.
+    <!-- This preference is a fake view of the underlying preference.
          This isn't persisted and the summary/title is refreshed by the fragment
          after inspecting the underlying account preference. -->
     <Preference
diff --git a/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java b/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java
index 7d01351..94dd7a1 100644
--- a/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java
+++ b/java/src/com/android/inputmethod/dictionarypack/MetadataDbHelper.java
@@ -870,7 +870,7 @@
      */
     public static void updateClientInfo(final Context context, final String clientId,
             final ContentValues values) {
-        // Sanity check the content values
+        // Validity check the content values
         final String valuesClientId = values.getAsString(CLIENT_CLIENT_ID_COLUMN);
         final String valuesMetadataUri = values.getAsString(CLIENT_METADATA_URI_COLUMN);
         final String valuesMetadataAdditionalId =
diff --git a/java/src/com/android/inputmethod/event/Event.java b/java/src/com/android/inputmethod/event/Event.java
index e3b1afc..58d878f 100644
--- a/java/src/com/android/inputmethod/event/Event.java
+++ b/java/src/com/android/inputmethod/event/Event.java
@@ -123,7 +123,7 @@
         mSuggestedWordInfo = suggestedWordInfo;
         mFlags = flags;
         mNextEvent = next;
-        // Sanity checks
+        // Validity checks
         // mSuggestedWordInfo is non-null if and only if the type is SUGGESTION_PICKED
         if (EVENT_TYPE_SUGGESTION_PICKED == mEventType) {
             if (null == mSuggestedWordInfo) {
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index 27e538c..faa2107 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -100,7 +100,7 @@
     private static final float MAX_LABEL_RATIO = 0.90f;
 
     // Main keyboard
-    // TODO: Consider having a dummy keyboard object to make this @Nonnull
+    // TODO: Consider having a base keyboard object to make this @Nonnull
     @Nullable
     private Keyboard mKeyboard;
     @Nonnull
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java
index b50c0a8..7dfb532 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.java
@@ -60,7 +60,7 @@
         if (text != null) {
             return text;
         }
-        // Sanity check.
+        // Validity check.
         if (index >= 0 && index < TEXTS_DEFAULT.length) {
             return TEXTS_DEFAULT[index];
         }
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
index 1fe0a4c..648610c 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java
@@ -523,7 +523,7 @@
         }
 
         // Read from metadata file in resources to get the baseline dictionary info.
-        // This ensures we start with a sane list of available dictionaries.
+        // This ensures we start with a valid list of available dictionaries.
         final int metadataResourceId = context.getResources().getIdentifier("metadata",
                 "raw", DictionaryInfoUtils.RESOURCE_PACKAGE_NAME);
         if (metadataResourceId == 0) {
diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
index 6001637..c13f0e2 100644
--- a/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
+++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryGetter.java
@@ -196,8 +196,8 @@
     }
 
     // ## HACK ## we prevent usage of a dictionary before version 18. The reason for this is, since
-    // those do not include whitelist entries, the new code with an old version of the dictionary
-    // would lose whitelist functionality.
+    // those do not include allowlist entries, the new code with an old version of the dictionary
+    // would lose allowlist functionality.
     private static boolean hackCanUseDictionaryFile(final File file) {
         if (!SHOULD_USE_DICT_VERSION) {
             return true;
@@ -211,7 +211,7 @@
                 // No version in the options : the format is unexpected
                 return false;
             }
-            // Version 18 is the first one to include the whitelist
+            // Version 18 is the first one to include the allowlist. 
             // Obviously this is a big ## HACK ##
             return Integer.parseInt(version) >= 18;
         } catch (java.io.FileNotFoundException e) {
diff --git a/java/src/com/android/inputmethod/latin/InputAttributes.java b/java/src/com/android/inputmethod/latin/InputAttributes.java
index 37effee..86c7810 100644
--- a/java/src/com/android/inputmethod/latin/InputAttributes.java
+++ b/java/src/com/android/inputmethod/latin/InputAttributes.java
@@ -66,7 +66,7 @@
                 || InputTypeUtils.isVisiblePasswordInputType(inputType);
         if (inputClass != InputType.TYPE_CLASS_TEXT) {
             // If we are not looking at a TYPE_CLASS_TEXT field, the following strange
-            // cases may arise, so we do a couple sanity checks for them. If it's a
+            // cases may arise, so we do a couple validity checks for them. If it's a
             // TYPE_CLASS_TEXT field, these special cases cannot happen, by construction
             // of the flags.
             if (null == editorInfo) {
diff --git a/java/src/com/android/inputmethod/latin/RichInputMethodSubtype.java b/java/src/com/android/inputmethod/latin/RichInputMethodSubtype.java
index cc58922..9411498 100644
--- a/java/src/com/android/inputmethod/latin/RichInputMethodSubtype.java
+++ b/java/src/com/android/inputmethod/latin/RichInputMethodSubtype.java
@@ -174,35 +174,35 @@
         }
     }
 
-    // Dummy no language QWERTY subtype. See {@link R.xml.method}.
-    private static final int SUBTYPE_ID_OF_DUMMY_NO_LANGUAGE_SUBTYPE = 0xdde0bfd3;
-    private static final String EXTRA_VALUE_OF_DUMMY_NO_LANGUAGE_SUBTYPE =
+    // Placeholer for no language QWERTY subtype. See {@link R.xml.method}.
+    private static final int SUBTYPE_ID_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE = 0xdde0bfd3;
+    private static final String EXTRA_VALUE_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE =
             "KeyboardLayoutSet=" + SubtypeLocaleUtils.QWERTY
             + "," + Constants.Subtype.ExtraValue.ASCII_CAPABLE
             + "," + Constants.Subtype.ExtraValue.ENABLED_WHEN_DEFAULT_IS_NOT_ASCII_CAPABLE
             + "," + Constants.Subtype.ExtraValue.EMOJI_CAPABLE;
     @Nonnull
-    private static final RichInputMethodSubtype DUMMY_NO_LANGUAGE_SUBTYPE =
+    private static final RichInputMethodSubtype PLACEHOLDER_NO_LANGUAGE_SUBTYPE =
             new RichInputMethodSubtype(InputMethodSubtypeCompatUtils.newInputMethodSubtype(
                     R.string.subtype_no_language_qwerty, R.drawable.ic_ime_switcher_dark,
                     SubtypeLocaleUtils.NO_LANGUAGE, KEYBOARD_MODE,
-                    EXTRA_VALUE_OF_DUMMY_NO_LANGUAGE_SUBTYPE,
+                    EXTRA_VALUE_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE,
                     false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */,
-                    SUBTYPE_ID_OF_DUMMY_NO_LANGUAGE_SUBTYPE));
+                    SUBTYPE_ID_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE));
     // Caveat: We probably should remove this when we add an Emoji subtype in {@link R.xml.method}.
-    // Dummy Emoji subtype. See {@link R.xml.method}.
-    private static final int SUBTYPE_ID_OF_DUMMY_EMOJI_SUBTYPE = 0xd78b2ed0;
-    private static final String EXTRA_VALUE_OF_DUMMY_EMOJI_SUBTYPE =
+    // Placeholder Emoji subtype. See {@link R.xml.method}.
+    private static final int SUBTYPE_ID_OF_PLACEHOLDER_EMOJI_SUBTYPE = 0xd78b2ed0;
+    private static final String EXTRA_VALUE_OF_PLACEHOLDER_EMOJI_SUBTYPE =
             "KeyboardLayoutSet=" + SubtypeLocaleUtils.EMOJI
             + "," + Constants.Subtype.ExtraValue.EMOJI_CAPABLE;
     @Nonnull
-    private static final RichInputMethodSubtype DUMMY_EMOJI_SUBTYPE = new RichInputMethodSubtype(
+    private static final RichInputMethodSubtype PLACEHOLDER_EMOJI_SUBTYPE = new RichInputMethodSubtype(
             InputMethodSubtypeCompatUtils.newInputMethodSubtype(
                     R.string.subtype_emoji, R.drawable.ic_ime_switcher_dark,
                     SubtypeLocaleUtils.NO_LANGUAGE, KEYBOARD_MODE,
-                    EXTRA_VALUE_OF_DUMMY_EMOJI_SUBTYPE,
+                    EXTRA_VALUE_OF_PLACEHOLDER_EMOJI_SUBTYPE,
                     false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */,
-                    SUBTYPE_ID_OF_DUMMY_EMOJI_SUBTYPE));
+                    SUBTYPE_ID_OF_PLACEHOLDER_EMOJI_SUBTYPE));
     private static RichInputMethodSubtype sNoLanguageSubtype;
     private static RichInputMethodSubtype sEmojiSubtype;
 
@@ -222,9 +222,9 @@
             return noLanguageSubtype;
         }
         Log.w(TAG, "Can't find any language with QWERTY subtype");
-        Log.w(TAG, "No input method subtype found; returning dummy subtype: "
-                + DUMMY_NO_LANGUAGE_SUBTYPE);
-        return DUMMY_NO_LANGUAGE_SUBTYPE;
+        Log.w(TAG, "No input method subtype found; returning placeholder subtype: "
+                + PLACEHOLDER_NO_LANGUAGE_SUBTYPE);
+        return PLACEHOLDER_NO_LANGUAGE_SUBTYPE;
     }
 
     @Nonnull
@@ -243,8 +243,8 @@
             return emojiSubtype;
         }
         Log.w(TAG, "Can't find emoji subtype");
-        Log.w(TAG, "No input method subtype found; returning dummy subtype: "
-                + DUMMY_EMOJI_SUBTYPE);
-        return DUMMY_EMOJI_SUBTYPE;
+        Log.w(TAG, "No input method subtype found; returning placeholder subtype: "
+                + PLACEHOLDER_EMOJI_SUBTYPE);
+        return PLACEHOLDER_EMOJI_SUBTYPE;
     }
 }
diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java
index 7ccefd2..da23617 100644
--- a/java/src/com/android/inputmethod/latin/Suggest.java
+++ b/java/src/com/android/inputmethod/latin/Suggest.java
@@ -225,7 +225,7 @@
                 // TODO: now that we have personalization, we may want to re-evaluate this decision
                 || !mDictionaryFacilitator.hasAtLeastOneInitializedMainDictionary()
                 // If the first suggestion is a shortcut we never auto-correct to it, regardless
-                // of how strong it is (whitelist entries are not KIND_SHORTCUT but KIND_WHITELIST).
+                // of how strong it is (allowlist entries are not KIND_SHORTCUT but KIND_WHITELIST).
                 // TODO: we may want to have shortcut-only entries auto-correct in the future.
                 || suggestionResults.first().isKindOf(SuggestedWordInfo.KIND_SHORTCUT)) {
             hasAutoCorrection = false;
diff --git a/java/src/com/android/inputmethod/latin/about/AboutPreferences.java b/java/src/com/android/inputmethod/latin/about/AboutPreferences.java
index f60b189..ec7e6de 100644
--- a/java/src/com/android/inputmethod/latin/about/AboutPreferences.java
+++ b/java/src/com/android/inputmethod/latin/about/AboutPreferences.java
@@ -19,7 +19,7 @@
 import android.app.Fragment;
 
 /**
- * Dummy class of AboutPreferences. Never use this.
+ * Placeholer class of AboutPreferences. Never use this.
  */
 public final class AboutPreferences extends Fragment {
     private AboutPreferences() {
diff --git a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
index 1dd5850..a7804a1 100644
--- a/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
+++ b/java/src/com/android/inputmethod/latin/inputlogic/InputLogic.java
@@ -805,7 +805,7 @@
         if (SpaceState.PHANTOM == inputTransaction.mSpaceState
                 && !settingsValues.isWordConnector(codePoint)) {
             if (isComposingWord) {
-                // Sanity check
+                // Validity check
                 throw new RuntimeException("Should not be composing here");
             }
             insertAutomaticSpaceIfOptionsAndTextAllow(settingsValues);
@@ -1370,7 +1370,7 @@
      * @return whether it's fine to apply the transformation after this code point.
      */
     private static boolean canBeFollowedByDoubleSpacePeriod(final int codePoint) {
-        // TODO: This should probably be a blacklist rather than a whitelist.
+        // TODO: This should probably be a denylist rather than a allowlist.
         // TODO: This should probably be language-dependant...
         return Character.isLetterOrDigit(codePoint)
                 || codePoint == Constants.CODE_SINGLE_QUOTE
diff --git a/java/src/com/android/inputmethod/latin/settings/CustomInputStylePreference.java b/java/src/com/android/inputmethod/latin/settings/CustomInputStylePreference.java
index 21ea8f8..44a98c1 100644
--- a/java/src/com/android/inputmethod/latin/settings/CustomInputStylePreference.java
+++ b/java/src/com/android/inputmethod/latin/settings/CustomInputStylePreference.java
@@ -330,7 +330,7 @@
                     R.array.predefined_layouts);
             // TODO: Should filter out already existing combinations of locale and layout.
             for (final String layout : predefinedKeyboardLayoutSet) {
-                // This is a dummy subtype with NO_LANGUAGE, only for display.
+                // This is a placeholder for a subtype with NO_LANGUAGE, only for display.
                 final InputMethodSubtype subtype =
                         AdditionalSubtypeUtils.createDummyAdditionalSubtype(
                                 SubtypeLocaleUtils.NO_LANGUAGE, layout);
diff --git a/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java
index 0dbc7c8..47f6549 100644
--- a/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java
+++ b/java/src/com/android/inputmethod/latin/utils/CapsModeUtils.java
@@ -194,10 +194,10 @@
         // English is a special case in that "American typography" rules, which are the most common
         // in English, state that a sentence terminator immediately following a quotation mark
         // should be swapped with it and de-duplicated (included in the quotation mark),
-        // e.g. <<Did he say, "let's go home?">>
+        // e.g. <<Did they say, "let's go home?">>
         // No other language has such a rule as far as I know, instead putting inside the quotation
         // mark as the exact thing quoted and handling the surrounding punctuation independently,
-        // e.g. <<Did he say, "let's go home"?>>
+        // e.g. <<Did they say, "let's go home"?>>
         if (spacingAndPunctuations.mUsesAmericanTypography) {
             for (; j > 0; j--) {
                 // Here we look to go over any closing punctuation. This is because in dominant
diff --git a/java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java b/java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java
index a381649..737e332 100644
--- a/java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java
+++ b/java/src/com/android/inputmethod/latin/utils/RecapitalizeStatus.java
@@ -81,7 +81,7 @@
     private static final int[] EMPTY_STORTED_SEPARATORS = {};
 
     public RecapitalizeStatus() {
-        // By default, initialize with dummy values that won't match any real recapitalize.
+        // By default, initialize with fake values that won't match any real recapitalize.
         start(-1, -1, "", Locale.getDefault(), EMPTY_STORTED_SEPARATORS);
         stop();
     }
diff --git a/native/jni/src/dictionary/header/header_policy.cpp b/native/jni/src/dictionary/header/header_policy.cpp
index d4f84d3..173cfd9 100644
--- a/native/jni/src/dictionary/header/header_policy.cpp
+++ b/native/jni/src/dictionary/header/header_policy.cpp
@@ -105,7 +105,7 @@
             &writingPos)) {
         return false;
     }
-    // Temporarily writes a dummy header size.
+    // Temporarily writes a placeholder header size.
     int headerSizeFieldPos = writingPos;
     if (!HeaderReadWriteUtils::writeDictionaryHeaderSize(outBuffer, 0 /* size */,
             &writingPos)) {
diff --git a/native/jni/src/dictionary/header/header_policy.h b/native/jni/src/dictionary/header/header_policy.h
index 47cc919..1b37575 100644
--- a/native/jni/src/dictionary/header/header_policy.h
+++ b/native/jni/src/dictionary/header/header_policy.h
@@ -97,7 +97,7 @@
                       headerPolicy->mForgettingCurveProbabilityValuesTableId),
               mCodePointTable(headerPolicy->mCodePointTable) {}
 
-    // Temporary dummy header.
+    // Temporary placeholder header.
     HeaderPolicy()
             : mDictFormatVersion(FormatUtils::UNKNOWN_VERSION), mDictionaryFlags(0), mSize(0),
               mAttributeMap(), mLocale(CharUtils::EMPTY_STRING), mMultiWordCostMultiplier(0.0f),
diff --git a/native/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.cpp b/native/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.cpp
index b167f0a..8485377 100644
--- a/native/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.cpp
+++ b/native/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.cpp
@@ -65,13 +65,15 @@
     }
     const int entryPos = getEntryPos(terminalId);
     if (terminalId >= mSize) {
-        ProbabilityEntry dummyEntry;
+        ProbabilityEntry placeholderEntry;
         // Write new entry.
         int writingPos = getBuffer()->getTailPosition();
         while (writingPos <= entryPos) {
-            // Fulfilling with dummy entries until writingPos.
-            if (!writeEntry(&dummyEntry, writingPos)) {
-                AKLOGE("Cannot write dummy entry. pos: %d, mSize: %d", writingPos, mSize);
+            // Fulfilling with placeholder entries until writingPos.
+            if (!writeEntry(&placeholderEntry, writingPos)) {
+                AKLOGE("Cannot write placeholder entry. pos: %d, mSize: %d",
+                    writingPos,
+                    mSize);
                 return false;
             }
             writingPos += getEntrySize();
diff --git a/native/jni/src/dictionary/structure/backward/v402/content/probability_entry.h b/native/jni/src/dictionary/structure/backward/v402/content/probability_entry.h
index 94e36bf..68176a4 100644
--- a/native/jni/src/dictionary/structure/backward/v402/content/probability_entry.h
+++ b/native/jni/src/dictionary/structure/backward/v402/content/probability_entry.h
@@ -38,7 +38,7 @@
             : mFlags(probabilityEntry.mFlags), mProbability(probabilityEntry.mProbability),
               mHistoricalInfo(probabilityEntry.mHistoricalInfo) {}
 
-    // Dummy entry
+    // Placeholder entry
     ProbabilityEntry()
             : mFlags(0), mProbability(NOT_A_PROBABILITY), mHistoricalInfo() {}
 
diff --git a/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.cpp b/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.cpp
index e3ab5ec..075dc6d 100644
--- a/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.cpp
+++ b/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.cpp
@@ -339,7 +339,7 @@
         const PtNodeParams *const ptNodeParams, int *const outTerminalId,
         int *const ptNodeWritingPos) {
     const int nodePos = *ptNodeWritingPos;
-    // Write dummy flags. The Node flags are updated with appropriate flags at the last step of the
+    // Write placeholder flags. The Node flags are updated with appropriate flags at the last step of the
     // PtNode writing.
     if (!DynamicPtWritingUtils::writeFlagsAndAdvancePosition(mTrieBuffer,
             0 /* nodeFlags */, ptNodeWritingPos)) {
diff --git a/native/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.cpp b/native/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.cpp
index b5e2e9d..1b1be32 100644
--- a/native/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.cpp
+++ b/native/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.cpp
@@ -76,14 +76,14 @@
     return true;
 }
 
-// Writes dummy PtNode array size when the head of PtNode array is read.
+// Writes placeholder PtNode array size when the head of PtNode array is read.
 bool DynamicPtGcEventListeners::TraversePolicyToPlaceAndWriteValidPtNodesToBuffer
         ::onDescend(const int ptNodeArrayPos) {
     mValidPtNodeCount = 0;
     int writingPos = mBufferToWrite->getTailPosition();
     mDictPositionRelocationMap->mPtNodeArrayPositionRelocationMap.insert(
             PtNodeWriter::PtNodeArrayPositionRelocationMap::value_type(ptNodeArrayPos, writingPos));
-    // Writes dummy PtNode array size because arrays can have a forward link or needles PtNodes.
+    // Writes placeholder PtNode array size because arrays can have a forward link or needles PtNodes.
     // This field will be updated later in onReadingPtNodeArrayTail() with actual PtNode count.
     mPtNodeArraySizeFieldPos = writingPos;
     return DynamicPtWritingUtils::writePtNodeArraySizeAndAdvancePosition(
diff --git a/native/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.cpp b/native/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.cpp
index 14428ed..62ec3d8 100644
--- a/native/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.cpp
+++ b/native/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.cpp
@@ -27,7 +27,7 @@
 const ShortcutListReadingUtils::ShortcutFlags
         ShortcutListReadingUtils::MASK_ATTRIBUTE_PROBABILITY = 0x0F;
 const int ShortcutListReadingUtils::SHORTCUT_LIST_SIZE_FIELD_SIZE = 2;
-// The numeric value of the shortcut probability that means 'whitelist'.
+// The numeric value of the shortcut probability that means 'allowlist'.
 const int ShortcutListReadingUtils::WHITELIST_SHORTCUT_PROBABILITY = 15;
 
 /* static */ ShortcutListReadingUtils::ShortcutFlags
diff --git a/native/jni/src/dictionary/structure/v4/content/probability_entry.h b/native/jni/src/dictionary/structure/v4/content/probability_entry.h
index 473354b..8dd1fb0 100644
--- a/native/jni/src/dictionary/structure/v4/content/probability_entry.h
+++ b/native/jni/src/dictionary/structure/v4/content/probability_entry.h
@@ -34,7 +34,7 @@
             : mFlags(probabilityEntry.mFlags), mProbability(probabilityEntry.mProbability),
               mHistoricalInfo(probabilityEntry.mHistoricalInfo) {}
 
-    // Dummy entry
+    // Placeholder entry
     ProbabilityEntry()
             : mFlags(Ver4DictConstants::FLAG_NOT_A_VALID_ENTRY), mProbability(NOT_A_PROBABILITY),
               mHistoricalInfo() {}
diff --git a/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp b/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp
index d974b50..774bc02 100644
--- a/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp
+++ b/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp
@@ -286,7 +286,7 @@
         const PtNodeParams *const ptNodeParams, int *const outTerminalId,
         int *const ptNodeWritingPos) {
     const int nodePos = *ptNodeWritingPos;
-    // Write dummy flags. The Node flags are updated with appropriate flags at the last step of the
+    // Write placeholder flags. The Node flags are updated with appropriate flags at the last step of the
     // PtNode writing.
     if (!DynamicPtWritingUtils::writeFlagsAndAdvancePosition(mTrieBuffer,
             0 /* nodeFlags */, ptNodeWritingPos)) {
diff --git a/native/jni/src/dictionary/utils/binary_dictionary_shortcut_iterator.h b/native/jni/src/dictionary/utils/binary_dictionary_shortcut_iterator.h
index e14805e..45c9cd3 100644
--- a/native/jni/src/dictionary/utils/binary_dictionary_shortcut_iterator.h
+++ b/native/jni/src/dictionary/utils/binary_dictionary_shortcut_iterator.h
@@ -41,12 +41,12 @@
     }
 
     // Gets the shortcut target itself as an int string and put it to outTarget, put its length
-    // to outTargetLength, put whether it is whitelist to outIsWhitelist.
+    // to outTargetLength, put whether it is allowlist to outIsAllowed.
     AK_FORCE_INLINE void nextShortcutTarget(
             const int maxDepth, int *const outTarget, int *const outTargetLength,
-            bool *const outIsWhitelist) {
+            bool *const outIsAllowed) {
         mShortcutStructurePolicy->getNextShortcut(maxDepth, outTarget, outTargetLength,
-                outIsWhitelist, &mHasNextShortcutTarget, &mPos);
+                outIsAllowed, &mHasNextShortcutTarget, &mPos);
     }
 
  private:
diff --git a/tests/res/raw/dummy_resource_for_testing.txt b/tests/res/raw/dummy_resource_for_testing.txt
index 05da86b..88e64fd 100644
--- a/tests/res/raw/dummy_resource_for_testing.txt
+++ b/tests/res/raw/dummy_resource_for_testing.txt
@@ -1,3 +1,3 @@
-/* This dummy raw resource is needed to be able to load string resources from a test APK
+/* This placeholder raw resource is needed to be able to load string resources from a test APK
  * successfully. (See {@link KeySpecParserSplitTests#setUp()}.
  */
diff --git a/tests/src/com/android/inputmethod/compat/SuggestionSpanUtilsTest.java b/tests/src/com/android/inputmethod/compat/SuggestionSpanUtilsTest.java
index a0544d6..e3fb30d 100644
--- a/tests/src/com/android/inputmethod/compat/SuggestionSpanUtilsTest.java
+++ b/tests/src/com/android/inputmethod/compat/SuggestionSpanUtilsTest.java
@@ -51,7 +51,7 @@
     }
 
     /**
-     * Helper method to create a dummy {@link SuggestedWordInfo}.
+     * Helper method to create a placeholder {@link SuggestedWordInfo}.
      *
      * @param kindAndFlags the kind and flags to be used to create {@link SuggestedWordInfo}.
      * @param word the word to be used to create {@link SuggestedWordInfo}.
diff --git a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java
index 92bff0e..b41c701 100644
--- a/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java
+++ b/tests/src/com/android/inputmethod/latin/SuggestedWordsTests.java
@@ -36,7 +36,7 @@
 public class SuggestedWordsTests {
 
     /**
-     * Helper method to create a dummy {@link SuggestedWordInfo} with specifying
+     * Helper method to create a placeholder {@link SuggestedWordInfo} with specifying
      * {@link SuggestedWordInfo#KIND_TYPED}.
      *
      * @param word the word to be used to create {@link SuggestedWordInfo}.
@@ -53,7 +53,7 @@
     }
 
     /**
-     * Helper method to create a dummy {@link SuggestedWordInfo} with specifying
+     * Helper method to create a placeholder {@link SuggestedWordInfo} with specifying
      * {@link SuggestedWordInfo#KIND_CORRECTION}.
      *
      * @param word the word to be used to create {@link SuggestedWordInfo}.
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java
index bd51365..2ae5bf5 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictEncoderUtils.java
@@ -446,7 +446,7 @@
     }
 
     /**
-     * Sanity-checking method.
+     * Validity-checking method.
      *
      * This method checks a list of PtNode arrays for juxtaposition, that is, it will do
      * nothing if each node array's cached address is actually the previous node array's address
@@ -664,7 +664,7 @@
                         + "of the node : " + dictEncoder.getPosition() + " <> "
                         + ptNode.mCachedAddressAfterUpdate);
             }
-            // Sanity checks.
+            // Validity checks.
             if (DBG && ptNode.getProbability() > FormatSpec.MAX_TERMINAL_FREQUENCY) {
                 throw new RuntimeException("A node has a frequency > "
                         + FormatSpec.MAX_TERMINAL_FREQUENCY
diff --git a/tests/src/com/android/inputmethod/latin/makedict/FusionDictionary.java b/tests/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
index 6ba1ef9..2bed44d 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/FusionDictionary.java
@@ -277,7 +277,7 @@
     }
 
     /**
-     * Sanity check for a PtNode array.
+     * Validity check for a PtNode array.
      *
      * This method checks that all PtNodes in a node array are ordered as expected.
      * If they are, nothing happens. If they aren't, an exception is thrown.
diff --git a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java
index 68f0415..bc9881b 100644
--- a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java
+++ b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTests.java
@@ -118,15 +118,15 @@
     private void doTestRandomWords(final String testAccount) {
         Log.d(TAG, "This test can be used for profiling.");
         Log.d(TAG, "Usage: please set UserHistoryDictionary.PROFILE_SAVE_RESTORE to true.");
-        final Locale dummyLocale = UserHistoryDictionaryTestsHelper.getDummyLocale("random_words");
+        final Locale fakeLocale = UserHistoryDictionaryTestsHelper.getFakeLocale("random_words");
         final String dictName = UserHistoryDictionary.getUserHistoryDictName(
-                UserHistoryDictionary.NAME, dummyLocale,
+                UserHistoryDictionary.NAME, fakeLocale,
                 null /* dictFile */,
                 testAccount /* account */);
         final File dictFile = ExpandableBinaryDictionary.getDictFile(
                 getContext(), dictName, null /* dictFile */);
         final UserHistoryDictionary dict = PersonalizationHelper.getUserHistoryDictionary(
-                getContext(), dummyLocale, testAccount);
+                getContext(), fakeLocale, testAccount);
         clearHistory(dict);
 
         final int numberOfWords = 1000;
@@ -169,15 +169,15 @@
 
             // Create filename suffixes for this test.
             for (int i = 0; i < numberOfLanguages; i++) {
-                final Locale dummyLocale =
-                        UserHistoryDictionaryTestsHelper.getDummyLocale("switching_languages" + i);
+                final Locale fakeLocale =
+                        UserHistoryDictionaryTestsHelper.getFakeLocale("switching_languages" + i);
                 final String dictName = UserHistoryDictionary.getUserHistoryDictName(
-                        UserHistoryDictionary.NAME, dummyLocale, null /* dictFile */,
+                        UserHistoryDictionary.NAME, fakeLocale, null /* dictFile */,
                         testAccount /* account */);
                 dictFiles[i] = ExpandableBinaryDictionary.getDictFile(
                         getContext(), dictName, null /* dictFile */);
                 dicts[i] = PersonalizationHelper.getUserHistoryDictionary(getContext(),
-                        dummyLocale, testAccount);
+                        fakeLocale, testAccount);
                 clearHistory(dicts[i]);
             }
 
@@ -214,19 +214,19 @@
     }
 
     private void doTestAddManyWords(final String testAccount) {
-        final Locale dummyLocale =
-                UserHistoryDictionaryTestsHelper.getDummyLocale("many_random_words");
+        final Locale fakeLocale =
+                UserHistoryDictionaryTestsHelper.getFakeLocale("many_random_words");
         final String dictName = UserHistoryDictionary.getUserHistoryDictName(
-                UserHistoryDictionary.NAME, dummyLocale, null /* dictFile */, testAccount);
+                UserHistoryDictionary.NAME, fakeLocale, null /* dictFile */, testAccount);
         final File dictFile = ExpandableBinaryDictionary.getDictFile(
                 getContext(), dictName, null /* dictFile */);
         final int numberOfWords = 10000;
         final Random random = new Random(123456);
         final UserHistoryDictionary dict = PersonalizationHelper.getUserHistoryDictionary(
-                getContext(), dummyLocale, testAccount);
+                getContext(), fakeLocale, testAccount);
         clearHistory(dict);
         assertTrue(UserHistoryDictionaryTestsHelper.addAndWriteRandomWords(dict,
                 numberOfWords, random, true /* checksContents */, mCurrentTime));
         assertDictionaryExists(dict, dictFile);
     }
-}
\ No newline at end of file
+}
diff --git a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTestsHelper.java b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTestsHelper.java
index 4b7b9bc..73d7e73 100644
--- a/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTestsHelper.java
+++ b/tests/src/com/android/inputmethod/latin/personalization/UserHistoryDictionaryTestsHelper.java
@@ -37,7 +37,7 @@
 public class UserHistoryDictionaryTestsHelper {
 
     /**
-     * Locale prefix for generating dummy locales for tests.
+     * Locale prefix for generating placeholder locales for tests.
      */
     public static final String TEST_LOCALE_PREFIX = "test-";
 
@@ -110,7 +110,7 @@
     /**
      * Creates unique test locale for using within tests.
      */
-    public static Locale getDummyLocale(final String name) {
+    public static Locale getFakeLocale(final String name) {
         return new Locale(TEST_LOCALE_PREFIX + name + System.currentTimeMillis());
     }
 
diff --git a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
index d516d60..8f8c968 100644
--- a/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
+++ b/tools/dicttool/src/com/android/inputmethod/latin/dicttool/Info.java
@@ -42,7 +42,7 @@
         int wordCount = 0;
         int bigramCount = 0;
         int shortcutCount = 0;
-        int whitelistCount = 0;
+        int allowlistCount = 0;
         for (final WordProperty wordProperty : dict) {
             ++wordCount;
             if (wordProperty.mHasNgrams) {
@@ -51,8 +51,8 @@
         }
         System.out.println("Words in the dictionary : " + wordCount);
         System.out.println("Bigram count : " + bigramCount);
-        System.out.println("Shortcuts : " + shortcutCount + " (out of which " + whitelistCount
-                + " whitelist entries)");
+        System.out.println("Shortcuts : " + shortcutCount + " (out of which " + allowlistCount
+                + " allowlist entries)");
     }
 
     private static void showWordInfo(final FusionDictionary dict, final String word) {
diff --git a/tools/make-keyboard-text/res/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.tmpl b/tools/make-keyboard-text/res/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.tmpl
index 6a7469c..5855129 100644
--- a/tools/make-keyboard-text/res/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.tmpl
+++ b/tools/make-keyboard-text/res/src/com/android/inputmethod/keyboard/internal/KeyboardTextsTable.tmpl
@@ -60,7 +60,7 @@
         if (text != null) {
             return text;
         }
-        // Sanity check.
+        // Validity check.
         if (index >= 0 && index < TEXTS_DEFAULT.length) {
             return TEXTS_DEFAULT[index];
         }