Skip to content

Commit

Permalink
remove unnecessary permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
jonesmac committed Nov 7, 2024
1 parent 43af178 commit 22f4843
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class XyoSystemInfoNetworkCellular(
) {
companion object {
fun detect(context: Context): XyoSystemInfoNetworkCellular? {
if (!hasPermission(context, Manifest.permission.CHANGE_NETWORK_STATE)) {
return null
}
if (Build.VERSION.SDK_INT >= 23) {
val connectivityManager =
context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class XyoSystemInfoNetworkWifi (
@RequiresApi(Build.VERSION_CODES.M)
@SuppressLint("HardwareIds")
fun detect(context: Context): XyoSystemInfoNetworkWifi? {
// Accessing Wifi network requires CHANGE_NETWORK_STATE permission
if (!hasPermission(context, Manifest.permission.CHANGE_NETWORK_STATE)) {
return null
}
Expand Down

0 comments on commit 22f4843

Please sign in to comment.