summaryrefslogtreecommitdiff
path: root/libs/binder/BackendUnifiedServiceManager.cpp
AgeCommit message (Collapse)Author
2025-03-10Remove log if cache is disabled. Parth Sane
Change-Id: I8d419df56e22b7a334f419a58724d4144efc86f3 Flag: Bugfix Bug: 399202756 Test: N/A
2025-01-09[getService] Only set binder when getService2() succeeds Alice Wang
To avoid crashing in the getService() call. Bug: 387175643 Test: atest servicemanager_test Change-Id: I8617e748fdb85e96ded4c59b5c7785be20de05ee
2025-01-08[native] Restore ServiceManager#checkService() to return IBinder Alice Wang
This fixes crashes in 3p libraries. A new API ServiceManager#checkService2() has been introduced to work with the Service enum type. Bug: 387175643 Test: atest servicemanager_test Change-Id: I647f4a11469717c54111afab562a0be2d5260044
2025-01-03Add listServices/isDeclared/getDeclaredInstances for Accessors Devin Moore
We associate specific accessors with instance names, so we can get more information about what is available through the existing service manager APIs. Test: atest binderRpcTest Bug: 358427181 Change-Id: I337430a222b537643351bfc70178ccd1dc06d73b
2025-01-03Enable ServiceManager APIs without servicemanager process Devin Moore
In some devices, like Microdroid, there is no servicemanager process. These ServiceManager APIs may still be used with the new Accessor pattern for communication over sockets with binder RPC. This CL adds support for all of the getService APIs whithout relying on the servicemanager process. Future API support will be added separately. Test: atest vm_accessor_test binderLibTest Bug: 358427181 Change-Id: Ibef52415bf1509cdcd6c9cb65dbb8e20ec08d007
2024-12-05Libbinder cache: ensure binder thread count is checked when removing static list Parth Sane
Test: atest binderCacheUnitTest Flag: RELEASE_LIBBINDER_REMOVE_CACHE_STATIC_LIST Bug: 333854840 Change-Id: I5cec4f596887125ca2f8ca0f7c6388e58e97150a
2024-12-03Remove static list in libbinder for caching Parth Sane
This adds a new flag to identify Lazy services. This flag is set when addService is called from LazyServiceRegistrar. This flag is then used by libbinder in a client. When getService is called, libbinder decides if the binder should be cached or not using this flag. Doc: go/libbinder-cache-v2 Flag: RELEASE_LIBBINDER_REMOVE_STATIC_LIST Test: atest binderCacheUnitTest Bug: 333854840 Change-Id: I5fff0140f635dddb4f5a6d618f4e9abace6feb54
2024-11-29Add binder to libbinder cache after addService Parth Sane
This will prevent system_server and other applications from calling servicemanager for local binders. Flag: RELEASE_LIBBINDER_CLIENT_CACHE Bug: 333854840 Test: atest binderCacheUnitTest Change-Id: I2693f21a3f5b7a5770481e5ac79719444284524d
2024-10-25Merge "Use ProcessState::selfOrNull in ServiceManager APIs" into main Treehugger Robot
2024-10-25Use ProcessState::selfOrNull in ServiceManager APIs Devin Moore
Allow the APIs to be used when ProcessState isn't initialized. This allows the use of these APIs in systems like microdroid where there is no kernel binder driver. Test: atest vm_accessor_test Bug: 358427181 Change-Id: Ie981b0ca4335ddc7a5676d30721c01be1ffdf35e
2024-10-23Remove BackendUnifiedServiceManager::getImpl Devin Moore
It's not used and not needed. Test: m Bug: none Change-Id: I530ba6cabfea3636abb008b7c783b5ea7383771f
2024-10-21Merge changes from topic "goodbye_libnix" into main Treehugger Robot
* changes: Add `using binder::Status` to BackendUnifiedServiceManager.cpp Remove libnix dependency on libbinder_rs
2024-10-18Add `using binder::Status` to BackendUnifiedServiceManager.cpp Devin Moore
It's used so often in the file and `Status` is easier to read. Test: m Bug: none Change-Id: I0b996c5d53332d47deb2bb6c6142d828f9971d3b
2024-10-18Merge "Add Tracing for Binder Caching" into main Treehugger Robot
2024-10-17Add processes to cacheable list Parth Sane
Based on metrics, these are the processes which have a getService binder spam in the field Added vibrator service as we intend to remove it from Java Cache Bug: 333854840 Test: atest binderCacheUnitTest Change-Id: I6142c1502f35320791d5e77c64273abdbe8bd46a
2024-10-15Add Tracing for Binder Caching Parth Sane
Test: perfetto -c <perfetto config> Bug: 333854840 Change-Id: Iffb1e00f94722f60c85305e0596ce58b0df5a6da
2024-09-20Add more cachable service to libbinder cache Parth Sane
Adding Keystore, media_resource_monitor and most services retrieved in ActivityManagerService#getCommonServicesLocked Removing some services which were incorrectly added Test: atest binderCacheUnitTest Bug: 333854840 Flag: RELEASE_LIBBINDER_CLIENT_CACHE Change-Id: I4622fd572373ddb2aabf54713e94719f1e139540
2024-09-05Add a cache to getService with invalidation Parth Sane
Test: atest binderCacheUnitTest Bug: 333854840 Flag: LIBBINDER_CLIENT_CACHE Change-Id: I1b4e8482817c422850aed7359beaf7174b55445e
2024-08-29Add support for injecting RPC binder accessors to libbinder Devin Moore
This allows libbinder to set up client connections to binder RPC services underneath the libbinder service manager APIs. It requires callbacks to be added to the local process to get connection information that the client is responsible for obtaining. Once these callbacks are added to libbinder, any client elswhere in the process using the service manager APIs will be able to get and use a binder for the service in the same way they do for kernel binder services. Test: atest binderRpcTest vm_accessor_test Bug: 358427181 Change-Id: Iec27d30a669e0673bd66c99fded1edc335f7dff1
2024-07-26[native] Restore ServiceManager#getService() to return IBinder Alice Wang
This fixes a crash in 3p libraries. A new API ServiceManager#getService2() has been introduced to work with the Service enum type. Bug: 354674329 Bug: 355187769 Test: atest servicemanager_test Test: atest vm_accessor_test Test: Run the demo app in b/354674329 and check it works Change-Id: If1e0e9bee6dcd3cfceea69bea58ed5fbe431e81d
2024-07-19Support IAccessor in libbinder for RPC services Alice Wang
This cl sets up preconnected RPC binder for services launched with IAccessor as a proxy. Bug: 338541373 Test: m Test: atest vm_accessor_test Change-Id: Ic54732980778bc9ba8fec3395a0e98d336fea440
2024-06-28BackendUnifiedServiceManager: tidy up includes Tomasz Wasilczyk
This was breaking Linux Binder IPC (WIP) build. Bug: 341997808 Test: mma Change-Id: Ic3f25c9c49773d4f7c759e8318513f166ec2d995
2024-06-20Add a BackendUnifiedServiceManager wrapper Parth Sane
This can be directly used by java and rust ffi Test: atest aidl_integration_test Bug: 333854840 Flag: EXEMPT refactor Change-Id: I12c3730a89422bf08ab723a82888431f291bd7b3