Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f521ab7e authored by Jared Duke's avatar Jared Duke
Browse files

Cache ContentCaptureManager service behind a flag

This service is queried after the application is bound to register
a ContentCaptureOptions callback. Avoid associated ServiceManager
lookups by seeding the application service cache with the appropriate
ContentCaptureManager service handle.

Flag: com.android.server.am.cache_content_capture_service
Test: presubmit
Test: Enable flag + inspect trace for no service_manager startup call
Bug: 414380203
Change-Id: I3637c8bc63cbe82207e25ea3c4ff6d982d45aaae
parent a06fad93
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2825,6 +2825,13 @@ public class ActivityManagerService extends IActivityManager.Stub
            addServiceToMap(mAppBindArgs, Context.USER_SERVICE);
            addServiceToMap(mAppBindArgs, "mount");
            addServiceToMap(mAppBindArgs, Context.PLATFORM_COMPAT_SERVICE);
            // During startup, bound applications will always attempt registration of a
            // ContentCaptureOptions listener with the ContentCaptureManager service. Seeding
            // applications with the service handle avoids an unnecessary ServiceManager hop.
            if (Flags.cacheContentCaptureService()) {
                addServiceToMap(mAppBindArgs, Context.CONTENT_CAPTURE_MANAGER_SERVICE);
            }
        }
        return mAppBindArgs;
    }
+10 −0
Original line number Diff line number Diff line
@@ -238,3 +238,13 @@ flag {
        purpose: PURPOSE_BUGFIX
    }
}

flag {
    name: "cache_content_capture_service"
    namespace: "system_performance"
    description: "Seed ContentCaptureManager into the bound application's initial service cache"
    bug: "414380203"
    metadata {
        purpose: PURPOSE_BUGFIX
    }
}