From 22f4843550ec52b8baf408a3582f13073f9f150f Mon Sep 17 00:00:00 2001 From: Matt Jones <885417+jonesmac@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:49:20 -0500 Subject: [PATCH] remove unnecessary permission check --- .../client/witness/system/info/XyoSystemInfoNetworkCellular.kt | 3 --- .../xyo/client/witness/system/info/XyoSystemInfoNetworkWifi.kt | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sdk/src/main/java/network/xyo/client/witness/system/info/XyoSystemInfoNetworkCellular.kt b/sdk/src/main/java/network/xyo/client/witness/system/info/XyoSystemInfoNetworkCellular.kt index c46e057..42023cd 100644 --- a/sdk/src/main/java/network/xyo/client/witness/system/info/XyoSystemInfoNetworkCellular.kt +++ b/sdk/src/main/java/network/xyo/client/witness/system/info/XyoSystemInfoNetworkCellular.kt @@ -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 diff --git a/sdk/src/main/java/network/xyo/client/witness/system/info/XyoSystemInfoNetworkWifi.kt b/sdk/src/main/java/network/xyo/client/witness/system/info/XyoSystemInfoNetworkWifi.kt index ff2e595..dede49b 100644 --- a/sdk/src/main/java/network/xyo/client/witness/system/info/XyoSystemInfoNetworkWifi.kt +++ b/sdk/src/main/java/network/xyo/client/witness/system/info/XyoSystemInfoNetworkWifi.kt @@ -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 }