hex/android/play/policy
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel 9c5d65306f android: Clipboard history removes expired texts from the file at the hour, not when next opened
The independent run found expired texts still in
no_backup/clipboard-history.json an hour on: they were dropped only when
the store was next read (a copy, or the panel opening), while the policy
says each "is deleted an hour after you copy it".

- ClipboardRules.nextExpiry: when the next unpinned text expires, or null.
- ClipboardHistory.purge writes the file without expired texts and returns
  the next expiry; ClipboardHistory.changed tells the keyboard after every
  change.
- HexKeyboard: a main-looper timer for the earliest expiry while the
  process lives (none when nothing unpinned is kept), and a purge in
  onCreate and each onStartInputView. The timer doesn't count while the
  phone sleeps and never sees a clock moved on, so SCREEN_ON and TIME_SET
  purge too, registered only while a text waits to expire. Gated on the
  lab; no AlarmManager, no permission, nothing keeps the process alive.
- Policy: if Android has stopped Hex, the text goes the next time the
  keyboard starts, and on a sleeping phone when the screen comes on. The
  Privacy page sentence is unchanged.
- Clipboard page: a tile held near the bottom scrolls so Pin, Delete and
  Cancel are in view (they were below the visible area).

Verified: testDebugUnitTest 392 pass (2 new ClipboardHistoryTest cases);
on emulator-5870 (API 35), with no copy and the panel never opened, the
file lost a 59m45s-old text 30 s later by the timer, and every unpinned
text 8 s after the clock moved 61 min; with Hex force-stopped they stayed
until Hex's process started again, which purged before the keyboard
showed; pins kept throughout. Hold menu in view near the bottom.
2026-11-25 09:28:22 -05:00
..
privacy-policy.txt android: Clipboard history removes expired texts from the file at the hour, not when next opened 2026-11-25 09:28:22 -05:00