Fixes a performance bottleneck in `ConversationFragment` caused by expensive calculations in `ConversationItemDecorations.hasHeader()`. This method is invoked in `RecyclerView.ItemDecoration.getItemOffsets()`, which runs on every layout pass and happens frequently during scrolling.
The most expensive calculation in `hasHeader()` is `toEpochDay()`. That method calls `Long.toLocalDate()`, which clones a `TimeZone` object on each call. Upon opening one conversation (without scrolling), I observed that `toEpochDay()` was called over 1000 times in less than a second, rapidly allocating memory and causing garbage collection pressure that potentially leads to ANRs.
We only need to calculate `hasHeader()` once for each conversation element, so caching the result of that method will eliminate the unnecessary calculations and improve the memory usage of `ConversationFragment`.
On Android versions older than 14, users were not prompted to save their PIN to their device password manager due to an autofill session conflict.
The `CreateSvrPinFragment.input` field triggered an autofill session, so when `ConfirmSvrPinFragment` later attempted to save the PIN using `CredentialManager`, the system incorrectly assumed the credential had already been saved by autofill and skipped the save prompt.
Fixes an issue, where the written text would be lost if a user toggled view
once in the `AddMessageDialogFragment`. This is unexpected, as when toggling
view once from the `MediaReviewFragment` the previously written text is
preserved.
Hold a reference to the Glide RequestManager instead of creating a new instance when attempting to clear pending loads and free resources for the target.
Fixes an issue where the system auto-fill could overwrite the Signal backup key saved to the device password manager with the Signal PIN. The PIN confirmation screen now explicitly uses `CredentialManager` to save the `Signal PIN` under a separate username from the `Signal Backups` key, allowing both credentials to be stored and auto-filled correctly.
- Add `com.google.android.libraries.identity.googleid` dependency so `CredentialManager` works on Android < 14.
- Prompt to save Signal PIN to credential manager after PIN is created/edited.
To prevent crashes when the "go to settings" button is clicked in the backup key save to password manager error dialog, the "go to settings" button will only be displayed in cases where the intent resolves successfully.