Loading services/core/java/com/android/server/pm/ApexManager.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.Nullable; import android.apex.ApexInfo; import android.apex.ApexInfo; import android.apex.ApexInfoList; import android.apex.ApexInfoList; import android.apex.ApexSessionInfo; import android.apex.ApexSessionInfo; import android.apex.ApexSessionParams; import android.apex.IApexService; import android.apex.IApexService; import android.content.BroadcastReceiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Context; Loading Loading @@ -439,7 +440,10 @@ abstract class ApexManager { throws PackageManagerException { throws PackageManagerException { try { try { final ApexInfoList apexInfoList = new ApexInfoList(); final ApexInfoList apexInfoList = new ApexInfoList(); mApexService.submitStagedSession(sessionId, childSessionIds, apexInfoList); ApexSessionParams params = new ApexSessionParams(); params.sessionId = sessionId; params.childSessionIds = childSessionIds; mApexService.submitStagedSession(params, apexInfoList); return apexInfoList; return apexInfoList; } catch (RemoteException re) { } catch (RemoteException re) { Slog.e(TAG, "Unable to contact apexservice", re); Slog.e(TAG, "Unable to contact apexservice", re); Loading services/tests/servicestests/src/com/android/server/pm/ApexManagerTest.java +2 −3 Original line number Original line Diff line number Diff line Loading @@ -183,7 +183,7 @@ public class ApexManagerTest { public void testSubmitStagedSession_throwPackageManagerException() throws RemoteException { public void testSubmitStagedSession_throwPackageManagerException() throws RemoteException { doAnswer(invocation -> { doAnswer(invocation -> { throw new Exception(); throw new Exception(); }).when(mApexService).submitStagedSession(anyInt(), any(), any()); }).when(mApexService).submitStagedSession(any(), any()); assertThrows(PackageManagerException.class, assertThrows(PackageManagerException.class, () -> mApexManager.submitStagedSession(TEST_SESSION_ID, TEST_CHILD_SESSION_ID)); () -> mApexManager.submitStagedSession(TEST_SESSION_ID, TEST_CHILD_SESSION_ID)); Loading @@ -191,8 +191,7 @@ public class ApexManagerTest { @Test @Test public void testSubmitStagedSession_throwRunTimeException() throws RemoteException { public void testSubmitStagedSession_throwRunTimeException() throws RemoteException { doThrow(RemoteException.class).when(mApexService).submitStagedSession(anyInt(), any(), doThrow(RemoteException.class).when(mApexService).submitStagedSession(any(), any()); any()); assertThrows(RuntimeException.class, assertThrows(RuntimeException.class, () -> mApexManager.submitStagedSession(TEST_SESSION_ID, TEST_CHILD_SESSION_ID)); () -> mApexManager.submitStagedSession(TEST_SESSION_ID, TEST_CHILD_SESSION_ID)); Loading Loading
services/core/java/com/android/server/pm/ApexManager.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.Nullable; import android.apex.ApexInfo; import android.apex.ApexInfo; import android.apex.ApexInfoList; import android.apex.ApexInfoList; import android.apex.ApexSessionInfo; import android.apex.ApexSessionInfo; import android.apex.ApexSessionParams; import android.apex.IApexService; import android.apex.IApexService; import android.content.BroadcastReceiver; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Context; Loading Loading @@ -439,7 +440,10 @@ abstract class ApexManager { throws PackageManagerException { throws PackageManagerException { try { try { final ApexInfoList apexInfoList = new ApexInfoList(); final ApexInfoList apexInfoList = new ApexInfoList(); mApexService.submitStagedSession(sessionId, childSessionIds, apexInfoList); ApexSessionParams params = new ApexSessionParams(); params.sessionId = sessionId; params.childSessionIds = childSessionIds; mApexService.submitStagedSession(params, apexInfoList); return apexInfoList; return apexInfoList; } catch (RemoteException re) { } catch (RemoteException re) { Slog.e(TAG, "Unable to contact apexservice", re); Slog.e(TAG, "Unable to contact apexservice", re); Loading
services/tests/servicestests/src/com/android/server/pm/ApexManagerTest.java +2 −3 Original line number Original line Diff line number Diff line Loading @@ -183,7 +183,7 @@ public class ApexManagerTest { public void testSubmitStagedSession_throwPackageManagerException() throws RemoteException { public void testSubmitStagedSession_throwPackageManagerException() throws RemoteException { doAnswer(invocation -> { doAnswer(invocation -> { throw new Exception(); throw new Exception(); }).when(mApexService).submitStagedSession(anyInt(), any(), any()); }).when(mApexService).submitStagedSession(any(), any()); assertThrows(PackageManagerException.class, assertThrows(PackageManagerException.class, () -> mApexManager.submitStagedSession(TEST_SESSION_ID, TEST_CHILD_SESSION_ID)); () -> mApexManager.submitStagedSession(TEST_SESSION_ID, TEST_CHILD_SESSION_ID)); Loading @@ -191,8 +191,7 @@ public class ApexManagerTest { @Test @Test public void testSubmitStagedSession_throwRunTimeException() throws RemoteException { public void testSubmitStagedSession_throwRunTimeException() throws RemoteException { doThrow(RemoteException.class).when(mApexService).submitStagedSession(anyInt(), any(), doThrow(RemoteException.class).when(mApexService).submitStagedSession(any(), any()); any()); assertThrows(RuntimeException.class, assertThrows(RuntimeException.class, () -> mApexManager.submitStagedSession(TEST_SESSION_ID, TEST_CHILD_SESSION_ID)); () -> mApexManager.submitStagedSession(TEST_SESSION_ID, TEST_CHILD_SESSION_ID)); Loading