Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions mbf-site/src/AndroidManifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,21 @@ export class AndroidManifest {

const permissionElement = this.document.createElement("uses-permission");
permissionElement.setAttributeNS(ANDROID_NS_URI, `${this.androidNsPrefix}:name`, perm);
if(perm == "android.permission.BLUETOOTH_SCAN") {
/*
For BLUETOOTH_SCAN permission, add flag "neverForLocation" for it.
If we don't add this flag, the quest device will likely returns empty scan result,
unless the game has ACCESS_FINE_LOCATION permission.

TODO:
If the game already has BLUETOOTH_SCAN permission without the flag "neverForLocation",
mbf will assume that the permission exists and thus turn on the Bluetooth toggle.
In this case the BLUETOOTH_SCAN doesn't work correctly, unless ACCESS_FINE_LOCATION
permission is grant.
We don't need to handle this situation at the moment because mbf doesn't cause this normally.
*/
permissionElement.setAttributeNS(ANDROID_NS_URI, `${this.androidNsPrefix}:usesPermissionFlags`, "65536")
}
this.manifestEl.appendChild(permissionElement);
this.permissions.push(perm);
}
Expand Down
2 changes: 1 addition & 1 deletion mbf-site/src/components/PermissionsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const displayedOptions: ManifestOptionInfo[] = [
},
{
name: "Bluetooth",
permissions: ["android.permission.BLUETOOTH", "android.permission.BLUETOOTH_CONNECT"],
permissions: ["android.permission.BLUETOOTH", "android.permission.BLUETOOTH_CONNECT", "android.permission.BLUETOOTH_SCAN"],
features: []
},
{
Expand Down