Forum Discussion
lucas.180963
3 years agoExplorer
Requesting permissions not working in Quest OS 59
Since we updated one of our Quest 2 devices to operating system version 59 our android code for requesting permissions no longer works.
private void checkPermissionsAndInitialize() {
// check permissions
List<String> PERMISSIONS = buildPermissionList();
if (mainActivity.hasPermissions(PERMISSIONS.toArray(new String[0]))) {
intialize();
} else {
ActivityCompat.requestPermissions(mainActivity, PERMISSIONS.toArray(new String[0]), PERMISSIONS_REQUEST_CODE);
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
intialize();
}
private void intialize() {
Log.d(LOG_TAG, "Build version: " + Build.VERSION.SDK_INT);
}
This snippet should be straightforward but for some reason the if statement always evaluates to false and onRequestPermissionsResult is never called, so the log is never printed. (The 'hasPermissions' method just uses ActivityCompat.checkSelfPermission on an array.)
Also, using 'adb install -g' to grant all runtime permissions doesn't work either!
Has anyone had a problem like this before?
Lucas
Headset just updated to 59.0.0.138, bug is fixed! 😄
3 Replies
Replies have been turned off for this discussion
- lucas.180963Explorer
I have found that this is in some way related to replacing an installed app with a 'newer version' of that app.
When I first remove my application and then install it again (via SideQuest), the permission code works as expected.
But if I install my application via sidequest when that same application is still installed, the code fails! And this even with the exact same apk I used for the first install!
- lucas.180963Explorer
The above reply was sort of a false positive. The installation has nothing to do with it. When I open our app for the first time the log is printed, but when I open it a second time it is not.
Meaning that the bug is not caused by installing another version but simply happens if you open the app again.
- lucas.180963Explorer
Headset just updated to 59.0.0.138, bug is fixed! 😄
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 8 months ago
- 2 years ago
- 3 months ago