You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Add camera permissions to android
(cherry picked from commit fab84c7dff)
This commit is contained in:
committed by
Hein-Pieter van Braam-Stewart
parent
9e2cf9ef0b
commit
edba82b940
@@ -103,6 +103,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
|||||||
|
|
||||||
static final int MAX_SINGLETONS = 64;
|
static final int MAX_SINGLETONS = 64;
|
||||||
static final int REQUEST_RECORD_AUDIO_PERMISSION = 1;
|
static final int REQUEST_RECORD_AUDIO_PERMISSION = 1;
|
||||||
|
static final int REQUEST_CAMERA_PERMISSION = 2;
|
||||||
private IStub mDownloaderClientStub;
|
private IStub mDownloaderClientStub;
|
||||||
private IDownloaderService mRemoteService;
|
private IDownloaderService mRemoteService;
|
||||||
private TextView mStatusText;
|
private TextView mStatusText;
|
||||||
@@ -957,6 +958,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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user