Use mContext directly, and enforce via logging

We already have the context saved, so we can just use that.
Add a log statement so we can test for the existence of this patch from
a CTS test.

Test: Edited code to force expection path to be called, confirmed
      reboot happens
Bug: 138952436
Bug: 140111727

Change-Id: Iaceec82d4716837158d1233400b4a44cbf67a5e8
This commit is contained in:
Daniel Rosenberg
2019-08-26 19:29:45 -07:00
parent 89ebc7c1ad
commit 8c7f0100c7

View File

@@ -5255,6 +5255,9 @@ public class ActivityManagerService extends IActivityManager.Stub
// Inform checkpointing systems of success // Inform checkpointing systems of success
try { try {
// This line is needed to CTS test for the correct exception handling
// See b/138952436#comment36 for context
Slog.i(TAG, "About to commit checkpoint");
IStorageManager storageManager = PackageHelper.getStorageManager(); IStorageManager storageManager = PackageHelper.getStorageManager();
storageManager.commitChanges(); storageManager.commitChanges();
} catch (Exception e) { } catch (Exception e) {