Commit Graph

14 Commits

Author SHA1 Message Date
Daniel Norman
1a983ff386 fix(hct): Hardcode the names of Outline text and HCT in our notif.
This should help prevent localization issues caused by capitalization of
this templated string, since these feature names should not be
capitalized unless they are at the beginning of the sentence.

The 'Settings' app name should always be capitalized since it's the
proper name of an app, so that remains templated.

Bug: 399358129
Test: atest HighContrastTextMigrationReceiverTest;
      (this test asserts against a hardcoded version of the entire
       string)
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Change-Id: Iaaa2ac10a56c1e4f7e5a8fd0d1c8eaf8b0293a27
2025-03-06 20:44:21 +00:00
Treehugger Robot
b5299b17d9 Merge "fix(high contrast text): Uses a new string resource for the settings action." into main 2025-02-04 16:24:08 -08:00
Daniel Norman
f6b3ccd074 fix(high contrast text): Uses a new string resource for the settings action.
The old string has all non-English translations without format
placeholders, which will fail to build the string on those
languages until translations are added.

Bug: 384791485
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Change-Id: I4565610908d463c05576d5c5d0b083f76802cc9e
2025-02-04 15:26:24 -08:00
Riley Jones
a1e47ef860 Merge "Update strings again for refreshed High Contrast Text" into main 2025-02-04 15:17:23 -08:00
chenjean
2028e7b4b4 Increment TeX counters for the HCT migration about notification dismissed.
Bug: 391672253
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Test: Ensure dismissing a notification from open settings does not trigger multiple counter increments
Change-Id: I6ddccd40427cf2364d3fb5df4efaa0b16db26133
2025-02-04 07:55:54 +08:00
Daniel Norman
6d0a04a171 Update strings again for refreshed High Contrast Text
Deletes the old string resource and uses a new resource because the old
translated strings do not have formatting placeholders. Eventually the
old translated strings will be automatically deleted and the new string
with placeholder will be translated.

Also uses placeholders for referencing other strings so that
we guarantee that the strings are consistent across this notification
and the actual preference in Settings.

Bug: 384791485
Test: see bug screenshots
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Change-Id: I89a9ee4b3755b20f4e090df5b4cccb7ce47a961c
2025-02-03 20:00:09 +00:00
Daniel Norman
f362378c03 Merge "Increment TeX counters for the HCT migration notification." into main 2025-01-22 15:55:12 -08:00
Daniel Norman
5b2a769765 Increment TeX counters for the HCT migration notification.
See the corresponding TeX change for more details.

Bug: 369906140
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Test: run statsd_testdrive 644 and verify the output when the
      notification appears
Test: ensure that rotating / restarting the activity does not trigger
      multiple increments to the counter
Change-Id: Iea01962611e3e327cfbde6f3451f7f1ec54b955e
2025-01-22 19:17:31 +00:00
chenjean
ea305dc01e fix(HCT):Ensure HCT Notification ID does not conflict in the Settings app
The current HCT notification uses NOTIFICATION_ID=1. The Settings app has a few other notifications also use NOTIFICATION_ID=1 like Bluetooth and Sim etc. When using the same NOTIFICATION_ID for a notification, it updates the existing notification, causing the original one to disappear. To avoid this, we use a unique NOTIFICATION_ID.

Bug: 388530317
Flag: EXEMPT resource only update
Test: manual
Test: atest HighContrastTextMigrationReceiverTest
Change-Id: Ieda6836190726b14cd3522f61e7992e5a5698231
2025-01-15 18:15:38 +08:00
chenjean
ac876b1173 feat(HCT): Notification 'open settings' action behavoir
The notification should open High Contrast Text page and disappear automatically when the user taps the "Open Settings" button within the notification.

Bug: 385794406
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Test: atest SettingsRoboTests:com.android.settings.accessibility.HighContrastTextMigrationReceiverTest
Change-Id: Ibe3c343d39e3c98a8b98fb4252d5f5a37d1aaa49
2024-12-27 16:05:08 +08:00
Jean Chen
70f77e1c80 Merge "feat(HCT): Notification disappear behavoir" into main 2024-12-23 19:49:05 -08:00
chenjean
0d8356610e feat(HCT): Notification disappear behavoir
1. When a user taps the notification body, it should function like clicking the "Open Settings" action button, taking them directly to the Settings page and the notification should disappear automatically.
2. To ensure the notification remains visible until the user interacts with it, we need to add the FLAG_NO_CLEAR flag. This will prevent the notification from being dismissed when the user uses the "Clear all" button in the notification shade.

Bug: 385794406
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Test: manual
Change-Id: Ie2cd17e744363b9834021ddef48ec5a59f19ec64
2024-12-23 17:42:01 -08:00
Daniel Norman
d6e53163fd Strings updates for the new version of High contrast text.
These strings may be replaced again after our UX Writing team provides
new strings for the final public release.

Bug: 384791485
Test: observe new strings; see http://b/384791485#comment2
Flag: EXEMPT strings changes
Change-Id: I5359bc3d6faca84238fe00801a5d68e5ef8ffc2f
2024-12-18 18:35:45 -08:00
chenjean
fe361a526e feat(HCT): Perform custom migration logic for existing HCT users
This logic is triggered by two scenarios:
(A) During first bootup after OTA update to Android 16, if the
    user had HCT enabled.
  - Trigger: ACTION_PRE_BOOT_COMPLETED.
  - Migration: HCT is disabled and notification is shown.
(B) Restore backup from Android 15 (or earlier), if the backup
    had HCT enabled and new device does not.
  - Trigger: SettingsProvider's restore process.
  - Migration: HCT is not restored and notification is shown.

We store whether the user has seen this notification in a new secure
setting ACCESSIBILITY_HCT_SHOW_PROMPT. This setting is also backed up.

Bug: 369906140
Flag: com.android.graphics.hwui.flags.high_contrast_text_small_text_rect
Test: atest SettingsRoboTests:com.android.settings.accessibility.HighContrastTextMigrationReceiverTest
Test: flash an incremental update on a build with HCT enabled;
      observe HCT is disabled and a notification is sent.
Test: flash an incremental update on a build with HCT disabled;
      observe no change to HCT and no notification.

Change-Id: I4d294ffc0b2eabc59ee7988a579d678975a16380
2024-12-13 05:01:33 +00:00