Skip to content

Commit

Permalink
Run spotless Apply
Browse files Browse the repository at this point in the history
  • Loading branch information
Rkareko committed Aug 16, 2024
1 parent ae8aa97 commit 368823f
Showing 1 changed file with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,18 +190,22 @@ class WifiDirectDataSharingStrategy : DataSharingStrategy, P2PManagerListener {
private fun initiatePeerDiscoveryOnceAccessFineLocationGranted() {
if ((ActivityCompat.checkSelfPermission(
context,
android.Manifest.permission.ACCESS_FINE_LOCATION)
) != PackageManager.PERMISSION_GRANTED ||
(ActivityCompat.checkSelfPermission(
context,
android.Manifest.permission.NEARBY_WIFI_DEVICES)
) != PackageManager.PERMISSION_GRANTED
android.Manifest.permission.ACCESS_FINE_LOCATION
)) != PackageManager.PERMISSION_GRANTED ||
(ActivityCompat.checkSelfPermission(
context,
android.Manifest.permission.NEARBY_WIFI_DEVICES
)) != PackageManager.PERMISSION_GRANTED
) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
logDebug("initiatePeerDiscoveryOnceAccessFineLocationGranted(): requesting ACCESS_FINE_LOCATION")
logDebug(
"initiatePeerDiscoveryOnceAccessFineLocationGranted(): requesting ACCESS_FINE_LOCATION"
)
requestAccessFineLocationIfNotGranted()
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
logDebug("initiatePeerDiscoveryOnceAccessFineLocationGranted(): requesting NEARBY_WIFI_DEVICES")
logDebug(
"initiatePeerDiscoveryOnceAccessFineLocationGranted(): requesting NEARBY_WIFI_DEVICES"
)
requestNearbyWifiDevicesNotGranted()
} else {
handleMinimumSDKVersionNotMet(Build.VERSION_CODES.M)
Expand Down Expand Up @@ -232,9 +236,9 @@ class WifiDirectDataSharingStrategy : DataSharingStrategy, P2PManagerListener {
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
private fun requestNearbyWifiDevicesNotGranted() {
when (ActivityCompat.checkSelfPermission(
context,
android.Manifest.permission.NEARBY_WIFI_DEVICES
)
context,
android.Manifest.permission.NEARBY_WIFI_DEVICES
)
) {
PackageManager.PERMISSION_GRANTED -> logDebug("Wifi P2P: Nearby wifi devices granted")
else -> {
Expand Down

0 comments on commit 368823f

Please sign in to comment.