OSDN Git Service

Do not stop idmap2d after OMS initialization
authorRyan Mitchell <rtmitchell@google.com>
Wed, 14 Aug 2019 17:25:26 +0000 (10:25 -0700)
committerRyan Mitchell <rtmitchell@google.com>
Wed, 14 Aug 2019 17:34:53 +0000 (17:34 +0000)
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
services/core/java/com/android/server/om/OverlayManagerService.java

index 91824c3..20a4c75 100644 (file)
@@ -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);
     }
 
index ce95181..da69986 100644 (file)
@@ -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);