Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2badc1e4 authored by Nandana Dutt's avatar Nandana Dutt Committed by Gerrit Code Review
Browse files

Merge "Add a new error code for disallowing concurrent bugreports"

parents 1d8977b9 cfb3d485
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4015,6 +4015,7 @@ package android.os {
    method public void onError(int);
    method public void onFinished();
    method public void onProgress(float);
    field public static final int BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS = 5; // 0x5
    field public static final int BUGREPORT_ERROR_INVALID_INPUT = 1; // 0x1
    field public static final int BUGREPORT_ERROR_RUNTIME = 2; // 0x2
    field public static final int BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT = 4; // 0x4
+9 −1
Original line number Diff line number Diff line
@@ -59,7 +59,8 @@ public class BugreportManager {
                BUGREPORT_ERROR_INVALID_INPUT,
                BUGREPORT_ERROR_RUNTIME,
                BUGREPORT_ERROR_USER_DENIED_CONSENT,
                BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT
                BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT,
                BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS
        })

        /** Possible error codes taking a bugreport can encounter */
@@ -81,6 +82,10 @@ public class BugreportManager {
        public static final int BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT =
                IDumpstateListener.BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT;

        /** There is currently a bugreport running. The caller should try again later. */
        public static final int BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS =
                IDumpstateListener.BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS;

        /**
         * Called when there is a progress update.
         * @param progress the progress in [0.0, 100.0]
@@ -96,6 +101,9 @@ public class BugreportManager {
         * <p>If {@code BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT} is passed, then the consent timed
         * out, but the bugreport could be available in the internal directory of dumpstate for
         * manual retrieval.
         *
         * <p> If {@code BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS} is passed, then the
         * caller should try later, as only one bugreport can be in progress at a time.
         */
        public void onError(@BugreportErrorCode int errorCode) {}

+2 −2
Original line number Diff line number Diff line
@@ -146,8 +146,8 @@ class BugreportManagerServiceImpl extends IDumpstate.Stub {
        if (isDumpstateBinderServiceRunningLocked()) {
            Slog.w(TAG, "'dumpstate' is already running. Cannot start a new bugreport"
                    + " while another one is currently in progress.");
            // TODO(b/111441001): Use a new error code; add this to the documentation of the API.
            reportError(listener, IDumpstateListener.BUGREPORT_ERROR_RUNTIME_ERROR);
            reportError(listener,
                    IDumpstateListener.BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS);
            return;
        }