From 43b63f0d4efff4ec8456da8785aecc7cadfd0944 Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Wed, 26 May 2021 16:12:21 -0700 Subject: [PATCH] Swallow exception from failed idmap2d disable If the idmap daemon cannot be disabled for some reason, it is okay to swallow the exception caused by failing to set "ctl.stop". Log a warning instead. Bug: 186761471 Test: builds Change-Id: Iae07c9f9af6a0c07fd6d89d97452f0add19db56d --- services/core/java/com/android/server/om/IdmapDaemon.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/om/IdmapDaemon.java b/services/core/java/com/android/server/om/IdmapDaemon.java index 2ebc8edb6740b..b07a1f7f237c7 100644 --- a/services/core/java/com/android/server/om/IdmapDaemon.java +++ b/services/core/java/com/android/server/om/IdmapDaemon.java @@ -194,7 +194,13 @@ class IdmapDaemon { } private static void stopIdmapService() { - SystemService.stop(IDMAP_DAEMON); + try { + SystemService.stop(IDMAP_DAEMON); + } catch (RuntimeException e) { + // If the idmap daemon cannot be disabled for some reason, it is okay + // since we already finished invoking idmap. + Slog.w(TAG, "Failed to disable idmap2 daemon", e); + } } private Connection connect() throws TimeoutException, RemoteException {