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

Commit a55b3929 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove enum logic from callers of requestbugreport()"

parents ba3b9902 16207e33
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -665,8 +665,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
                        // Take an "interactive" bugreport.
                        MetricsLogger.action(mContext,
                                MetricsEvent.ACTION_BUGREPORT_FROM_POWER_MENU_INTERACTIVE);
                        ActivityManager.getService().requestBugReport(
                                ActivityManager.BUGREPORT_OPTION_INTERACTIVE);
                        ActivityManager.getService().requestInteractiveBugReport();
                    } catch (RemoteException e) {
                    }
                }
@@ -683,8 +682,7 @@ public class GlobalActionsDialog implements DialogInterface.OnDismissListener,
            try {
                // Take a "full" bugreport.
                MetricsLogger.action(mContext, MetricsEvent.ACTION_BUGREPORT_FROM_POWER_MENU_FULL);
                ActivityManager.getService().requestBugReport(
                        ActivityManager.BUGREPORT_OPTION_FULL);
                ActivityManager.getService().requestFullBugReport();
            } catch (RemoteException e) {
            }
            return false;
+9 −4
Original line number Diff line number Diff line
@@ -1016,18 +1016,23 @@ final class ActivityManagerShellCommand extends ShellCommand {

    int runBugReport(PrintWriter pw) throws RemoteException {
        String opt;
        int bugreportType = ActivityManager.BUGREPORT_OPTION_FULL;
        boolean fullBugreport = true;
        while ((opt=getNextOption()) != null) {
            if (opt.equals("--progress")) {
                bugreportType = ActivityManager.BUGREPORT_OPTION_INTERACTIVE;
                fullBugreport = false;
                mInterface.requestInteractiveBugReport();
            } else if (opt.equals("--telephony")) {
                bugreportType = ActivityManager.BUGREPORT_OPTION_TELEPHONY;
                fullBugreport = false;
                // no title and description specified
                mInterface.requestTelephonyBugReport("" /* no title */, "" /* no descriptions */);
            } else {
                getErrPrintWriter().println("Error: Unknown option: " + opt);
                return -1;
            }
        }
        mInterface.requestBugReport(bugreportType);
        if (fullBugreport) {
            mInterface.requestFullBugReport();
        }
        pw.println("Your lovely bug report is being created; please be patient.");
        return 0;
    }
+2 −4
Original line number Diff line number Diff line
@@ -370,8 +370,7 @@ class LegacyGlobalActions implements DialogInterface.OnDismissListener, DialogIn
                        // Take an "interactive" bugreport.
                        MetricsLogger.action(mContext,
                                MetricsEvent.ACTION_BUGREPORT_FROM_POWER_MENU_INTERACTIVE);
                        ActivityManager.getService().requestBugReport(
                                ActivityManager.BUGREPORT_OPTION_INTERACTIVE);
                        ActivityManager.getService().requestInteractiveBugReport();
                    } catch (RemoteException e) {
                    }
                }
@@ -388,8 +387,7 @@ class LegacyGlobalActions implements DialogInterface.OnDismissListener, DialogIn
            try {
                // Take a "full" bugreport.
                MetricsLogger.action(mContext, MetricsEvent.ACTION_BUGREPORT_FROM_POWER_MENU_FULL);
                ActivityManager.getService().requestBugReport(
                        ActivityManager.BUGREPORT_OPTION_FULL);
                ActivityManager.getService().requestFullBugReport();
            } catch (RemoteException e) {
            }
            return false;
+1 −2
Original line number Diff line number Diff line
@@ -3122,8 +3122,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                || Settings.Global.getInt(mContext.getContentResolver(),
                        Settings.Global.DEVELOPMENT_SETTINGS_ENABLED, 0) == 1) {
            try {
                ActivityManager.getService()
                        .requestBugReport(ActivityManager.BUGREPORT_OPTION_FULL);
                ActivityManager.getService().requestFullBugReport();
            } catch (RemoteException e) {
                Slog.e(TAG, "Error taking bugreport", e);
            }
+1 −2
Original line number Diff line number Diff line
@@ -7389,8 +7389,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        final long callingIdentity = mInjector.binderClearCallingIdentity();
        try {
            mInjector.getIActivityManager().requestBugReport(
                    ActivityManager.BUGREPORT_OPTION_REMOTE);
            mInjector.getIActivityManager().requestRemoteBugReport();
            mRemoteBugreportServiceIsActive.set(true);
            mRemoteBugreportSharingAccepted.set(false);