Merge "Improve logging for why a staged session was reverted"
This commit is contained in:
@@ -1060,7 +1060,9 @@ class PackageManagerShellCommand extends ShellCommand {
|
|||||||
+ "; isStaged = " + session.isStaged()
|
+ "; isStaged = " + session.isStaged()
|
||||||
+ "; isReady = " + session.isStagedSessionReady()
|
+ "; isReady = " + session.isStagedSessionReady()
|
||||||
+ "; isApplied = " + session.isStagedSessionApplied()
|
+ "; isApplied = " + session.isStagedSessionApplied()
|
||||||
+ "; isFailed = " + session.isStagedSessionFailed() + ";");
|
+ "; isFailed = " + session.isStagedSessionFailed()
|
||||||
|
+ "; errorMsg = " + session.getStagedSessionErrorMessage()
|
||||||
|
+ ";");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Intent parseIntentAndUser() throws URISyntaxException {
|
private Intent parseIntentAndUser() throws URISyntaxException {
|
||||||
|
|||||||
@@ -605,13 +605,14 @@ public class StagingManager {
|
|||||||
// If checkpoint is supported, then we only resume sessions if we are in checkpointing
|
// If checkpoint is supported, then we only resume sessions if we are in checkpointing
|
||||||
// mode. If not, we fail all sessions.
|
// mode. If not, we fail all sessions.
|
||||||
if (supportsCheckpoint() && !needsCheckpoint()) {
|
if (supportsCheckpoint() && !needsCheckpoint()) {
|
||||||
String errorMsg = "Reverting back to safe state. Marking " + session.sessionId
|
String revertMsg = "Reverting back to safe state. Marking "
|
||||||
+ " as failed";
|
+ session.sessionId + " as failed.";
|
||||||
if (!TextUtils.isEmpty(mFailureReason)) {
|
final String reasonForRevert = getReasonForRevert();
|
||||||
errorMsg = errorMsg + ": " + mFailureReason;
|
if (!TextUtils.isEmpty(reasonForRevert)) {
|
||||||
|
revertMsg += " Reason for revert: " + reasonForRevert;
|
||||||
}
|
}
|
||||||
Slog.d(TAG, errorMsg);
|
Slog.d(TAG, revertMsg);
|
||||||
session.setStagedSessionFailed(SessionInfo.STAGED_SESSION_UNKNOWN, errorMsg);
|
session.setStagedSessionFailed(SessionInfo.STAGED_SESSION_UNKNOWN, revertMsg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
@@ -715,6 +716,16 @@ public class StagingManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getReasonForRevert() {
|
||||||
|
if (!TextUtils.isEmpty(mFailureReason)) {
|
||||||
|
return mFailureReason;
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(mNativeFailureReason)) {
|
||||||
|
return "Session reverted due to crashing native process: " + mNativeFailureReason;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
private List<String> findAPKsInDir(File stageDir) {
|
private List<String> findAPKsInDir(File stageDir) {
|
||||||
List<String> ret = new ArrayList<>();
|
List<String> ret = new ArrayList<>();
|
||||||
if (stageDir != null && stageDir.exists()) {
|
if (stageDir != null && stageDir.exists()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user