Fixed application info null pointer exception.

Test: manual.
      Set up work profile and open an app that's only installed
      there. This should change the user ID without triggering a
      system-wide global switch, in which case the application info
      would be null and cause the system service to crash.
      In the current implementation, this shouldn't happen, and in
      fact the foreground app should be properly inferred regardless
      of the user. This can be visible by enabled and checking the
      AutomaticBrightnessController logs with:

      adb shell cmd display ab-logging-enable
      adb logcat | grep AutomaticBrightnessController

Fixes: 122107873

Change-Id: I8161414a766c494ab0efadaa20fe6fcdf5067948
10 files changed