Don't crash during app uninstall.

ApplicationsState was not handling the case where the storage query
fails and returns a null result. This meant that it NPE when this
happened.

Fixes: 37726237
Test: Manual (see b/34768986)

Change-Id: I3740ac7b1192e1ea3cdad85c61dd3dee2c2251cc
This commit is contained in:
Daniel Nishi
2017-04-27 12:10:52 -07:00
parent 039dcadc88
commit f59b830fdf

View File

@@ -1040,6 +1040,11 @@ public class ApplicationsState {
final IPackageStatsObserver.Stub mStatsObserver = new IPackageStatsObserver.Stub() {
public void onGetStatsCompleted(PackageStats stats, boolean succeeded) {
if (!succeeded) {
// There is no meaningful information in stats if the call failed.
return;
}
boolean sizeChanged = false;
synchronized (mEntriesMap) {
if (DEBUG_LOCKING) Log.v(TAG, "onGetStatsCompleted acquired lock");