Loading services/core/java/com/android/server/pm/PackageInstallerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -204,7 +204,8 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements mSessionsDir.mkdirs(); mApexManager = am; mStagingManager = new StagingManager(pm, this, am); mStagingManager = new StagingManager(pm, this, am, context); } boolean okToSendBroadcasts() { Loading services/core/java/com/android/server/pm/StagingManager.java +19 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.ParcelFileDescriptor; import android.os.PowerManager; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Slog; Loading Loading @@ -68,15 +69,18 @@ public class StagingManager { private final PackageInstallerService mPi; private final PackageManagerService mPm; private final ApexManager mApexManager; private final PowerManager mPowerManager; private final Handler mBgHandler; @GuardedBy("mStagedSessions") private final SparseArray<PackageInstallerSession> mStagedSessions = new SparseArray<>(); StagingManager(PackageManagerService pm, PackageInstallerService pi, ApexManager am) { StagingManager(PackageManagerService pm, PackageInstallerService pi, ApexManager am, Context context) { mPm = pm; mPi = pi; mApexManager = am; mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); mBgHandler = BackgroundThread.getHandler(); } Loading Loading @@ -286,6 +290,20 @@ public class StagingManager { session.setStagedSessionFailed(SessionInfo.STAGED_SESSION_ACTIVATION_FAILED, "Staged installation of APKs failed. Check logcat messages for" + "more information."); if (!hasApex) { return; } if (!mApexManager.abortActiveSession()) { Slog.e(TAG, "Failed to abort APEXd session"); } else { Slog.e(TAG, "Successfully aborted apexd session. Rebooting device in order to revert " + "to the previous state of APEXd."); mPowerManager.reboot(null); } return; } Loading Loading
services/core/java/com/android/server/pm/PackageInstallerService.java +2 −1 Original line number Diff line number Diff line Loading @@ -204,7 +204,8 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements mSessionsDir.mkdirs(); mApexManager = am; mStagingManager = new StagingManager(pm, this, am); mStagingManager = new StagingManager(pm, this, am, context); } boolean okToSendBroadcasts() { Loading
services/core/java/com/android/server/pm/StagingManager.java +19 −1 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.ParcelFileDescriptor; import android.os.PowerManager; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Slog; Loading Loading @@ -68,15 +69,18 @@ public class StagingManager { private final PackageInstallerService mPi; private final PackageManagerService mPm; private final ApexManager mApexManager; private final PowerManager mPowerManager; private final Handler mBgHandler; @GuardedBy("mStagedSessions") private final SparseArray<PackageInstallerSession> mStagedSessions = new SparseArray<>(); StagingManager(PackageManagerService pm, PackageInstallerService pi, ApexManager am) { StagingManager(PackageManagerService pm, PackageInstallerService pi, ApexManager am, Context context) { mPm = pm; mPi = pi; mApexManager = am; mPowerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); mBgHandler = BackgroundThread.getHandler(); } Loading Loading @@ -286,6 +290,20 @@ public class StagingManager { session.setStagedSessionFailed(SessionInfo.STAGED_SESSION_ACTIVATION_FAILED, "Staged installation of APKs failed. Check logcat messages for" + "more information."); if (!hasApex) { return; } if (!mApexManager.abortActiveSession()) { Slog.e(TAG, "Failed to abort APEXd session"); } else { Slog.e(TAG, "Successfully aborted apexd session. Rebooting device in order to revert " + "to the previous state of APEXd."); mPowerManager.reboot(null); } return; } Loading