OSDN Git Service

ResourcesManager: Return null on failure to create Resources
authorAdam Lesinski <adamlesinski@google.com>
Wed, 3 Aug 2016 20:36:39 +0000 (13:36 -0700)
committerAdam Lesinski <adamlesinski@google.com>
Wed, 3 Aug 2016 21:44:52 +0000 (14:44 -0700)
commit53fafdfbe76d3eeb0fe6782873a03869167a65b0
treed51e96ee5b3ba60e047fee259903438d4d81f153
parent76af60554ca5c74a8327774fdc4bf758f7eb518f
ResourcesManager: Return null on failure to create Resources

A lot of calling framework code expects a null value on failure,
and didn't catch the previous exception. There were some strange
corner cases where previously a null value was not checked for
in framework code, allowing the null Resources object to be
returned to the caller. Introducing an exception changed the
semantics and can crash certain apps.

Bug:30422475
Change-Id: I51d34ae43c9ec605a8790989c56cf85b815ff5b8
core/java/android/app/ApplicationPackageManager.java
core/java/android/app/ResourcesManager.java