Merge "Watchdog: Rename properties to follow guidelines" am: 62bdf8c076

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1560493

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I50a67a9f9244e5d5f16b186a8f993baf8303c236
This commit is contained in:
Treehugger Robot
2021-01-27 16:11:18 +00:00
committed by Automerger Merge Worker
3 changed files with 9 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ module: "android.sysprop.WatchdogProperties"
owner: Platform owner: Platform
# To escape the watchdog timeout loop, fatal reboot the system when # To escape the watchdog timeout loop, fatal reboot the system when
# watchdog timed out 'fatal_count' times in 'fatal_window_second' # watchdog timed out 'fatal_count' times in 'fatal_window_seconds'
# seconds, if both values are not 0. Default value of both is 0. # seconds, if both values are not 0. Default value of both is 0.
prop { prop {
api_name: "fatal_count" api_name: "fatal_count"
@@ -26,8 +26,9 @@ prop {
access: Readonly access: Readonly
} }
# See 'fatal_count' for documentation.
prop { prop {
api_name: "fatal_window_second" api_name: "fatal_window_seconds"
type: Integer type: Integer
prop_name: "framework_watchdog.fatal_window.second" prop_name: "framework_watchdog.fatal_window.second"
scope: Internal scope: Internal
@@ -35,9 +36,9 @@ prop {
} }
# The fatal counting can be disabled by setting property # The fatal counting can be disabled by setting property
# 'is_fatal_ignore' to true. # 'should_ignore_fatal_count' to true.
prop { prop {
api_name: "is_fatal_ignore" api_name: "should_ignore_fatal_count"
type: Boolean type: Boolean
prop_name: "persist.debug.framework_watchdog.fatal_ignore" prop_name: "persist.debug.framework_watchdog.fatal_ignore"
scope: Internal scope: Internal

View File

@@ -7,13 +7,13 @@ props {
prop_name: "framework_watchdog.fatal_count" prop_name: "framework_watchdog.fatal_count"
} }
prop { prop {
api_name: "fatal_window_second" api_name: "fatal_window_seconds"
type: Integer type: Integer
scope: Internal scope: Internal
prop_name: "framework_watchdog.fatal_window.second" prop_name: "framework_watchdog.fatal_window.second"
} }
prop { prop {
api_name: "is_fatal_ignore" api_name: "should_ignore_fatal_count"
scope: Internal scope: Internal
prop_name: "persist.debug.framework_watchdog.fatal_ignore" prop_name: "persist.debug.framework_watchdog.fatal_ignore"
} }

View File

@@ -704,7 +704,7 @@ public class Watchdog extends Thread {
WatchdogDiagnostics.diagnoseCheckers(blockedCheckers); WatchdogDiagnostics.diagnoseCheckers(blockedCheckers);
Slog.w(TAG, "*** GOODBYE!"); Slog.w(TAG, "*** GOODBYE!");
if (!Build.IS_USER && isCrashLoopFound() if (!Build.IS_USER && isCrashLoopFound()
&& !WatchdogProperties.is_fatal_ignore().orElse(false)) { && !WatchdogProperties.should_ignore_fatal_count().orElse(false)) {
breakCrashLoop(); breakCrashLoop();
} }
Process.killProcess(Process.myPid()); Process.killProcess(Process.myPid());
@@ -783,7 +783,7 @@ public class Watchdog extends Thread {
private boolean isCrashLoopFound() { private boolean isCrashLoopFound() {
int fatalCount = WatchdogProperties.fatal_count().orElse(0); int fatalCount = WatchdogProperties.fatal_count().orElse(0);
long fatalWindowMs = TimeUnit.SECONDS.toMillis( long fatalWindowMs = TimeUnit.SECONDS.toMillis(
WatchdogProperties.fatal_window_second().orElse(0)); WatchdogProperties.fatal_window_seconds().orElse(0));
if (fatalCount == 0 || fatalWindowMs == 0) { if (fatalCount == 0 || fatalWindowMs == 0) {
if (fatalCount != fatalWindowMs) { if (fatalCount != fatalWindowMs) {
Slog.w(TAG, String.format("sysprops '%s' and '%s' should be set or unset together", Slog.w(TAG, String.format("sysprops '%s' and '%s' should be set or unset together",