Permission management only in AOSP mode (XP3)

Fixes #1855
Fixed repeated on demand restricting for functions with a whitelist