1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-03 04:53:35 +00:00
lovr/etc/Activity.java
2022-03-30 12:34:34 -07:00

32 lines
908 B
Java

package org.lovr.app;
import android.Manifest;
import android.app.NativeActivity;
import android.content.pm.PackageManager;
public class Activity extends NativeActivity {
static {
System.loadLibrary("openxr_loader");
System.loadLibrary("lovr");
}
protected native void lovrPermissionEvent(int permission, boolean granted);
@Override
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
lovrPermissionEvent(0, true);
} else {
lovrPermissionEvent(0, false);
}
}
private void requestAudioCapturePermission() {
if (checkSelfPermission(Manifest.permission.RECORD_AUDIO) != PackageManager.PERMISSION_GRANTED) {
requestPermissions(new String[] { Manifest.permission.RECORD_AUDIO }, 1);
} else {
lovrPermissionEvent(0, true);
}
}
}