File tree Expand file tree Collapse file tree 3 files changed +8
-9
lines changed
app/src/main/kotlin/io/homeassistant/companion/android/webview Expand file tree Collapse file tree 3 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -1391,7 +1391,7 @@ class WebViewActivity :
13911391 loadedUrl = url
13921392 clearHistory = ! keepHistory
13931393 lifecycleScope.launch {
1394- if (presenter.isSecurityLevelSet ()) {
1394+ if (! presenter.shouldSetSecurityLevel ()) {
13951395 webView.loadUrl(url)
13961396 waitForConnection()
13971397 } else {
Original file line number Diff line number Diff line change @@ -53,13 +53,12 @@ interface WebViewPresenter {
5353 suspend fun isSsidUsed (): Boolean
5454
5555 /* *
56- * Checks if the security level has been configured for the current server .
56+ * Checks whether the user needs to configure their insecure connection preference .
5757 *
58- * @return `true` if the server has no plain text URLs, or if the allowInsecureConnection
59- * flag has been explicitly set (to either true or false). Returns `false` if
60- * the server has plain text URLs and the user hasn't yet chosen a security level.
58+ * @return `true` if the server uses a plain text (HTTP) URL and the user has not yet set their
59+ * preference for allowing insecure connections, `false` otherwise
6160 */
62- suspend fun isSecurityLevelSet (): Boolean
61+ suspend fun shouldSetSecurityLevel (): Boolean
6362
6463 suspend fun getAuthorizationHeader (): String
6564
Original file line number Diff line number Diff line change @@ -355,11 +355,11 @@ class WebViewPresenterImpl @Inject constructor(
355355 override suspend fun isSsidUsed (): Boolean =
356356 serverManager.getServer(serverId)?.connection?.internalSsids?.isNotEmpty() == true
357357
358- override suspend fun isSecurityLevelSet (): Boolean {
358+ override suspend fun shouldSetSecurityLevel (): Boolean {
359359 if (serverManager.getServer(serverId)?.connection?.hasPlainTextUrl() == false ) {
360- return true
360+ return false
361361 }
362- return serverManager.integrationRepository(serverId).getAllowInsecureConnection() ! = null
362+ return serverManager.integrationRepository(serverId).getAllowInsecureConnection() = = null
363363 }
364364
365365 override suspend fun getAuthorizationHeader (): String {
You can’t perform that action at this time.
0 commit comments