This repository was archived by the owner on Oct 15, 2024. It is now read-only.
Commit 23158ce
Fix two SMS Autofill crashes (#985)
SMS OTP Autofill currently crashes for two reasons:
1. Tasks.await has a precondition of not running on the UI thread.
2. Exceptions thrown from Tasks are always wrapped into
ExecutionExceptions and need to be unwrapped before they can be
identified as ResolvableApiException.
This commit addresses both issues by making waitForSms a proper
coroutine using withContext and a custom wrapper around Task<T> that
relies on suspendCoroutine and automatically unwraps exceptions.
(cherry picked from commit 3afeff4)1 parent c132cc9 commit 23158ce
File tree
2 files changed
+29
-5
lines changed- app/src/nonFree/java/com/zeapo/pwdstore/autofill/oreo/ui
2 files changed
+29
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
Lines changed: 28 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
34 | 51 | | |
35 | 52 | | |
36 | 53 | | |
| |||
105 | 122 | | |
106 | 123 | | |
107 | 124 | | |
108 | | - | |
| 125 | + | |
109 | 126 | | |
110 | 127 | | |
111 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
112 | 131 | | |
113 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
114 | 135 | | |
115 | 136 | | |
116 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
117 | 140 | | |
118 | 141 | | |
119 | 142 | | |
| |||
0 commit comments