Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal val availableGHZ5: Available = { MainContext.INSTANCE.wiFiManagerWrappe
internal val availableGHZ6: Available = { MainContext.INSTANCE.wiFiManagerWrapper.is6GHzBandSupported() }

enum class WiFiBand(
@StringRes val textResource: Int,
@param:StringRes val textResource: Int,
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@param:StringRes applies the annotation only to the constructor parameter; since this is a val constructor property, the generated textResource property/getter will no longer be annotated as a @StringRes. If this value is read elsewhere (e.g., passed into getString(...)), you likely want the annotation on the property as well (use @get:StringRes or @field:StringRes, or add both use-site targets explicitly).

Suggested change
@param:StringRes val textResource: Int,
@get:StringRes val textResource: Int,

Copilot uses AI. Check for mistakes.
val wiFiChannels: WiFiChannels,
val available: Available,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import androidx.annotation.DrawableRes
import com.vrem.wifianalyzer.R

enum class Strength(
@DrawableRes val imageResource: Int,
@ColorRes val colorResource: Int,
@param:DrawableRes val imageResource: Int,
@param:ColorRes val colorResource: Int,
Comment on lines +25 to +26
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@param:DrawableRes / @param:ColorRes apply only to the enum constructor parameters. Since these are val constructor properties that are read later (e.g., strength.imageResource, strength.colorResource), this drops the resource annotations from the properties themselves and may reduce lint/resource-type checking at call sites. Consider targeting the property (@get:/@field:) or explicitly applying both targets.

Suggested change
@param:DrawableRes val imageResource: Int,
@param:ColorRes val colorResource: Int,
@param:DrawableRes @get:DrawableRes val imageResource: Int,
@param:ColorRes @get:ColorRes val colorResource: Int,

Copilot uses AI. Check for mistakes.
) {
ZERO(R.drawable.ic_signal_wifi_0_bar, R.color.error),
ONE(R.drawable.ic_signal_wifi_1_bar, R.color.warning),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ private val extras = listOf("SAE", "EAP_SUITE_B_192", "OWE")
private val regex = Regex("[^A-Z0-9_]")

enum class Security(
@DrawableRes val imageResource: Int,
@param:DrawableRes val imageResource: Int,
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@param:DrawableRes will annotate only the constructor parameter; since imageResource is a val constructor property that’s read elsewhere, the property itself will no longer be annotated as @DrawableRes. If you rely on resource-type checking when using security.imageResource, consider using @get:/@field: (or both targets) instead of parameter-only.

Copilot uses AI. Check for mistakes.
val extras: List<String> = listOf(),
) {
NONE(R.drawable.ic_lock_open),
Expand All @@ -47,7 +47,7 @@ typealias SecurityTypeId = Int

enum class WiFiSecurityType(
val securityTypeId: SecurityTypeId,
@StringRes val textResource: Int,
@param:StringRes val textResource: Int,
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same concern here: @param:StringRes on a val constructor property annotates only the enum constructor parameter, not the textResource property that callers read later. If you want to keep WiFiSecurityType.textResource typed as @StringRes for lint/static checking, target the property (@get:/@field:) or apply both targets explicitly.

Suggested change
@param:StringRes val textResource: Int,
@param:StringRes @get:StringRes val textResource: Int,

Copilot uses AI. Check for mistakes.
val security: Security = Security.NONE,
) {
UNKNOWN(-1, R.string.security_type_unknown),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ typealias WiFiStandardId = Int

enum class WiFiStandard(
val wiFiStandardId: WiFiStandardId,
@StringRes val fullResource: Int,
@StringRes val valueResource: Int,
@param:StringRes val fullResource: Int,
@param:StringRes val valueResource: Int,
Comment on lines +31 to +32
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@param:StringRes targets only the constructor parameter. Because fullResource/valueResource are val constructor properties that are accessed elsewhere, this change drops the @StringRes annotation from the property/getter/field, which may reduce lint/resource-type checking at call sites. Consider @get:/@field: (or duplicating targets) so the enum properties remain annotated.

Suggested change
@param:StringRes val fullResource: Int,
@param:StringRes val valueResource: Int,
@get:StringRes val fullResource: Int,
@get:StringRes val valueResource: Int,

Copilot uses AI. Check for mistakes.
) {
UNKNOWN(0, R.string.wifi_standard_unknown, R.string.wifi_standard_unknown),
LEGACY(1, R.string.wifi_standard_legacy, R.string.wifi_standard_unknown),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal val calculateCenterUsingCenter0: CalculateCenter = { _, center0, _ -> c
internal val calculateCenterUsingCenter1: CalculateCenter = { _, _, center1 -> center1 }

enum class WiFiWidth(
@StringRes val textResource: Int,
@param:StringRes val textResource: Int,
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using @param:StringRes on a val constructor property means only the constructor parameter is annotated; the textResource property itself won’t carry @StringRes anymore. If callers read wiFiWidth.textResource and pass it to APIs expecting a @StringRes, consider targeting the property (@get:/@field:) or applying both targets explicitly to preserve resource-type safety while silencing KT-73255.

Suggested change
@param:StringRes val textResource: Int,
@param:StringRes @get:StringRes val textResource: Int,

Copilot uses AI. Check for mistakes.
val channelWidth: Int,
val frequencyWidth: Int,
val guardBand: Int,
Expand Down
Loading