Replace abortActiveSession in StagingManager with revertActiveSessions am: 5f38f28e95
Change-Id: I131696c4570c324cc562df1df4cc3541261ccbc5
This commit is contained in:
committed by
Automerger Merge Worker
commit
b7041208f1
@@ -207,7 +207,7 @@ abstract class ApexManager {
|
||||
*
|
||||
* @return {@code true} upon success, {@code false} if any remote exception occurs
|
||||
*/
|
||||
abstract boolean abortActiveSession();
|
||||
abstract boolean revertActiveSessions();
|
||||
|
||||
/**
|
||||
* Abandons the staged session with the given sessionId.
|
||||
@@ -496,9 +496,9 @@ abstract class ApexManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean abortActiveSession() {
|
||||
boolean revertActiveSessions() {
|
||||
try {
|
||||
mApexService.abortActiveSession();
|
||||
mApexService.revertActiveSessions();
|
||||
return true;
|
||||
} catch (RemoteException re) {
|
||||
Slog.e(TAG, "Unable to contact apexservice", re);
|
||||
@@ -704,7 +704,7 @@ abstract class ApexManager {
|
||||
}
|
||||
|
||||
@Override
|
||||
boolean abortActiveSession() {
|
||||
boolean revertActiveSessions() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
|
||||
@@ -323,7 +323,7 @@ public class StagingManager {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mApexManager.abortActiveSession()) {
|
||||
if (!mApexManager.revertActiveSessions()) {
|
||||
Slog.e(TAG, "Failed to abort APEXd session");
|
||||
} else {
|
||||
Slog.e(TAG,
|
||||
|
||||
@@ -216,11 +216,11 @@ public class ApexManagerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAbortActiveSession_remoteException() throws RemoteException {
|
||||
doThrow(RemoteException.class).when(mApexService).abortActiveSession();
|
||||
public void testRevertActiveSessions_remoteException() throws RemoteException {
|
||||
doThrow(RemoteException.class).when(mApexService).revertActiveSessions();
|
||||
|
||||
try {
|
||||
assertThat(mApexManager.abortActiveSession()).isFalse();
|
||||
assertThat(mApexManager.revertActiveSessions()).isFalse();
|
||||
} catch (Exception e) {
|
||||
throw new AssertionError("ApexManager should not raise Exception");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user