Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b839b6f8 authored by Sunny Shao's avatar Sunny Shao
Browse files

Fix the date format alignment problem

- The date format is different between "Android security update"
  and "Google Play system update" for locale TH.
- Use the same getBestDateTimePattern API to align the format.

Fixes: 331897617
Test: atest MainlineModuleVersionPreferenceControllerTest
Change-Id: I346749594b05703b601d0d84fd7659fd3c2fa85a
parent 00edf336
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -80,7 +80,6 @@ public class MainlineModuleVersionPreferenceController extends BasePreferenceCon
            try {
                mModuleVersion =
                        mPackageManager.getPackageInfo(moduleProvider, 0 /* flags */).versionName;
                return;
            } catch (PackageManager.NameNotFoundException e) {
                Log.e(TAG, "Failed to get mainline version.", e);
                mModuleVersion = null;
@@ -124,7 +123,8 @@ public class MainlineModuleVersionPreferenceController extends BasePreferenceCon
            return mModuleVersion;
        }

        return DateFormat.getLongDateFormat(mContext).format(parsedDate.get());
        String format = DateFormat.getBestDateTimePattern(Locale.getDefault(), "dMMMMyyyy");
        return DateFormat.format(format, parsedDate.get());
    }

    private Optional<Date> parseDateFromVersionName(String text) {