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.

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: I6958dbf661373606fb9dba55e386aaea4399a146
Merged-In: Iaf485537b8082d2109d2134ff987dc7244e31218
(cherry picked from commit d96bcfcdf2f8e9dffaec3a7f12dcee8ea831a99d)
2 files changed