Refactor ActivityActionSheet to permissions and optimize the permissions check to run only when needed

Edited by Martin Santangelo