summaryrefslogtreecommitdiff
path: root/java/tests/AndroidManifest.xml
AgeCommit message (Collapse)Author
2023-11-28Splits tests Mark Renouf
This splits the monolithic 'tests' target into multiple types based on classification. See the corresponding README.md for descriptions. The target 'IntentResolverUnitTests' is replaced by: IntentResolver-tests-unit IntentResolver-tests-activity IntentResolver-tests-integration IntentResolver-tests-shared To run everything, use: atest IntentResolver-tests-* To run TreeHugger presubmits: atest --test-mapping pacakges/modules/IntentResolver Equivalently for postsubmit: atest --test-mapping pacakges/modules/IntentResolver:postsubmit Bug: 300157408 Test: atest IntentResolver-tests-* Change-Id: I9d499284f070a4bfa3e7c1b7c3bbfaa8adb3379b
2023-10-03Hard fork of the ChoserActivity and ResolverActivity Govinda Wasserman
The forked versions are flag guarded by the ChooserSelector. Test: atest com.android.intentresolver Test: adb shell pm resolve-activity -a android.intent.action.CHOOSER Test: Observe that the action resolves to .ChooserActivity Test: adb shell device_config put intentresolver \ com.android.intentresolver.flags.modular_framework true Test: Reboot device Test: adb shell pm resolve-activity -a android.intent.action.CHOOSER Test: Observe that the action resolves to .v2.ChooserActivity BUG: 302113519 Change-Id: I59584ed4649fca754826b17055a41be45a32f326
2023-09-14Switches to HiltTestApplication in tests. Mark Renouf
This allows testing with @HiltAndroidTest, @TestInstallIn, etc. Usage to follow in a CL series. Bug: 296633726 Bug: 300157408 Flag: EXEMPT Change-Id: I13fbf29005e11ea7375d77d11da4bc1bfa68b666
2023-09-06Adds AConfig flag infrastructure to IntentResolver Mark Renouf
Build: Inlcudes Some general build hygeine and simplification Creates an aconfig flag declaration and java library Add java_defaults rules for library and app for common settings Tests: Added direct dep on JUnit (was indirectly pulled in) Remove source dependency (on main code) from the test app target Remove optimization and dexopt from the debug app target Test: All existing tests pass; atest IntentResolverUnitTests Test: Setup using ASfP (Android studio for platform) Bug: 296633726 Change-Id: I8046f76aa20957342ddddabc8861c0a8fe25e0fb
2023-09-01Set IntentResolverUnitTests' targetSdk to "current" Mark Renouf
It was previously fixed at "30" which was hiding a lot of API lint. While fixing and reviewing that code I also found and corrected anumber of timeout checks with no assertions or no timeout duration (causing false positives or hangs). Bug: 297527444 Bug: 297549732 Test: atest IntentResolverUnitTests Change-Id: I65eda95ea3dc84b7b4b5c497b195474f094e048d
2023-08-30Revert "Creates application-level and activity-level dagger graphs" Mark Renouf
This reverts commit 114b886b4aaf3341b4072f184c96cc71d4763f76. and dependent commit 35a34bcaf236597703208cf0472cb268b42abb1c. Change-Id: Ied8c43ed7c596624e045cb8e7b4e7f1c9ba66c58
2023-08-08Adds Dagger support for ViewModel scope Mark Renouf
Dependencies may now be bound to ViewModelScope which survives across Activity configuration restarts. ChooserViewModel is available in ChooserActivity. ViewModel components should be provided by ViewModelComponent to wire up the core parts of the app. A @ViewModel CoroutineScope is also available to inject from within ViewModelScope. * Injects [Resolver|Chooser](Wrapper)Activity in tests * Injects Intent args (Bundle) into ViewModel * Injects Referrer (Uri) into ViewModel Adjusts module structure slightly to accomodate the current state. Further restructuring will be done to simplify the test modules & components required. Test: atest IntentResolverUnitTests Change-Id: Ia249cf07796a9993f2cd021930c52faadb046ca8
2023-06-23Creates application-level and activity-level dagger graphs Govinda Wasserman
Provides Activities and BroadcastReceivers with the ability to use injection in their constructors. Adds ChooserActivity, ResolverActivity, IntentForwarderActivity, and ChooserActivityReEnabler to the dagger graph. Test: Existing tests still pass BUG: 242615621 Change-Id: I0ce3bb225ceab59243833535c3776d9d64672d7d
2023-05-05Add test content provider to mock uri mime types Andrey Epin
Add a content provider that returns getType and getStreamTypes based on the URI query parameters. That allows us not to rely on the debug hook to override URI mime types, mock files with previes, and makes our integration tests more integral. Bug: 280237072 Test: tests themselves Change-Id: I70835439e8b8b41f4dc633f218d662c2bc42c3ae
2022-11-16Extract shortcuts loading logic from ChooserActivity Andrey Epin
Extract shortcut loading logic from ChooserActivity into a new class mostly as-is. Major changes: - run the logic on a background executor and deliver the result on the main thread; - replace dependencies from ChooserListAdapter with the data it provided. A number of tests thap previusly used ChooserListAdapter#addServiceResults to provide shortcut results into the view are updated and re-enabled. Re-introduction of ag/20236439 Fix: 259462188 Test: manual tests Test: atest IntentResolverUnitTests Change-Id: I2555c3e486b9a443c5101bbda33b5b214c959b0f
2022-11-16Revert "Extract shortcuts loading logic from ChooserActivity" Aaron Liu
This reverts commit 9f9dceaa1398c925b233bcc54fb47cf3531a88da. Reason for revert: DroidMonitor-triggered revert due to breakage b/259256230. Change-Id: I399625feb7ee3e6858db2863c8d66e62eccc98c4
2022-11-14Extract shortcuts loading logic from ChooserActivity Andrey Epin
Extract shortcut loading logic from ChooserActivity into a new class mostly as-is. Major changes: - run the logic on a background executor and deliver the result on the main thread; - replace dependencies from ChooserListAdapter with the data it provided. A number of tests thap previusly used ChooserListAdapter#addServiceResults to provide shortcut results into the view are updated and re-enabled. Test: manual tests Test: atest IntentResolverUnitTests Change-Id: Ia81cf9d0b0415fda1cfb53d45737a72f3fe540ff
2022-11-01Copy ResolverActivityTest to unbundled. Matt Casey
Bug: 208803748 Test: atest com.android.intentresolver.ResolverActivityTest Change-Id: I32cdf19b6748ed6cf9201c777a6aa80093644e5c
2022-09-23Fork framework chooser code to IntentResolver path Joshua Trask
This copies Chooser classes and (as needed) their transitive dependencies, while making minor mechanical changes to fix up references for the new package. This is a large CL, especially since we don't track the history of these files across projects (framework vs. "unbundled"), and the meaningful changes could easily get lost in the noise; reviewers should see accompanying notes at go/chooser-fork-cl. Test: locally re-enabled and ran UnbundledChooserActivityTest (as updated in this CL to match the framework version), then re-disabled before uploading. See notes for more info. Change-Id: I6708e3563d18a9e31894dd36dcd65e9a5815abcf
2022-01-19Initial (inherited) tests for unbundled chooser. Joshua Trask
This required disabling the #testEditImageLogs method in the base class (ag/16520095) due to what could be a legitimate failure in the unbundled implementation; we should investigate imminently. Note this only brings the tests up to parity with the system implementation - existing issues in the system ChooserActivityTest (e.g. b/211669337) will presumably still occur in the unbundled version. No test flakes are known to be specific to unbundling (among those that are enabled after ag/16520095). Bug: 202165481,211669337 Test: `atest UnbundledChooserActivityTest` Change-Id: If8e2b896627661e59fa4a85aa3dd1eedb8eb91bc
2021-11-08Preliminary "delegate chooser" unbundling. Joshua Trask
Migrate the "delegate chooser" activity from SysUI to the new Sharesheet (IntentResolver) package. Set up basic project structure, tests, etc. This CL involves a lot of unfamiliar boilerplate that I've tried to copy from neighboring projects. Please feel free to recommend additional reviewers for any complexities I may have overlooked. The rest of this CL description will detail: 1. Unbundling/"delegate chooser" background 2. Scope: what's included in this change 3. Scope: what's not included in this change 4. Key considerations for code reviewers [1. Unbundling/"delegate chooser" background] The "delegate chooser" activity will eventually replace the system `ChooserActivity` as the new "unbundled" Sharesheet implementation. In order to validate the new architecture, an earlier exploration added a "trampoline" chooser implementation in SysUI. This implementation presents no UI of its own, but instead handles the fulfillment of the user's selection from the system Sharesheet. In upcoming experiments, we expect to have the unbundled implementation replicate the original UI of the system `ChooserActivity` so that the new version can take over earlier in the flow, and ultimately replace the system implementation altogether. For more information, see go/sharesheet-unbundling. [2. Scope: what's included in this change] This CL replicates SysUI's "trampoline" delegate implementation into the newly-created directory for the unbundled module. The main purpose of this CL is to set up the basic boilerplate in that directory (owners, etc). I stopped at the first meaningful milestone that I could confirm worked correctly -- the unbundled unit tests pass with atest. Note that (other than the package names) the Java code itself is unchanged from the earlier SysUI implementation. [3. Scope: what's not included in this change] Before the longer-term improvements outlined in go/sharesheet-unbundling, there are a few fundamental unbundling steps that are remaining after this CL. They were omitted in this first pass since we already have a working milestone and intend to focus the current review on project/directory boilerplate. Specifically: A. There is no experiment that would cause users to exercise the new delegation path (b/202166034). If there are any issues with the implementation at this point, we wouldn't expect them to be visible to users. B. There may(?) be other steps required to integrate the new "unbundled" module into the Android build (e.g. makepush?). This CL is sufficient to run the unit tests in the new unbundled directory, but no manual testing was done to confirm the end-user behavior. C. This doesn't include any APEX boilerplate (manifests, keys). That may not be important yet since we don't have any immediate plans to launch as a mainline module, or it may come up as part of doing the integration work for (B). D. The old SysUI delegate implementation is left in tact, but should be cleaned up as we switch over to the new architecture. [4. Key considerations for code reviewers] This change is mostly boilerplate cribbed from neighboring projects. Following is a short list of decisions I made that could deserve a second look: A. The package name: com.android.intentresolver B. (omitted for lint, but this was resolved in a discussion with OSPO) C. The versioning scheme. I used a YYYY-MM versionName as in ExtServices, but for now just have versionCode="0" until we have a numeric scheme. D. AndroidManifest attributes, mostly copied from SysUI. E. SDK versions / "platform_apis" attribute. I had to try a few things to get this working. It seems OK now, but there may be a better/more elegant approach. If we do need to support specific earlier versions, we should confirm that those versions had the startActivityAsCaller API available. Either way, there's some cruft in this CL that should be cleaned up once we confirm the approach. Bug: 202164690, 202165476 Test: `atest IntentResolverUnitTests` Change-Id: If53eee98ac92685810bbb84feb9cb1030a161502