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

Commit 21d4b20f authored by Felipe Leme's avatar Felipe Leme Committed by Android (Google) Code Review
Browse files

Merge "Changed ActivityManager.requestBugreport() to take a 'progress' parameter."

parents 86fd6d15 4cc86333
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ public class Am extends BaseCommand {
                "       am clear-debug-app\n" +
                "       am set-watch-heap <PROCESS> <MEM-LIMIT>\n" +
                "       am clear-watch-heap\n" +
                "       am bug-report [--progress]\n" +
                "       am monitor [--gdb <port>]\n" +
                "       am hang [--allow-restart]\n" +
                "       am restart\n" +
@@ -258,8 +259,9 @@ public class Am extends BaseCommand {
                "\n" +
                "am clear-watch-heap: clear the previously set-watch-heap.\n" +
                "\n" +
                "am bug-report: request bug report generation; will launch UI\n" +
                "    when done to select where it should be delivered.\n" +
                "am bug-report: request bug report generation; will launch a notification\n" +
                "    when done to select where it should be delivered. Options are: \n" +
                "   --progress: will launch a notification right away to show its progress.\n" +
                "\n" +
                "am monitor: start monitoring for crashes or ANRs.\n" +
                "    --gdb: start gdbserv on the given port at crash/ANR\n" +
@@ -1072,7 +1074,17 @@ public class Am extends BaseCommand {
    }

    private void runBugReport() throws Exception {
        mAm.requestBugReport();
        String opt;
        boolean progress = false;
        while ((opt=nextOption()) != null) {
            if (opt.equals("--progress")) {
                progress = true;
            } else {
                System.err.println("Error: Unknown option: " + opt);
                return;
            }
        }
        mAm.requestBugReport(progress);
        System.out.println("Your lovely bug report is being created; please be patient.");
    }

+4 −2
Original line number Diff line number Diff line
@@ -2228,7 +2228,8 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM

        case REQUEST_BUG_REPORT_TRANSACTION: {
            data.enforceInterface(IActivityManager.descriptor);
            requestBugReport();
            boolean progress = data.readInt() != 0;
            requestBugReport(progress);
            reply.writeNoException();
            return true;
        }
@@ -5616,10 +5617,11 @@ class ActivityManagerProxy implements IActivityManager
        reply.recycle();
    }

    public void requestBugReport() throws RemoteException {
    public void requestBugReport(boolean progress) throws RemoteException {
        Parcel data = Parcel.obtain();
        Parcel reply = Parcel.obtain();
        data.writeInterfaceToken(IActivityManager.descriptor);
        data.writeInt(progress ? 1 : 0);
        mRemote.transact(REQUEST_BUG_REPORT_TRANSACTION, data, reply, 0);
        reply.readException();
        data.recycle();
+1 −1
Original line number Diff line number Diff line
@@ -437,7 +437,7 @@ public interface IActivityManager extends IInterface {
    public void registerUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException;
    public void unregisterUserSwitchObserver(IUserSwitchObserver observer) throws RemoteException;

    public void requestBugReport() throws RemoteException;
    public void requestBugReport(boolean progress) throws RemoteException;

    public long inputDispatchingTimedOut(int pid, boolean aboveSystem, String reason)
            throws RemoteException;
+1 −1
Original line number Diff line number Diff line
@@ -123,7 +123,7 @@ public class BugreportProgressService extends Service {

    /** System property (and value) used for stop dumpstate. */
    private static final String CTL_STOP = "ctl.stop";
    private static final String BUGREPORT_SERVICE = "bugreport";
    private static final String BUGREPORT_SERVICE = "bugreportplus";

    /** Managed dumpstate processes (keyed by pid) */
    private final SparseArray<BugreportInfo> mProcesses = new SparseArray<>();
+3 −2
Original line number Diff line number Diff line
@@ -11191,9 +11191,10 @@ public final class ActivityManagerService extends ActivityManagerNative
        }
    }
    public void requestBugReport() {
    public void requestBugReport(boolean progress) {
        final String service = progress ? "bugreportplus" : "bugreport";
        enforceCallingPermission(android.Manifest.permission.DUMP, "requestBugReport");
        SystemProperties.set("ctl.start", "bugreport");
        SystemProperties.set("ctl.start", service);
    }
    public static long getInputDispatchingTimeoutLocked(ActivityRecord r) {
Loading