31 Commits

Author SHA1 Message Date
Jiyong Park
7be934f395 Define stubs_defaults for the new API surfaces
The new stubs_defaults shall be used to create stub libraries from
modules. The existing defaults
'framework-module-stubs-defaults-systemapi' is not enough because it
only captures the SystemApis with client=PRIVILEGED_APPS. Modules can
have broader SystemApis with client=MODULE_APPS and
client=MODULE_LIBRARIES.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: b/140202860
Test: m
Merged-In: I5f425928cf1db912ebe09499111a9925fcfc98fb
Change-Id: I5f425928cf1db912ebe09499111a9925fcfc98fb
(cherry picked from commit 2afff6cc73641dd11315e116f2f1f21ae4e64c56)
2020-01-13 21:34:50 +09:00
Anton Hansson
cfa5532127 Add SystemApi params to framework-module defaults
As was done in I3305b71e22970e80db95f3daf3d7713603c7d68d for
the other metalava args.

Exempt-From-Owner-Approval: cherry-pick internal

Bug: 140202860
Test: m
Merged-In: I397d361f649f179eada827782d82c002cc7fb2d3
Change-Id: I397d361f649f179eada827782d82c002cc7fb2d3
(cherry picked from commit 14c80cf363c6f657783969e64eef9c3a3619d753)
2020-01-13 21:34:16 +09:00
Jiyong Park
90247c8a1c Platform shouldn't directly link to jars in APEXes
The non-updatable part of the platform shouldn't directly link to the
boot jars in APEXes. Ensure this by

1) setting the visibility property for the boot jars so that they are
not visible to non-APEX modules and
2) setting the apex_available property so that the boot jars are only
built for the corresponding APEXes, but not for others.

Bug: b/146167933
Bug: b/146218515
Bug: b/147200698
Test: m
Change-Id: I251fabd773bc31f46d572d143c72dd9162f3f0a6
Merged-In: I251fabd773bc31f46d572d143c72dd9162f3f0a6
2020-01-10 15:15:24 +00:00
Anton Hansson
c176697552 Update references to sdkextensions cts
Renamed to SdkExtensionsTestCases.

Bug: 137191822
Test: atest --test-mapping frameworks/base/apex/sdkextensions
Change-Id: Idb544b2df013ccb88f6c4f0d590206e73661357a
2020-01-09 17:29:44 +00:00
Anton Hansson
fc33dde932 Add test apex for sdkextensions
Because the tests build for 64-bit but run on 32-bit, this
requires adding a variant of derive_sdk that uses prefer32.

This apex has an SDK level of 45, which is verified in the
test. Also trigger the e2e test on changes to the apex.

Bug: 137191822
Bug: 143937446
Test: atest sdkextensions_e2e_test
Test: m
Change-Id: I88a75b4f438004ed9425e6629666cbbae1ab0882
Merged-In: I88a75b4f438004ed9425e6629666cbbae1ab0882
(cherry picked from commit 0d2e2a076804ac40e78728914e9928c62b76cd99)
2020-01-08 14:18:35 +00:00
Anton Hansson
87743c6d55 Rename sdkext module to sdkextensions
It's a better name.

Bug: 137191822
Test: presubmit
Change-Id: Icc39779d49bf31f911f9f72bd7610e84c5f49466
Merged-In: Icc39779d49bf31f911f9f72bd7610e84c5f49466
(cherry picked from commit 5b97269cffa587d1c1d73163a9cabb0cc8c7ec05)
2020-01-08 11:42:58 +00:00
Paul Duffin
6bdaf90541 Switch from java_libs to java_header_libs for sdkext-sdk
The java_libs property is used to expose implementation libraries not
stubs libraries.

Test: m checkbuild
Bug: 146341462
Exempt-From-Owner-Approval: minor change and sole owner is ooo
Change-Id: I2714b65d4b81a9669831153280a29f93dbbf7a26
2019-12-31 15:36:47 +00:00
Anton Hansson
ba1cdfbe29 Add logging of what derive_sdk sees
Bug: 137191822
Test: adb reboot && adb logcat | grep derive_sdk
Change-Id: I121ec43bc788d155cad113d66d6982a58a3fe9bd
2019-12-20 15:52:08 +00:00
Anton Hansson
dc3e45c584 Merge "Give IAE for invalid sdk a message" 2019-12-17 18:37:27 +00:00
Anton Hansson
70aa04d409 Give IAE for invalid sdk a message
Easier to debug issues, probably.

Bug: 137191822
Test: SdkExtensionsTestApp
Change-Id: Iec7d03165e94b52ea48a73e4a1de9344de8d4301
2019-12-17 15:49:27 +00:00
Anton Hansson
630e3ac68d Merge "Re-submit "Add genrule for the current sdk proto"" 2019-12-17 11:10:56 +00:00
Anton Hansson
8e764c9042 Re-submit "Add genrule for the current sdk proto"
This reverts commit e15e6483f657dd3bba1f04e9b088c99d9a217a55,
but adds embedded_launcher: true, as well as a copy of sdk.proto
as a workaround.

...which should hopefully fix the python3-issues.

