diff --git a/res/drawable/cloud_download_semibold_24px.xml b/res/drawable/cloud_download_semibold_24px.xml
deleted file mode 100644
index ef15f9f..0000000
--- a/res/drawable/cloud_download_semibold_24px.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<!-- From GM3 icon cloud_download:wght600_vd_theme_24 -->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-    android:width="24dp"
-    android:height="24dp"
-    android:viewportWidth="960"
-    android:viewportHeight="960"
-    android:tint="?attr/colorControlNormal">
-  <path
-      android:fillColor="@android:color/white"
-      android:pathData="M260,819.22Q162.22,819.22 92.35,751.7Q22.48,684.17 22.48,586.63Q22.48,503.03 70.61,437.64Q118.74,372.26 198.13,354.13Q217.39,283.26 284.26,217.98Q351.13,152.7 428.7,152.7Q467.91,152.7 496.22,179.3Q524.52,205.91 524.52,244L524.52,484.3L584,425.7L646.22,487.91L480,654.13L313.78,487.91L376,425.7L435.48,484.3L435.48,252.48Q365.13,269.87 326.8,327.11Q288.48,384.35 288.48,446.78L261.7,446.78Q206.51,446.78 167.49,485.8Q128.48,524.81 128.48,580Q128.48,635.74 167,674.48Q205.51,713.22 260,713.22L740,713.22Q778.04,713.22 804.78,686.48Q831.52,659.74 831.52,620Q831.52,581.39 804.78,554.09Q778.04,526.78 738.3,526.78L675.48,526.78L675.48,441.7Q675.48,396.52 656.3,358.98Q637.13,321.44 604.52,292.44L604.52,171.74Q680.78,206.74 726.33,275.8Q771.87,344.87 776.39,428.13L776.39,428.13L776.39,428.13Q847.09,442.35 892.31,496.96Q937.52,551.57 937.52,623.39Q937.52,704.99 879.91,762.1Q822.3,819.22 740,819.22L260,819.22ZM480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83L480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83L480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83L480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83L480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83L480,431.83L480,431.83Q480,431.83 480,431.83Q480,431.83 480,431.83Z"/>
-</vector>
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java
index 5134dbe..0cb2137 100644
--- a/src/com/android/launcher3/BubbleTextView.java
+++ b/src/com/android/launcher3/BubbleTextView.java
@@ -16,8 +16,6 @@
 
 package com.android.launcher3;
 
-import static android.graphics.fonts.FontStyle.FONT_WEIGHT_BOLD;
-import static android.graphics.fonts.FontStyle.FONT_WEIGHT_NORMAL;
 import static android.text.Layout.Alignment.ALIGN_NORMAL;
 
 import static com.android.launcher3.Flags.enableCursorHoverStates;
@@ -120,7 +118,6 @@
     private static final String EMPTY = "";
     private static final StringMatcherUtility.StringMatcher MATCHER =
             StringMatcherUtility.StringMatcher.getInstance();
-    private static final int BOLD_TEXT_ADJUSTMENT = FONT_WEIGHT_BOLD - FONT_WEIGHT_NORMAL;
 
     private static final int[] STATE_PRESSED = new int[]{android.R.attr.state_pressed};
 
@@ -507,7 +504,7 @@
             if (Flags.enableNewArchivingIcon()
                     && info instanceof ItemInfoWithIcon infoWithIcon
                     && infoWithIcon.isInactiveArchive()) {
-                setTextWithArchivingIcon(label);
+                setTextWithStartIcon(label, R.drawable.cloud_download_24px);
             } else {
                 setText(label);
             }
@@ -823,7 +820,7 @@
                 if (Flags.enableNewArchivingIcon()
                         && getTag() instanceof ItemInfoWithIcon infoWithIcon
                         && infoWithIcon.isInactiveArchive()) {
-                    setTextWithArchivingIcon(modifiedString);
+                    setTextWithStartIcon(modifiedString, R.drawable.cloud_download_24px);
                 } else {
                     setText(modifiedString);
                 }
@@ -848,28 +845,12 @@
     }
 
     /**
-     * Sets text with a start icon for App Archiving.
-     * Uses a bolded drawable if text is bolded.
-     * @param text
-     */
-    private void setTextWithArchivingIcon(CharSequence text) {
-        var drawableId = R.drawable.cloud_download_24px;
-        if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S
-                && getResources().getConfiguration().fontWeightAdjustment >= BOLD_TEXT_ADJUSTMENT) {
-            // If System bold text setting is on, then use a bolded icon
-            drawableId = R.drawable.cloud_download_semibold_24px;
-        }
-        setTextWithStartIcon(text, drawableId);
-    }
-
-    /**
      * Uses a SpannableString to set text with a Drawable at the start of the TextView
      * @param text text to use for TextView
-     * @param drawableId Drawable Resource to use for drawing image at start of text
+     * @param drawableRes Drawable Resource to use for drawing image at start of text
      */
