diff options
Diffstat (limited to 'platform/android/java/src')
| -rw-r--r-- | platform/android/java/src/org/godotengine/godot/Godot.java | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java index a9edc2f2f4..374d40463a 100644 --- a/platform/android/java/src/org/godotengine/godot/Godot.java +++ b/platform/android/java/src/org/godotengine/godot/Godot.java @@ -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; @@ -425,7 +426,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC  		}  		io = new GodotIO(this); -		io.unique_id = Secure.ANDROID_ID; +		io.unique_id = Secure.getString(getContentResolver(), Secure.ANDROID_ID);  		GodotLib.io = io;  		mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);  		mAccelerometer = mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER); @@ -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;  	} |