If the ContentCaptureService has package dependency with other
package, if the package is updating, ContentCaptureService will also
be killed.
In the normal case, if the service will be reconnected but in this
case the binding is cleared without any notification to the
ContentCaptureManagerService. The bug is in the core platform infra.
In the Content Capture code, we only see the binderDied.
This change is a short term solution in S, we will rebind the service
when the binderDied. To avoid crash loop, we only bind the service
with limit rebind counts.
Bug: 199609306
Test: manual. Add addPackageDependency to package and update the
package. Make sure the state is not zombie.
Change-Id: I09a4cf6281a5a259a9a759ca640d6f075726e562
Increases complexity, but given the limited # of apps a user has, this shouldn't be a big problem.
Bug: 162609730
Tested: atest WhitelistTest, Manually on device
Change-Id: I4504b7eb7b503a95d663c375f481c997022d23fe
In order to support auto translation, we need to give information to
content capture service to let the app can use this information to
find the Activity which needed to be translated.
It's not safe to provide an activity token to the client app directly
even if it is a privilege app. They can use this activity token to
access many activity/windows related functions. We create a new token
for use for content capture and translation. This token will be used
get the target Activity for translation new APIs.
This change focuses on the Content capture API change, the API change
about translation will be done in the next change,
Bug: 177789967
Test: manual. Make sure cc service can get the information.
Test: atest android.view.contentcapture.ContentCaptureContextTest
Test: atest CtsContentCaptureServiceTestCases
Change-Id: Ife8096a8bd1e71ce4e686d95043e347222ad7ee6
Added the following static testAPIs to replace
the usage of adb commands in cts/gts tests:
* resetTemporaryService
* setTemporaryService
* setDefaultServiceEnabled
These APIs are static because by default ContentCaptureManager
isn't available until it's enabled using these APIs.
Test: Confirmed that the APIs are accessible in CTS tests.
Bug: 180328483
Change-Id: I0a94d90b509e1d2f695556955d85d27acab19ae9
UserController calls SystemServiceManager on some stages of the user
switch lifecycle, and SystemServiceManager calls the respective
callbacks in the SystemService objects it manage.
Prior to Android 11, these callbacks would take a @UserIdInt userid,
but now they take a TargetUser (which in turns contains a Userinfo).
So, currently, UserController calls SystemServiceManager passing the
userid, and SystemServiceManager gets the UserInfo from
UserManagerService. That works fine most of the time, but there might
be some race conditions when a user is removed that can crash the
system when such user is stopped (because UserManagerService doesn't
have its UserInfo anymore).
This CL fixes this issue by refactoring the user switch workflow so:
- TargetUser doesn't hold a reference to the UserInfo anymore, but
offer the methods needed by SystemService implementations.
- SystemServiceManager keeps track of the TargetUser objects used in
the callbacks.
Test: manual verification
Fixes: 159831354
Change-Id: If68ab1b5e247c7389c8cac16432d8b8809507e86
Catch the RemoteExceptions thrown in DataShareCallback's accept() and
reject() methods, as throwing an exception could result in the
ContentCaptureService crashing.
Bug: 159213080
Fixes: 159213080
Test: ran cts tests
Change-Id: I4ce8f15c835fba665a0657c7b3ed898f4e091b19
Implement IBinder.DeathRecipient in DataShareCallbackDelegate to listen
to the client's death and send an error to the CC service.
Test: CTS test
Bug: 157141129
Fixes: 157141129
Change-Id: I30f08f8ed741988ebcf585d74168d4dda03663a8
receives.
That is to give ability to the receiving end to close the stream and by
that cancel the copy operation.
Test: CTS in a parallel commit
Bug: 157141129
Change-Id: I1da1a47d7f8a7a5208644cf6e1266a3a2a724c17
references during the Content Capture Sharing.
Motivation: if the remote app is killed, we don't want a possibility of
system server holding a stroing reference (through a reference chain)
to large objects in that app. Therefore what's send in the binder has to
be a weak reference. And we will store a hard reference to those objects
in the client app's static context.
Storing hard references to objects in system_servier is less critical, because that is not going to be killed.
Bug: 148265162
Test: covered by CTS tests
Change-Id: Ie561aab6019d191cf8659fb350e045089e7781ed
(cherry picked from commit 13f65b2974)
sharing requrests.
Bug: 145205247
Test: this was actually surfaced during CTS tests implementation, when
subsequent test executions failed because of needing a timeout.
Change-Id: I529216d0e9139f165f90bdaab80850c4c047f836
As part of statsd becoming a Mainline module in R, autogenerated
StatsLog.write() calls are going away and replaced by
*StatsLog.java
that is autogenerated for each module.
This CL replaces some usages of StatsLog with
FrameworkStatsLog.
Bug: 145952197
Test: m
Change-Id: Iaa2db34a7be4c3215f62cc36661ba8ac81656baa
Motivation: if the Content Capture service want's to end the session, it
can close the read-fd, while not have finished reading, and that would
result in an exception in the system server, that can later be
propagated to the caller as an error.
Similarly, timeout of the sharing session can be reflected as an error
with a specific error code.
Test: built Android locally and perfomed a manual test.
Bug: 145203958
Change-Id: Iaeb45e0ab68da9fe30dce1ae4eab2354ef56d827
reference to its parent.
This is to prevent occasional data leaks caused by GC not cleaning up
parent resources.
Bug: 148265162
Test: built Android and performed an E2E test
Change-Id: Ie2b948fa2e5f457f2f44883cfb5995287a704bb5
This API allows any whitelisted caller app supply data to Content
Capture Service. CDD suggests to not use standard "binding" mechanisms,
so this is a guaranteed-writeonly way of sharing data.
Test: build Android locally, manual E2E test
Bug: 145203958
Change-Id: If2219acd6aa48f199e4dadd6f18ceb55c258e1d0
Also changed AutofillManagerService and ContentCaptureManagerService to take advantage of these methods.
Test: manual verification
Test: atest CtsAutoFillServiceTestCases CtsContentCaptureServiceTestCases # on phone and Automotive
Bug: 133242016
Change-Id: I3e7f9d65a6ef1e8e6ec886a41b35733e463a6389