-    @VisibleForTesting
-    public void setTextWithStartIcon(CharSequence text, @DrawableRes int drawableId) {
-        Drawable drawable = getContext().getDrawable(drawableId);
+    private void setTextWithStartIcon(CharSequence text, @DrawableRes int drawableRes) {
+        Drawable drawable = getContext().getDrawable(drawableRes);
         if (drawable == null) {
             setText(text);
             Log.w(TAG, "setTextWithStartIcon: start icon Drawable not found from resources"
diff --git a/tests/multivalentTests/src/com/android/launcher3/ui/BubbleTextViewTest.java b/tests/multivalentTests/src/com/android/launcher3/ui/BubbleTextViewTest.java
index a1f2d50..b83349e 100644
--- a/tests/multivalentTests/src/com/android/launcher3/ui/BubbleTextViewTest.java
+++ b/tests/multivalentTests/src/com/android/launcher3/ui/BubbleTextViewTest.java
@@ -16,41 +16,28 @@
 
 package com.android.launcher3.ui;
 
-import static android.graphics.fonts.FontStyle.FONT_WEIGHT_BOLD;
-import static android.graphics.fonts.FontStyle.FONT_WEIGHT_NORMAL;
-import static android.text.style.DynamicDrawableSpan.ALIGN_CENTER;
-
 import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
 
 import static com.android.launcher3.BubbleTextView.DISPLAY_ALL_APPS;
 import static com.android.launcher3.BubbleTextView.DISPLAY_PREDICTION_ROW;
 import static com.android.launcher3.BubbleTextView.DISPLAY_SEARCH_RESULT;
 import static com.android.launcher3.BubbleTextView.DISPLAY_SEARCH_RESULT_SMALL;
-import static com.android.launcher3.Flags.FLAG_ENABLE_NEW_ARCHIVING_ICON;
 import static com.android.launcher3.LauncherPrefs.ENABLE_TWOLINE_ALLAPPS_TOGGLE;
-import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_ARCHIVED;
 
 import static com.google.common.truth.Truth.assertThat;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
 
 import android.content.ComponentName;
 import android.content.Context;
 import android.content.Intent;
 import android.graphics.Typeface;
-import android.os.Build;
 import android.os.UserHandle;
-import android.platform.test.annotations.EnableFlags;
 import android.platform.test.flag.junit.SetFlagsRule;
-import android.text.SpannedString;
-import android.text.style.ImageSpan;
 import android.view.ViewGroup;
 
 import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.filters.SdkSuppress;
 import androidx.test.filters.SmallTest;
 
 import com.android.launcher3.BubbleTextView;
@@ -416,61 +403,6 @@
         assertThat(mBubbleTextView.getIcon().hasBadge()).isEqualTo(false);
     }
 
-    @EnableFlags(FLAG_ENABLE_NEW_ARCHIVING_ICON)
-    @Test
-    public void applyIconAndLabel_setsImageSpan_whenInactiveArchivedApp() {
-        // Given
-        BubbleTextView spyTextView = spy(mBubbleTextView);
-        mGmailAppInfo.runtimeStatusFlags |= FLAG_ARCHIVED;
-        BubbleTextView expectedTextView = new BubbleTextView(mContext);
-        int expectedDrawableId = mContext.getResources().getIdentifier(
-                "cloud_download_24px", /* name */
-                "drawable", /* defType */
-                mContext.getPackageName()
-        );
-        expectedTextView.setTextWithStartIcon(mGmailAppInfo.title, expectedDrawableId);
-        // When
-        spyTextView.applyIconAndLabel(mGmailAppInfo);
-        // Then
-        SpannedString expectedText = (SpannedString) expectedTextView.getText();
-        SpannedString actualText = (SpannedString) spyTextView.getText();
-        ImageSpan actualSpan = actualText.getSpans(
-                0, /* queryStart */
-                1, /* queryEnd */
-                ImageSpan.class
-        )[0];
-        ImageSpan expectedSpan = expectedText.getSpans(
-                0, /* queryStart */
-                1, /* queryEnd */
-                ImageSpan.class
-        )[0];
-        verify(spyTextView).setTextWithStartIcon(mGmailAppInfo.title, expectedDrawableId);
-        assertThat(actualText.toString()).isEqualTo(expectedText.toString());
-        assertThat(actualSpan.getDrawable().getBounds())
-                .isEqualTo(expectedSpan.getDrawable().getBounds());
-        assertThat(actualSpan.getVerticalAlignment()).isEqualTo(ALIGN_CENTER);
-    }
-
-    @EnableFlags(FLAG_ENABLE_NEW_ARCHIVING_ICON)
-    @SdkSuppress(minSdkVersion = Build.VERSION_CODES.S)
-    @Test
-    public void applyIconAndLabel_setsBoldDrawable_whenBoldedTextForArchivedApp() {
-        // Given
-        int expectedDrawableId = mContext.getResources().getIdentifier(
-                "cloud_download_semibold_24px", /* name */
-                "drawable", /* defType */
-                mContext.getPackageName()
-        );
-        mContext.getResources().getConfiguration().fontWeightAdjustment =
-                FONT_WEIGHT_BOLD - FONT_WEIGHT_NORMAL;
-        BubbleTextView spyTextView = spy(mBubbleTextView);
-        mGmailAppInfo.runtimeStatusFlags |= FLAG_ARCHIVED;
-        // When
-        spyTextView.applyIconAndLabel(mGmailAppInfo);
-        // Then
-        verify(spyTextView).setTextWithStartIcon(mGmailAppInfo.title, expectedDrawableId);
-    }
-
     @Test
     public void applyIconAndLabel_whenDisplay_DISPLAY_SEARCH_RESULT_hasBadge() {
         FlagOp op = FlagOp.NO_OP;
