Merge "Fix a potential NPE when allocating space for compressed apex"

This commit is contained in:
Treehugger Robot
2021-07-12 23:33:10 +00:00
committed by Gerrit Code Review

View File

@@ -968,6 +968,12 @@ public class RecoverySystemService extends IRecoverySystem.Stub implements Reboo
} }
try { try {
CompressedApexInfoList apexInfoList = getCompressedApexInfoList(packageFile); CompressedApexInfoList apexInfoList = getCompressedApexInfoList(packageFile);
if (apexInfoList == null) {
Log.i(TAG, "apex_info.pb not present in OTA package. "
+ "Assuming device doesn't support compressed"
+ "APEX, continueing without allocating space.");
return true;
}
ApexManager apexManager = ApexManager.getInstance(); ApexManager apexManager = ApexManager.getInstance();
apexManager.reserveSpaceForCompressedApex(apexInfoList); apexManager.reserveSpaceForCompressedApex(apexInfoList);
return true; return true;