Snap for 9547664 from aef17b6184392621ffab36bee05cffd453a66939 to tm-qpr3-release

Change-Id: Ie34bb92b05267c9175090f78012901c5acc49be3
diff --git a/main/src/com/google/android/setupdesign/util/DeviceHelper.java b/main/src/com/google/android/setupdesign/util/DeviceHelper.java
index 37c5144..1a7e0bd 100644
--- a/main/src/com/google/android/setupdesign/util/DeviceHelper.java
+++ b/main/src/com/google/android/setupdesign/util/DeviceHelper.java
@@ -53,10 +53,25 @@
    * com.google.android.setupwizard.util.PartnerResource#DEVICE_NAME}) > {@link
    * android.provider.Settings.Global#DEVICE_NAME} > system property ro.product.model)
    */
+  public static CharSequence getDeviceName(@NonNull Context context) {
+    return getDeviceName(context, /* enableCache= */ true);
+  }
+
+  /**
+   * Get the device name text from these resources, if they are unavailable or setupwizard apk is
+   * older which does not contains {@link DeviceHelper#GET_DEVICE_NAME_METHOD} method, return the
+   * device name as default value "device".
+   *
+   * <p>Priority: partner config ({@link
+   * com.google.android.setupwizard.util.PartnerResource#DEVICE_NAME}) > {@link
+   * android.provider.Settings.Global#DEVICE_NAME} > system property ro.product.model)
+   *
+   * @param enableCache Indicates whether the device name is preferentially obtained from the cache.
+   */
   @NonNull
   @SuppressLint("DiscouragedApi")
-  public static CharSequence getDeviceName(@NonNull Context context) {
-    if (deviceName == null || deviceName.isEmpty()) {
+  public static CharSequence getDeviceName(@NonNull Context context, boolean enableCache) {
+    if (deviceName == null || deviceName.isEmpty() || !enableCache) {
       try {
         deviceName =
             context