Skip to content

Commit

Permalink
Remove other references to WifiConfig#getAuthType()
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharee committed Apr 21, 2024
1 parent 8938fb9 commit 0bc8704
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ fun WiFiCard(
) {
val cbm = LocalClipboardManager.current
val key = config.simpleKey ?: stringResource(id = R.string.no_password)
val securityParams = config.securityParamsObj
val insecure = securityParams?.type == ExportSecurityType.OPEN
val hasKey = config.simpleKey != null

Card(
modifier = modifier,
Expand All @@ -49,8 +52,6 @@ fun WiFiCard(
Row(
verticalAlignment = Alignment.CenterVertically,
) {
val insecure = config.authType == WifiConfiguration.KeyMgmt.NONE

Icon(
painter = painterResource(id = if (insecure) R.drawable.ic_unlocked else R.drawable.ic_locked),
contentDescription = null,
Expand Down Expand Up @@ -84,10 +85,10 @@ fun WiFiCard(
TwoLineText(
label = stringResource(id = R.string.password),
value = key,
secure = config.authType != WifiConfiguration.KeyMgmt.NONE,
secure = hasKey,
)

if (config.authType != WifiConfiguration.KeyMgmt.NONE) {
if (hasKey) {
IconButton(
onClick = {
cbm.setClip(ClipEntry(ClipData.newPlainText(config.SSID, key)))
Expand Down

0 comments on commit 0bc8704

Please sign in to comment.