From 0fc5b0efb72e24486449e78c8111fd7ef24991c0 Mon Sep 17 00:00:00 2001 From: Fyodor Kupolov Date: Wed, 7 Feb 2018 10:50:23 -0800 Subject: Catch and log exceptions when setting system property Otherwise they can cause system restart since the code is running on main thread. Failure to set the mapped property shouldn't be catastrophic, because the mapping is primarily used for experiments. Test: manual Bug: 73018322 Change-Id: I80bb71c67fa74c1830618795c39ea15b8964ef2e --- .../java/com/android/server/am/GlobalSettingsToPropertiesMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/GlobalSettingsToPropertiesMapper.java b/services/core/java/com/android/server/am/GlobalSettingsToPropertiesMapper.java index fe6597847320..0bc9d362d31a 100644 --- a/services/core/java/com/android/server/am/GlobalSettingsToPropertiesMapper.java +++ b/services/core/java/com/android/server/am/GlobalSettingsToPropertiesMapper.java @@ -94,7 +94,7 @@ class GlobalSettingsToPropertiesMapper { } try { systemPropertiesSet(key, value); - } catch (IllegalArgumentException e) { + } catch (Exception e) { Slog.e(TAG, "Unable to set property " + key + " value '" + value + "'", e); } } -- cgit v1.2.3-59-g8ed1b