Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quest 2 potential permissioning isssue #11

Open
trzy opened this issue Nov 29, 2022 · 0 comments
Open

Quest 2 potential permissioning isssue #11

trzy opened this issue Nov 29, 2022 · 0 comments

Comments

@trzy
Copy link

trzy commented Nov 29, 2022

Hello,

I'm seeing that the plugin is definitely running on Meta Quest 2 but digging into logcat it appears that there is a location related permission error:

11-28 17:19:42.399 29859 29885 I UnityWifiDirect: initializing
11-28 17:19:42.399 29859 29885 I UnityWifiDirect: com.unity3d.player.UnityPlayerActivity
11-28 17:19:42.400 29859 29885 I UnityWifiDirect: Broadcast receiver registered
11-28 17:19:42.403 29859 29859 I wfd_    : Creating WifiDirectHandler
11-28 17:19:42.403 29859 29885 I UnityWifiDirect: bound: true
11-28 17:19:42.407 29859 29859 I wfd_    : Wi-Fi BroadcastReceiver registered
11-28 17:19:42.408  1050  4449 I WifiService: startScan uid=10125
11-28 17:19:42.408  1050  4449 E WifiService: Permission violation - startScan not allowed for uid=10125, packageName=io.github.saltyJeff.wifidirectest, reason=java.lang.SecurityException: UID 10125 has no location permission
11-28 17:19:42.408 29859 29859 I wfd_    : Wi-Fi enabled on load
11-28 17:19:42.408 29859 29859 I wfd_    : WifiDirectHandler created
11-28 17:19:42.409 29859 29859 I wfd_    : Wi-Fi state changed
11-28 17:19:42.409 29859 29859 I wfd_    : Wi-Fi enabled
11-28 17:19:42.414 29859 29859 I wfd_    : Registered with Wi-Fi P2P framework
11-28 17:19:42.414 29859 29859 I wfd_    : P2P BroadcastReceiver registered
11-28 17:19:42.415 29859 29859 I UnityWifiDirect: Binding WifiDirectHandler service
11-28 17:19:42.415 29859 29859 I UnityWifiDirect: ComponentName: ComponentInfo{io.github.saltyJeff.wifidirectest/edu.rit.se.wifibuddy.WifiDirectHandler}
11-28 17:19:42.415 29859 29859 I UnityWifiDirect: Service: edu.rit.se.wifibuddy.WifiDirectHandler$WifiTesterBinder@af552fa
11-28 17:19:42.415 29859 29859 I UnityWifiDirect: WifiDirectHandler service bound
11-28 17:19:42.415 29859 29859 I wfd_    : Wi-Fi P2P State Changed:
11-28 17:19:42.415 29859 29859 I wfd_    : - Wi-Fi Direct is enabled
11-28 17:19:42.425 29859 29885 I UnityWifiDirect: broadcasting service: hello
11-28 17:19:42.425 29859 29885 I wfd_    : Adding local service: hello
11-28 17:19:42.426 29859 29885 I wfd_    : Continuously Discover services called
11-28 17:19:42.426 29859 29885 I wfd_    : Setting up service discovery
11-28 17:19:42.426 29859 29885 I wfd_    : Service discovery listeners registered
11-28 17:19:42.426 29859 29885 I wfd_    : Submitting service discovery task
11-28 17:19:42.426 29859 29885 I UnityWifiDirect: discovering services
11-28 17:19:42.427 29859 29859 D WifiP2pManager: Ignored { when=0 what=139313 target=android.net.wifi.p2p.WifiP2pManager$Channel$P2pHandler }
11-28 17:19:42.427  1050  1169 E WifiPermissionsUtil: UID 10125 has no location permission
11-28 17:19:42.427 29859 29859 I wfd_    : Service discovery request added
11-28 17:19:42.427 29859 29885 I Unity   : *** onServiceConnected ***
11-28 17:19:42.427 29859 29859 E wfd_    : Failure adding local service: ERROR
11-28 17:19:42.427  1616  1616 D WifiP2pManager: Ignored { when=-1ms what=139313 target=android.net.wifi.p2p.WifiP2pManager$Channel$P2pHandler }
11-28 17:19:42.427 29859 29859 E wfd_    : Failure initiating service discovery: ERROR

I've tried modifying the manifest as follows (the commented-out line re: WiFi discovery is because adding that causes Unity to fail to build an APK for some reason):

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
  <application android:label="@string/app_name" android:icon="@mipmap/app_icon" android:allowBackup="false">
    <activity android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:configChanges="locale|fontScale|keyboard|keyboardHidden|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode" android:launchMode="singleTask" android:name="com.unity3d.player.UnityPlayerActivity" android:excludeFromRecents="true">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <meta-data android:name="unityplayer.SkipPermissionsDialog" android:value="false" />
    <meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only" />
  </application>
  <uses-feature android:name="android.hardware.vr.headtracking" android:version="1" android:required="true" />
  <!--
  <uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES" android:usesPermissionFlags="neverForLocation" />
  -->
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="32" />
</manifest>

Not sure what could be going wrong here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant