mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
Add camera permissions to android
This commit is contained in:
parent
6697fd9a05
commit
fab84c7dff
@ -99,6 +99,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
||||
|
||||
static final int MAX_SINGLETONS = 64;
|
||||
static final int REQUEST_RECORD_AUDIO_PERMISSION = 1;
|
||||
static final int REQUEST_CAMERA_PERMISSION = 2;
|
||||
private IStub mDownloaderClientStub;
|
||||
private IDownloaderService mRemoteService;
|
||||
private TextView mStatusText;
|
||||
@ -956,6 +957,12 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
||||
}
|
||||
}
|
||||
|
||||
if (p_name.equals("CAMERA")) {
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) != PackageManager.PERMISSION_GRANTED) {
|
||||
requestPermissions(new String[] { Manifest.permission.CAMERA }, REQUEST_CAMERA_PERMISSION);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user