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

Commit e9b8e09f authored by Andrew Sapperstein's avatar Andrew Sapperstein Committed by Android (Google) Code Review
Browse files

Merge "Ignore first crash dialog."

parents 6ccd91ce 43643aee
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -6561,6 +6561,14 @@ public final class Settings {
         */
        public static final String ANR_SHOW_BACKGROUND = "anr_show_background";

        /**
         * If nonzero, crashes in foreground processes will bring up a dialog.
         * Otherwise, the process will be silently killed.
         * @hide
         */
        public static final String SHOW_FIRST_CRASH_DIALOG_DEV_OPTION =
                "show_first_crash_dialog_dev_option";

        /**
         * The {@link ComponentName} string of the service to be used as the voice recognition
         * service.
@@ -7398,6 +7406,7 @@ public final class Settings {
            SCREENSAVER_ACTIVATE_ON_DOCK,
            SCREENSAVER_ACTIVATE_ON_SLEEP,
            LOCKDOWN_IN_POWER_MENU,
            SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
        };

        /** @hide */
@@ -11316,6 +11325,13 @@ public final class Settings {
         */
        public static final String ENABLE_SMART_REPLIES_IN_NOTIFICATIONS =
                "enable_smart_replies_in_notifications";

        /**
         * If nonzero, crashes in foreground processes will bring up a dialog.
         * Otherwise, the process will be silently killed.
         * @hide
         */
        public static final String SHOW_FIRST_CRASH_DIALOG = "show_first_crash_dialog";
    }

    /**
+4 −2
Original line number Diff line number Diff line
@@ -390,8 +390,9 @@ message GlobalSettingsProto {
    optional SettingProto enable_gnss_raw_meas_full_tracking = 346;
    optional SettingProto zram_enabled = 347;
    optional SettingProto enable_smart_replies_in_notifications = 348;
    optional SettingProto show_first_crash_dialog = 349;

    // Next tag = 349;
    // Next tag = 350;
}

message SecureSettingsProto {
@@ -593,8 +594,9 @@ message SecureSettingsProto {
    optional SettingProto qs_auto_added_tiles = 193;
    optional SettingProto lockdown_in_power_menu = 194;
    optional SettingProto backup_manager_constants = 169;
    optional SettingProto show_first_crash_dialog_dev_option = 195;

    // Next tag = 195
    // Next tag = 196
}

message SystemSettingsProto {
+1 −0
Original line number Diff line number Diff line
@@ -331,6 +331,7 @@ public class SettingsBackupTest {
                    Settings.Global.SETUP_PREPAID_DETECTION_REDIR_HOST,
                    Settings.Global.SETUP_PREPAID_DETECTION_TARGET_URL,
                    Settings.Global.SHORTCUT_MANAGER_CONSTANTS,
                    Settings.Global.SHOW_FIRST_CRASH_DIALOG,
                    Settings.Global.SHOW_NOTIFICATION_CHANNEL_WARNINGS,
                    Settings.Global.SHOW_TEMPERATURE_WARNING,
                    Settings.Global.SMART_SELECTION_UPDATE_CONTENT_URL,
+6 −0
Original line number Diff line number Diff line
@@ -1125,6 +1125,9 @@ class SettingsProtoDumpUtil {
        dumpSetting(s, p,
                Settings.Global.ENABLE_SMART_REPLIES_IN_NOTIFICATIONS,
                GlobalSettingsProto.ENABLE_SMART_REPLIES_IN_NOTIFICATIONS);
        dumpSetting(s, p,
                Settings.Global.SHOW_FIRST_CRASH_DIALOG,
                GlobalSettingsProto.SHOW_FIRST_CRASH_DIALOG);
    }

    /** Dump a single {@link SettingsState.Setting} to a proto buf */
@@ -1515,6 +1518,9 @@ class SettingsProtoDumpUtil {
        dumpSetting(s, p,
                Settings.Secure.ANR_SHOW_BACKGROUND,
                SecureSettingsProto.ANR_SHOW_BACKGROUND);
        dumpSetting(s, p,
                Settings.Secure.SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
                SecureSettingsProto.SHOW_FIRST_CRASH_DIALOG_DEV_OPTION);
        dumpSetting(s, p,
                Settings.Secure.VOICE_RECOGNITION_SERVICE,
                SecureSettingsProto.VOICE_RECOGNITION_SERVICE);
+10 −1
Original line number Diff line number Diff line
@@ -738,9 +738,18 @@ class AppErrors {
                }
                return;
            }
            final boolean showFirstCrash = Settings.Global.getInt(
                    mContext.getContentResolver(),
                    Settings.Global.SHOW_FIRST_CRASH_DIALOG, 0) != 0;
            final boolean showFirstCrashDevOption = Settings.Secure.getIntForUser(
                    mContext.getContentResolver(),
                    Settings.Secure.SHOW_FIRST_CRASH_DIALOG_DEV_OPTION,
                    0,
                    UserHandle.USER_CURRENT) != 0;
            final boolean crashSilenced = mAppsNotReportingCrashes != null &&
                    mAppsNotReportingCrashes.contains(proc.info.packageName);
            if ((mService.canShowErrorDialogs() || showBackground) && !crashSilenced) {
            if ((mService.canShowErrorDialogs() || showBackground) && !crashSilenced
                    && (showFirstCrash || showFirstCrashDevOption || data.repeating)) {
                proc.crashDialog = new AppErrorDialog(mContext, mService, data);
            } else {
                // The device is asleep, so just pretend that the user