Test: m cur_sdkinfo
Change-Id: I58aff4e175bd44372e9e03e67439085f08ccdc5e
2019-12-16 18:44:39 +00:00
Anton Hansson
3ede866f2e Merge "Restrict visibility into the sdkext package" 2019-12-16 16:23:17 +00:00
Anton Hansson
4c1f4c2bc6 Merge "Add stubs and an sdk definition for sdkext" 2019-12-16 16:00:43 +00:00
Anton Hansson
d5a308938e Merge "Add stubs_defaults for framework modules" 2019-12-16 12:59:13 +00:00
Anton Hansson
2337daf1c5 Restrict visibility into the sdkext package
Only the stubs should be visible to the outside world. However,
the sources also need to be exposed for now.

Bug: 137191822
Test: m
Change-Id: Id051cc928c2c5050a6df6470e9ee221f178fd835
2019-12-16 11:55:04 +00:00
Anton Hansson
355000dc7b Add stubs and an sdk definition for sdkext
This defines both publicapi and a systemapi variants, even though
the publicapi is currently empty. Uses the newly defined module
stub_defaults.

Bug: 137191822
Test: m framework
Test: m sdkext-sdk
Change-Id: Idad8902054bef4a08953f4677689506566f146d8
2019-12-13 16:29:05 +00:00
Anton Hansson
24c88f43a9 Add stubs_defaults for framework modules
Add some reasonable defaults that can be reused instead of
duplicating the metalava args for every module.

Bug: 145998881
Test: followup CL depends on these
Change-Id: I31c37289ec38cfc9039a9b2c30b2f3396fc0a72c
2019-12-13 16:19:56 +00:00
Anton Hansson
d8ac5fa1b2 Use ro.build.version.extensions.r
The sdk_info prop is mostly there as a communication channel
if we need to channel more information in the future. For now,
using ro.build.version.extensions.r (which is "stable") is sufficient.

Bug: 137191822
Test: boot and getprop ro.build.version.extensions.r
Change-Id: I630c235fd98eaeda9086fa490914e56556b18706
2019-12-11 13:26:15 +00:00
Anton Hansson
3f19841dc2 Merge "Migrate sdkext tests to CTS" 2019-12-10 18:36:56 +00:00
Anton Hansson
370add0c6a Merge "Expose SdkExtension in the system SDK" 2019-12-10 17:43:38 +00:00
Anton Hansson
e15e6483f6 Revert "Add genrule for the current sdk proto"
This reverts commit 1911d7c1a27771dde909deeed5cc99e6a744e8ce.

Bug: 145882325
Test: treehugger
Change-Id: I94ca81c29ef967a489b1e3c34591134fa0bb0b35
2019-12-09 17:30:13 +00:00
Anton Hansson
099c082dfe Migrate sdkext tests to CTS
Bug: 143937446
Test: treehugger
Change-Id: I583952fdfe8f169c6839a6488837bf4fb964d5a7
2019-12-09 17:21:56 +00:00
Anton Hansson
b52bd1cbbe Expose SdkExtension in the system SDK
Also tweak the javadoc a little bit.

Bug: 137191822
Bug: 143937447
Test: treehugger
Change-Id: Iae1b025685344c2ffe4ed1089850b447c82a6b83
Merged-In: Iae1b025685344c2ffe4ed1089850b447c82a6b83
2019-12-09 17:21:24 +00:00
Anton Hansson
9ff695eee1 Add TEST_MAPPING
...and remove the broken test!

Bug: 137191822
Test: treehugger (hopefully!?)
Change-Id: I175c1262275ae95caabac32a5308fd454ae62a4d
2019-12-06 19:00:33 +00:00
Anton Hansson
ff172bbbc7 Add an init service for setting sdk props
Add a oneshot init service, to be triggered early in the boot.
This is unlikely to be the permanent solution, but allows us
to get off the ground by at least getting the prop set.

Bug: 137191822
Test: m com.android.sdkext
Test: boot && adb shell getprop | grep sdk_info
Change-Id: I253c56961289d1226f3a9a471e7b6ca047c52a4e
2019-12-05 18:27:53 +00:00
Anton Hansson
1911d7c1a2 Add genrule for the current sdk proto
This is intended to be added to all apexes exposing SDK apis. The
version can then be bumped by changing the value in a single place.
The current version is 0.

Also build this into the sdkext module.

Bug: 137191822
Test: m com.android.sdkext
Change-Id: Ic2cd92ad1d184c8a01f0bc3d4fc21deb588cb7e8
2019-12-05 16:28:32 +00:00
Anton Hansson
a82f161d33 Add derive_sdk binary for reading sdk protos
Put the lowest seen number in a persist sysprop.

Bug: 137191822
Test: manual ran derive_sdk on device with fake protos installed
Change-Id: Ic73d615d9d60769d237aa5a72dae2dfe56463007
2019-12-05 11:05:17 +00:00
Anton Hansson
4ec07fadef Add SdkExtensions class
It currently just reads a prop that is never set, but that will
be updated separately.

Keep the class @hide for now.

Bug: 137191822
Test: m com.android.sdkext
Change-Id: I1a874bf3d3e34676b5d767c4d03b09337b193cce
2019-12-02 15:32:39 +00:00
Anton Hansson
5559245baa Add apex build rule for com.android.sdkext
Bug: 137191822
Test: m com.android.sdkext
Change-Id: I8b349e7b4705f0d9d3f2125778e2c6b6d0638879
2019-12-02 14:24:54 +00:00
Anton Hansson
98460abc89 Add scaffolding for 'sdkext' module
This module will have a java framework part as well as a native
binary. Add directory and hook future java sources into the stub
rules.

Bug: 137191822
Test: m
Change-Id: I5527a055bf935178b88a1b20504b251f18f3d873
2019-12-02 13:56:06 +00:00