Get ApplicationInfo using usr id

Use ApplicationInfoAsUser() to get the application information by
user id to make sure we have correct permission, othewise we will
get the SecurityException due to lack of INTERACT_ACROSS_USERS.

Also add checking in StartProxyOp, we don't add it in client code.

Bug: 176313819
Test: atest CtsVoiceRecognitionTestCases
Test: manual.
      1.create profile user
      2.Install sample recognizer app
      3.Function works fine and no security exception occurred after
      apply the change
Change-Id: Iaf485537b8082d2109d2134ff987dc7244e31218
2 files changed