From b8fbab621840616339a0831ddca07ce97a130cfc Mon Sep 17 00:00:00 2001 From: Ryan Mitchell Date: Wed, 14 Aug 2019 10:25:26 -0700 Subject: [PATCH] Do not stop idmap2d after OMS initialization The OMS was calling stopIdmapService after OMS initialization finished. This method was not setting the cached service binder to null and the service binder was being reused when an overlay is enabled or disabled within the 10 seconds the connection to the service is still opened. This change no longer calls stopIdmapService and makes startIdmapService and stopIdmapService private to IdmapDaemon. Bug: 139307780 Test: enabled overlay within 10 seconds of OMS startup ending and observed state STATE_ENABLED. Change-Id: I46b6a3631278c4dbdf5e5d373e085bac5186ed9a --- services/core/java/com/android/server/om/IdmapDaemon.java | 4 ++-- .../java/com/android/server/om/OverlayManagerService.java | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/om/IdmapDaemon.java b/services/core/java/com/android/server/om/IdmapDaemon.java index 91824c3e9f434..20a4c75a1ce67 100644 --- a/services/core/java/com/android/server/om/IdmapDaemon.java +++ b/services/core/java/com/android/server/om/IdmapDaemon.java @@ -129,11 +129,11 @@ class IdmapDaemon { } } - static void startIdmapService() { + private static void startIdmapService() { SystemProperties.set("ctl.start", IDMAP_DAEMON); } - static void stopIdmapService() { + private static void stopIdmapService() { SystemProperties.set("ctl.stop", IDMAP_DAEMON); } diff --git a/services/core/java/com/android/server/om/OverlayManagerService.java b/services/core/java/com/android/server/om/OverlayManagerService.java index ce951816d3a67..da69986cd59f8 100644 --- a/services/core/java/com/android/server/om/OverlayManagerService.java +++ b/services/core/java/com/android/server/om/OverlayManagerService.java @@ -262,7 +262,6 @@ public final class OverlayManagerService extends SystemService { initIfNeeded(); onSwitchUser(UserHandle.USER_SYSTEM); - IdmapDaemon.stopIdmapService(); publishBinderService(Context.OVERLAY_SERVICE, mService); publishLocalService(OverlayManagerService.class, this);