summaryrefslogtreecommitdiff
path: root/Android.bp
diff options
context:
space:
mode:
author Joshua Trask <joshtrask@google.com> 2021-11-01 17:12:57 -0400
committer Joshua Trask <joshtrask@google.com> 2021-11-08 16:57:03 -0500
commite514d3d9e02e35e2a9477e5d9c3e1274cce2546f (patch)
tree1f14c99c5d4bbe0feb6b6e453fd1f36a20a21b90 /Android.bp
parent7a6d7f4c217005c7a6b9b7e6f38b00258c530b11 (diff)
Preliminary "delegate chooser" unbundling.
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
Diffstat (limited to 'Android.bp')
-rw-r--r--Android.bp71
1 files changed, 71 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 00000000..41354b49
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,71 @@
+//
+// Copyright (C) 2021 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+package {
+ // See: http://go/android-license-faq
+ // This was chosen for Sharesheet to match existing packages.
+ default_applicable_licenses: ["packages_modules_IntentResolver_license"],
+}
+
+license {
+ name: "packages_modules_IntentResolver_license",
+ visibility: [":__subpackages__"],
+ license_kinds: [
+ "SPDX-license-identifier-Apache-2.0",
+ ],
+ license_text: [
+ "NOTICE",
+ ],
+}
+
+android_library {
+ name: "IntentResolver-core",
+ srcs: [
+ "java/src/**/*.java",
+ ],
+ min_sdk_version: "18",
+ resource_dirs: [
+ "java/res",
+ ],
+
+ manifest: "AndroidManifest.xml",
+
+ static_libs: [
+ "androidx.annotation_annotation",
+ ],
+
+ plugins: ["java_api_finder"],
+ lint: {
+ strict_updatability_linting: true,
+ },
+}
+
+android_app {
+ name: "IntentResolver",
+ min_sdk_version: "18",
+ certificate: "platform",
+ privileged: true,
+ srcs: ["src/**/*.java"],
+ platform_apis: true,
+ static_libs: [
+ "IntentResolver-core",
+ ],
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.intentresolver",
+ "test_com.android.intentresolver",
+ ],
+}