From c233ecca5c31f9ed18c3ff92bbae4b54c7622cb0 Mon Sep 17 00:00:00 2001 From: Lifu Tang Date: Wed, 29 May 2024 20:52:18 +0000 Subject: [PATCH] Change the relative time format to `LONG` The `SHORT` format, which abbreviates relative time as 'x min. ago,' presents an accessibility issue for screen readers like TalkBack. TalkBack announces this as 'x minimum. Ago', and the dot after "min" is treated as period and causes a full-stop. Attempts to directly modify TalkBack's pronunciation of this text have proven difficult. Given the ample space available in the user interface, using abbreviations isn't necessary. Switching to the `LONG` format ('x minutes ago') would resolve this accessibility problem while also making the interface clearer for all users. Bug: 318323722 Change-Id: I42ba960bd8d5d8fc8a9cb895ecf24c56dab6d2c4 --- .../android/settings/applications/AppsPreferenceController.java | 2 +- .../location/RecentLocationAccessPreferenceController.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/applications/AppsPreferenceController.java b/src/com/android/settings/applications/AppsPreferenceController.java index 963376662b7..02ddc1d2436 100644 --- a/src/com/android/settings/applications/AppsPreferenceController.java +++ b/src/com/android/settings/applications/AppsPreferenceController.java @@ -206,7 +206,7 @@ public class AppsPreferenceController extends BasePreferenceController implement pref.setIcon(Utils.getBadgedIcon(mContext, appEntry.info)); pref.setSummary(StringUtil.formatRelativeTime(mContext, System.currentTimeMillis() - stats.getLastTimeUsed(), false, - RelativeDateTimeFormatter.Style.SHORT)); + RelativeDateTimeFormatter.Style.LONG)); pref.setOrder(showAppsCount++); pref.setOnPreferenceClickListener(preference -> { startAppInfoSettings(pkgName, appEntry.info.uid, diff --git a/src/com/android/settings/location/RecentLocationAccessPreferenceController.java b/src/com/android/settings/location/RecentLocationAccessPreferenceController.java index a5c0e55a74d..3cb30251c51 100644 --- a/src/com/android/settings/location/RecentLocationAccessPreferenceController.java +++ b/src/com/android/settings/location/RecentLocationAccessPreferenceController.java @@ -172,7 +172,7 @@ public class RecentLocationAccessPreferenceController extends LocationBasePrefer pref.setTitle(access.label); pref.setSummary(StringUtil.formatRelativeTime(prefContext, System.currentTimeMillis() - access.accessFinishTime, false, - RelativeDateTimeFormatter.Style.SHORT)); + RelativeDateTimeFormatter.Style.LONG)); pref.setOnPreferenceClickListener(new PackageEntryClickedListener( fragment.getContext(), access.packageName, access.userHandle)); return pref;