From 06650e7326efe5c67d989f3d2bc49cbd86c79324 Mon Sep 17 00:00:00 2001 From: JW Wang Date: Fri, 7 Feb 2020 16:03:35 +0800 Subject: [PATCH] Use #getRollbackForSessionLocked to search for the rollback (3/n) Each session is allocated with a unique id. No matter it is a parent session or a child one, a staged session or a non-staged one. For a given session id, we can correctly locate the matching rollback without checking #isNewRollback. In the end, we will be able to remove #getNewRollbackForPackageSessionLocked when the refactoring is done. Bug: 149069841 Test: atest RollbackTest Change-Id: Id7166def31d53ab33dc5212b038a135076c6cb8c --- .../android/server/rollback/RollbackManagerServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java b/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java index 1421258c12f64..e2cf9ad0a2ffe 100644 --- a/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java +++ b/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java @@ -788,10 +788,10 @@ class RollbackManagerServiceImpl extends IRollbackManager.Stub { Rollback newRollback; synchronized (mLock) { - // See if we already have a NewRollback that contains this package - // session. If not, create a NewRollback for the parent session + // See if we already have a Rollback that contains this package + // session. If not, create a new Rollback for the parent session // that we will use for all the packages in the session. - newRollback = getNewRollbackForPackageSessionLocked(packageSession.getSessionId()); + newRollback = getRollbackForSessionLocked(packageSession.getSessionId()); if (newRollback == null) { newRollback = createNewRollbackLocked(parentSession); mRollbacks.add(newRollback);