Address `OS.request_permissions()` bug when non-platform permission(s) is included
(cherry picked from commit ef62506e5c
)
This commit is contained in:
parent
d744f4a678
commit
918f5dee23
|
@ -36,6 +36,7 @@ import android.content.pm.PackageManager;
|
||||||
import android.content.pm.PermissionInfo;
|
import android.content.pm.PermissionInfo;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.support.v4.content.ContextCompat;
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.util.Log;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.godotengine.godot.Godot;
|
import org.godotengine.godot.Godot;
|
||||||
|
@ -46,6 +47,8 @@ import org.godotengine.godot.Godot;
|
||||||
*/
|
*/
|
||||||
public final class PermissionsUtil {
|
public final class PermissionsUtil {
|
||||||
|
|
||||||
|
private static final String TAG = PermissionsUtil.class.getSimpleName();
|
||||||
|
|
||||||
static final int REQUEST_RECORD_AUDIO_PERMISSION = 1;
|
static final int REQUEST_RECORD_AUDIO_PERMISSION = 1;
|
||||||
static final int REQUEST_CAMERA_PERMISSION = 2;
|
static final int REQUEST_CAMERA_PERMISSION = 2;
|
||||||
static final int REQUEST_VIBRATE_PERMISSION = 3;
|
static final int REQUEST_VIBRATE_PERMISSION = 3;
|
||||||
|
@ -113,8 +116,8 @@ public final class PermissionsUtil {
|
||||||
dangerousPermissions.add(manifestPermission);
|
dangerousPermissions.add(manifestPermission);
|
||||||
}
|
}
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
e.printStackTrace();
|
// Skip this permission and continue.
|
||||||
return false;
|
Log.w(TAG, "Unable to identify permission " + manifestPermission, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -153,8 +156,8 @@ public final class PermissionsUtil {
|
||||||
dangerousPermissions.add(manifestPermission);
|
dangerousPermissions.add(manifestPermission);
|
||||||
}
|
}
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
e.printStackTrace();
|
// Skip this permission and continue.
|
||||||
return new String[0];
|
Log.w(TAG, "Unable to identify permission " + manifestPermission, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue