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
This commit is contained in:
@@ -80,7 +80,6 @@ public class MainlineModuleVersionPreferenceController extends BasePreferenceCon
|
|||||||
try {
|
try {
|
||||||
mModuleVersion =
|
mModuleVersion =
|
||||||
mPackageManager.getPackageInfo(moduleProvider, 0 /* flags */).versionName;
|
mPackageManager.getPackageInfo(moduleProvider, 0 /* flags */).versionName;
|
||||||
return;
|
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
Log.e(TAG, "Failed to get mainline version.", e);
|
Log.e(TAG, "Failed to get mainline version.", e);
|
||||||
mModuleVersion = null;
|
mModuleVersion = null;
|
||||||
@@ -124,7 +123,8 @@ public class MainlineModuleVersionPreferenceController extends BasePreferenceCon
|
|||||||
return mModuleVersion;
|
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) {
|
private Optional<Date> parseDateFromVersionName(String text) {
|
||||||
|
Reference in New Issue
Block a user