Skip to content

Commit

Permalink
remove unused network types: bluetooth.
Browse files Browse the repository at this point in the history
ignore vpn when it's not paired with wifi/cellular or ethernet transport
  • Loading branch information
pazos committed Nov 13, 2024
1 parent 45a05ef commit 72f13d5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,6 @@ fun Activity.networkInfo(): String {
connectionType = ACTIVE_NETWORK_ETHERNET
true
}
it.hasTransport(NetworkCapabilities.TRANSPORT_BLUETOOTH) -> {
connectionType = ACTIVE_NETWORK_BLUETOOTH
true
}
it.hasTransport(NetworkCapabilities.TRANSPORT_VPN) -> {
connectionType = ACTIVE_NETWORK_VPN
true
}
else -> false
}
} ?: false
Expand All @@ -161,14 +153,6 @@ fun Activity.networkInfo(): String {
connectionType = ACTIVE_NETWORK_ETHERNET
true
}
ConnectivityManager.TYPE_BLUETOOTH -> {
connectionType = ACTIVE_NETWORK_BLUETOOTH
true
}
ConnectivityManager.TYPE_VPN -> {
connectionType = ACTIVE_NETWORK_VPN
true
}
else -> false
}
}
Expand Down Expand Up @@ -341,8 +325,6 @@ private const val ACTIVE_NETWORK_NONE = 0
private const val ACTIVE_NETWORK_WIFI = 1
private const val ACTIVE_NETWORK_MOBILE = 2
private const val ACTIVE_NETWORK_ETHERNET = 3
private const val ACTIVE_NETWORK_BLUETOOTH = 4
private const val ACTIVE_NETWORK_VPN = 5

// constants from https://developer.android.com/reference/android/content/res/Configuration
private const val ANDROID_LANDSCAPE = 0
Expand Down
2 changes: 0 additions & 2 deletions assets/android.lua
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,6 @@ enum {
ANETWORK_WIFI = 1,
ANETWORK_MOBILE = 2,
ANETWORK_ETHERNET = 3,
ANETWORK_BLUETOOTH = 4,
ANETWORK_VPN = 5,
};

enum {
Expand Down

0 comments on commit 72f13d5

Please sign in to comment.