Add null check for retrieved package.

PackageManagerInternal.getPackage() states that the returned value can
be null. Check that the returned object isn't null before calling any of
its methods to avoid NullPointerExceptions.

Bug: 154899364
Test: atest FrameworksServicesTests:AppStandbyControllerTests
Change-Id: Ifcb200a4a0ed6582cc1a368c2949f0aaf32d7dd2
1 file changed