Request Android record permission when needed

This commit is contained in:
DESKTOP-3H3MR3A\eloisa 2019-03-04 23:06:37 -03:00 committed by Marcelo Fernandez
parent a38bf5287a
commit b22cf46fdb
12 changed files with 83 additions and 5 deletions

View file

@ -1093,6 +1093,11 @@ void _OS::alert(const String &p_alert, const String &p_title) {
OS::get_singleton()->alert(p_alert, p_title);
}
bool _OS::request_permission(const String &p_name) {
return OS::get_singleton()->request_permission(p_name);
}
_OS *_OS::singleton = NULL;
void _OS::_bind_methods() {
@ -1265,6 +1270,8 @@ void _OS::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_power_seconds_left"), &_OS::get_power_seconds_left);
ClassDB::bind_method(D_METHOD("get_power_percent_left"), &_OS::get_power_percent_left);
ClassDB::bind_method(D_METHOD("request_permission", "name"), &_OS::request_permission);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "clipboard"), "set_clipboard", "get_clipboard");
ADD_PROPERTY(PropertyInfo(Variant::INT, "current_screen"), "set_current_screen", "get_current_screen");
ADD_PROPERTY(PropertyInfo(Variant::INT, "exit_code"), "set_exit_code", "get_exit_code");

View file

@ -356,6 +356,8 @@ public:
bool has_feature(const String &p_feature) const;
bool request_permission(const String &p_name);
static _OS *get_singleton() { return singleton; }
_OS();

View file

@ -518,6 +518,8 @@ public:
bool is_restart_on_exit_set() const;
List<String> get_restart_on_exit_arguments() const;
virtual bool request_permission(const String &p_name) { return true; }
virtual void process_and_drop_events() {}
OS();
virtual ~OS();