Unify date truncation logic in PermissionChange code

Tests were intermittently failing because we were using Instant to
truncate the date which always assumes GMT time. Meanwhile, the date
instances we made would be in the default timezone.

Everything works fine when the devices stay in GMT but if they ever
changed, there would be a discrepancy causing the truncation to truncate
to GMT day borders which would not match the expected default timezone
borders.

We fix this by doing the same thing we do in the serialize logic,
truncating via the formatter itself, ensuring that we truncate at day
granularity for the test's expected timezone.

Bug: 235636205
Test: Change DuT timezone. atest PermissionChangeStorageImplTest
Change-Id: I5a445715a94b10b88b285970cda654a94edfca30
1 file changed