Don't depend directly on AppplicationInfo

ApplicationInfo is mutable and unfortunately some apps do actually
modify the flags. Due to the lazy loading nature of the network security
config this may lead to issues. Instead cache the needed flags and
resources at application startup.

Bug: 29063413

(cherry picked from commit 276ee969be89ba25e439839341953236adf80c40)

Change-Id: If638a716fd903b4e9dbabcbecb38bd4e26fef08c
3 files changed