Commit b0afac6
Refactor connection state management (#6131)
* Introduce HttpUtl hasSameOrigin
* Add ability to watch for specific server change
* Move allowInsecureConnection to ServerConnectionInfo
* Remove logic from ServerConnectionInfo and cache URL parsing to HTTPUrl
* Introduce ServerConnectionStateProvider
* Replace GetUrl with proper calls from connection state provider
* Adjust webview to the new way of getting the URL
* Update ViewModels that set allowInsecureConnection
* Handle discard of ConnectionSecurityFragment
* Avoid blinking in BlockInsecureScreen
* Use viewModel in BlockInsecureFragment to properly retry
---------
Co-authored-by: Joris Pelgröm <[email protected]>1 parent aa68eec commit b0afac6
File tree
57 files changed
+4657
-952
lines changed- app
- src
- full/kotlin/io/homeassistant/companion/android/onboarding
- main/kotlin/io/homeassistant/companion/android
- controls
- launcher
- notifications
- onboarding
- locationforsecureconnection
- nameyourdevice
- serverdiscovery
- settings
- server
- url
- websocket
- webview
- externalbus
- insecure
- widgets
- camera
- mediaplayer
- test/kotlin/io/homeassistant/companion/android
- launcher
- onboarding
- locationforsecureconnection
- nameyourdevice
- serverdiscovery
- util
- webview
- insecure
- automotive
- common
- schemas/io.homeassistant.companion.android.database.AppDatabase
- src
- main/kotlin/io/homeassistant/companion/android
- common
- assist
- data
- authentication/impl
- integration
- impl
- network
- servers
- websocket/impl
- sensors
- util
- database
- server
- util
- test/kotlin/io/homeassistant/companion/android
- common
- data
- integration/impl
- network
- servers
- websocket/impl
- util
- database/server
- util
- wear/src/main/kotlin/io/homeassistant/companion/android/tiles
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
57 files changed
+4657
-952
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
| 132 | + | |
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
301 | 302 | | |
302 | 303 | | |
303 | 304 | | |
304 | | - | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
305 | 308 | | |
306 | 309 | | |
307 | 310 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
Lines changed: 65 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
101 | 103 | | |
102 | 104 | | |
103 | 105 | | |
| |||
1257 | 1259 | | |
1258 | 1260 | | |
1259 | 1261 | | |
1260 | | - | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1264 | 1271 | | |
1265 | 1272 | | |
1266 | 1273 | | |
| |||
1270 | 1277 | | |
1271 | 1278 | | |
1272 | 1279 | | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
1280 | | - | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | | - | |
1286 | | - | |
1287 | | - | |
1288 | | - | |
1289 | | - | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
| 1283 | + | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
1290 | 1300 | | |
1291 | | - | |
1292 | | - | |
1293 | | - | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
1294 | 1306 | | |
1295 | 1307 | | |
1296 | 1308 | | |
| |||
1363 | 1375 | | |
1364 | 1376 | | |
1365 | 1377 | | |
1366 | | - | |
1367 | | - | |
1368 | | - | |
1369 | | - | |
1370 | | - | |
1371 | | - | |
1372 | | - | |
1373 | | - | |
1374 | | - | |
1375 | | - | |
1376 | | - | |
1377 | | - | |
1378 | | - | |
1379 | | - | |
1380 | | - | |
1381 | | - | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
1382 | 1396 | | |
1383 | | - | |
1384 | | - | |
1385 | | - | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1386 | 1400 | | |
1387 | | - | |
1388 | | - | |
1389 | | - | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
1390 | 1404 | | |
1391 | | - | |
1392 | | - | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
1393 | 1408 | | |
1394 | 1409 | | |
| 1410 | + | |
| 1411 | + | |
1395 | 1412 | | |
1396 | 1413 | | |
1397 | 1414 | | |
| |||
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
| |||
Lines changed: 7 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | 97 | | |
99 | 98 | | |
100 | | - | |
101 | | - | |
| 99 | + | |
102 | 100 | | |
103 | 101 | | |
104 | 102 | | |
| |||
109 | 107 | | |
110 | 108 | | |
111 | 109 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
116 | 114 | | |
117 | 115 | | |
118 | 116 | | |
| |||
130 | 128 | | |
131 | 129 | | |
132 | 130 | | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 131 | + | |
155 | 132 | | |
156 | 133 | | |
157 | 134 | | |
158 | 135 | | |
159 | 136 | | |
| 137 | + | |
160 | 138 | | |
161 | 139 | | |
162 | 140 | | |
| |||
Lines changed: 9 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 99 | + | |
107 | 100 | | |
108 | 101 | | |
109 | 102 | | |
| |||
124 | 117 | | |
125 | 118 | | |
126 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
127 | 123 | | |
128 | 124 | | |
129 | 125 | | |
| |||
196 | 192 | | |
197 | 193 | | |
198 | 194 | | |
199 | | - | |
| 195 | + | |
200 | 196 | | |
201 | 197 | | |
202 | | - | |
| 198 | + | |
| 199 | + | |
203 | 200 | | |
204 | 201 | | |
205 | 202 | | |
| |||
0 commit comments