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
