Commit Graph

138 Commits

Author SHA1 Message Date
Colin Cross
4ea5318b7f Use stub-annotations to provide NonNull for hwbinder-stubs-docs
The annotations in srcs aren't doing anything because they are all
@hide.  The only thing keeping hwbinder-stubs-docs compiling is
a hack in metalava that treats anything with
hwbinder-stubs-docs-stubs.srcjar.rsp in its input files as
effectively having annotations_enabled: false.

Remove the unnecessry srcs, and add stub-annotations, which contains
a stub definition for android.annotation.NonNull, to hwbinder.stubs.
None of the rest of the annotations in srcs are used in the
generated stubs.

Test: m hwbinder.stubs
Change-Id: I7ec9afb41ea9617f25d1dffd3382fed90997b751
2021-03-15 17:55:19 -07:00
Remi NGUYEN VAN
c15d99e6ff Split out the connectivity API surface
Split out connectivity APIs to connectivity module directories. This
prepares future move of the connectivity code into a mainline module,
but still keeps it implemented by framework-minus-apex for now: the API
stubs are moved to framework-connectivity.stubs, but the implementation
on device remains in the same place.

This allows moving the connectivity code in/out of APEX with minimal
changes.

BYPASS_INCLUSIVE_LANGUAGE_REASON=Moving files, can't modify released API

Bug: 171540887
Test: device boots, connectivity working

Merged-In: I21c42f032efa6c10e36c749df3183ce9679303a7
(cherry-pick from internal branch with API files conflicts)

Change-Id: I21c42f032efa6c10e36c749df3183ce9679303a7
2021-02-26 19:23:25 +09:00
Yan Yan
f8b973c3f6 Add IKE stub to main Android SDK
This CL is required for converting IKE from a shared library to
a jar in the boot classpath.

Bug: 177266501
Test: build, flash, boot
Change-Id: I10759d22eaba4861b7d7f283b551156f09f54675
Merged-In: I10759d22eaba4861b7d7f283b551156f09f54675
2021-02-09 17:23:55 -08:00
Anton Hansson
b7d532e4c8 Temporarily add IKE to non-updatable stubs build
...in order to be able to resolve IKE classes. Note that this can be
removed once the prebuilt stub in prebuilts/sdk contains IKE, which
can be achieved with a new import after this CL is submitted:
I10759d22eaba4861b7d7f283b551156f09f54675

Bug: 177266501
Test: m
Change-Id: I7229b1486e7170acca5da8f1b7874e5eaaecb1db
2021-02-05 11:40:25 +00:00
Anton Hansson
ce21e28bfc Update references to prebuilt sdks to use "current"
This facilities easier updating when new classes get added.

Bug: 177266501
Test: m
Change-Id: I85b3832681f0455093d2a33ace7dbc1028a1a5ff
2021-02-05 11:38:30 +00:00
Anton Hansson
ce55623107 Switch to new incompatibilities targets
The previous incompatibilities genrule targets have been replaced
by targets auto-generated by prebuilt_sdks.

The intentention of this change is to eventually have per-jar file
incompatibilities tracking, but this change does not change the
underlying file used, only switching to the new target.

Bug: 178171189
Test: m
Change-Id: Ib5a2be7d53e3576d92db4c843f1fca829b9bfc6d
2021-01-25 12:34:00 +00:00
Anton Hansson
85785fec8a Dist more API txt files
Add disting of the following for the sdk:
- android-non-updatable.txt
- android-non-updatable-removed.txt
- removed.txt

Bug: 158544979
Test: m sdk dist && inspect out/dist/apistubs
Change-Id: I5f628f4fcfc13f67105ee3b2760274e900fc1e34
2021-01-20 20:23:34 +00:00
Anton Hansson
fc948d8675 Unbundle ART API from android-non-updatable
Stop tracking the ART APIs in the non-updatable current.txt, and
instead add in the txt/srcjar/jar files produced by the art module's
java_sdk_library.

Bug: 173606718
Test: manual last_released check of merged api txt (b/174847574 to
      automate)
Change-Id: I446a381f2b364a114ce391b99a13742d6769f14d
2020-12-23 14:51:17 +00:00
Anton Hansson
f435d200b7 Remove two unused libraries
These were used temporarily before merged stubs were ready,
but they are not used anymore.

Test: m
Change-Id: I517f64353749ffd8d92b8ddbc1dd8b7af75f2176
2020-12-23 14:50:11 +00:00
Anton Hansson
121ccbcfee Stop ignoring classes on the classpath for stubs
We're working on moving the libcore classes away from srcs and into the
classpath, and ignoring classes on the classpath will cause incorrect
API signatures once that happens (several libcore classes appear in
public API signatures).

Keep the docs building in the same way they were before. They will be
addressed in separate CLs.

Bug: 173606718
Test: m checkapi
Change-Id: I471327c3657662d7a093e9baa2fb6e08d640f895
2020-12-21 10:46:53 +00:00
Paul Duffin
5a4e8f234d Unbundle i18n API from android-non-updatable
This removes the i18n source from the non-updatable stubs which removes
them from the frameworks/base/core/api files too. The API is still
protected by both the build and Gerrit review as the API is specified
in the external/icu/android_icu4j/api/public/ directory.

The i18n stubs source is used instead of the implementation source for
generating the JavaDoc. That revealed a minor issue with metalava which
is fixed in this topic.

The i18n stubs library was statically included alongside the conscrypt
stubs library so it will still appear in the monolothic android.jar.

Bug: 174344410
Test: m offline-sdk-docs
      - check that i18n classes are present
      m android_stubs_current android_system_stubs_current android_test_stubs_current
      - check that i18n classes are present in each jar
      m droid
Change-Id: I744c8bac54a8a5518ca0eca2a7700abbfa0997f4
2020-12-10 11:23:19 +00:00
Jayachandran C
0f14f81d7c Add indication APIs to expose QOS from LTE and NR bearers
Add indication APIs to expose Quality Of Service (QOS) information
from LTE and NR default as well as dedicated bearers. The QOS is
added to the existing SetupDataCallResult structure so that the
baseband can notify whenever there is a change in QoS on a PDN.

Bug: 158315614
Test: 1) Simulated V1_6 SetupDataCallResult and verified the Qos objects
         are passed correctly in the APIs
      2) atest frameworks/opt/telephony/tests/telephonytests/

Merged-In: I29b13975288286d9706a1c3fb227eeb46527efc3
Change-Id: I29b13975288286d9706a1c3fb227eeb46527efc3
2020-12-04 03:24:39 +00:00
Treehugger Robot
0206a453f1 Merge "Fix disting of android_system.jar" 2020-11-18 20:40:43 +00:00
Anton Hansson
c3002e5ec4 Fix disting of android_system.jar
The change I41b38d4828f8dc5d90dbb3ae59462812b8c036f2 accidentally
started disting the public android.jar to the path where the system
android.jar is expected.

Move the dist rules from the public stubs to the system stubs where
they belong.

Bug: 172937217
Test: m sdk dist && \
      zipinfo out/dist/apistubs/android/system/android.jar | \
      fgrep telecom/Phone.class
Change-Id: If20cb4ec32e1eb631a824ecc180d33c5088ff7c8
2020-11-18 18:37:34 +00:00
Anton Hansson
1c58ffce6c Cleanup in StubLibraries.bp
- Merge the "full" defaults into the "base" defaults (base wasn't used)
- Reword some comments
- Fix double mention of priv_apps @SystemApi annotation in a droidstub

Test: m checkapi
Change-Id: Ide93b0f6076fec733f5a01b7fccbf280d5a8d0f6
Merged-In: Ide93b0f6076fec733f5a01b7fccbf280d5a8d0f6
2020-11-17 19:07:36 +00:00
Anton Hansson
51861e70e5 Remove api-stubs-docs
Remove the build rule for updating api/current.txt and other files,
which makes it easier to remove the txt files themselves.

Bug: 171029603
Test: m nothing
Change-Id: I987fd9f6075d0f7c6817f16bf7282c6239afb7db
2020-11-13 11:31:36 +00:00
Anton Hansson
5426f50028 Remove the system-api-stubs-docs target
Nothing consumes the output of this module anymore. The txt files
themselves will be removed in a follow-up change (it is easier after
this build rule stops them changing all the time).

Bug: 171029603
Test: m checkapi with txts removed
Change-Id: Iac487dd6c62504b33cf4e372ba4a7cf9808bf5fc
2020-11-11 16:32:53 +00:00
Anton Hansson
552ba2c492 Move testapi API files for symmetry with others
The other non-updatable API files are in core/api/*. Also add
-non-updatable to the module to match the others.

Bug: 171029603
Test: m checkapi
Change-Id: I2bd1fa5bac6b35096b3059f93d68ef24b7a464e5
Merged-In: I2bd1fa5bac6b35096b3059f93d68ef24b7a464e5
(cherry picked from commit 3a1b1bd620454dd1d5b328c98634a567865cd55e)
2020-11-05 14:04:24 +00:00
Anton Hansson
3a8e03610b Remove unused monolithic jars
Nothing depends on these. They were only here for easy comparison
with the merged variant while we ironed out diffs.

Rename the merged variants instead of having duplicate compilation
rules.

Bug: 171029603
Test: m nothing
Change-Id: I7859589b93b861439fb1b7de084e52294da53671
Merged-In: I7859589b93b861439fb1b7de084e52294da53671
2020-11-03 19:38:55 +00:00
Anton Hansson
533fb47c7e Dist merged jar instead of monolithic one
The monolithic ones are being deleted in a follow-up CL.

Bug: 158465496
Test: m sdk dist
Change-Id: I41b38d4828f8dc5d90dbb3ae59462812b8c036f2
2020-11-03 19:33:50 +00:00
Anton Hansson
ad2bb796b0 Merge "Move non-updatable-api/ to core/api/" 2020-10-30 15:22:45 +00:00
Anton Hansson
7bfceb87e1 Move non-updatable-api/ to core/api/
This achieves two things:
- it's been noted that non-updatable-api is a confusing term as it has
  to be updated every time the API changes
- the api-review logic trigers on txt files in subdirs named 'api',
  which non-updatable-api does not trigger on

I will (less urgently) try to get rid of the term "non-updatable" from
other places too, perhaps going for "non-module" or "core" as a
replacement.

Bug: 171029603
Test: m checkapi
Change-Id: I843efb4880b6caaf3872e9b0918fd710fb93d979
Merged-In: I843efb4880b6caaf3872e9b0918fd710fb93d979
2020-10-29 18:59:10 +00:00
Anton Hansson
43cc8bf55c Remove the module-lib-api target
This target existed just to track the "full" module lib API surface,
until the individual pieces had the same standards. However, now:
- the full current.txt file is available as a build target
- all the individual .txt files are API reviewed, checked against
last api, linted, and changes result on API council bug updates

The .txt files will be removed in a separate CL.

Bug: 171029603
Test: m checkapi
Change-Id: Ib8ec547871045f77fb73aa82f192b5a7767d0c33
2020-10-29 18:56:10 +00:00
Anton Hansson
3514689f05 Annotate large droidstubs modules high_mem
Previously all droidstubs modules were classified as highmem. Annotate
only the huge modules as such, to allow more parallelization of lowmem
droidstubs modules.

Bug: 170701554
Test: NINJA_HIGHMEM_NUM_JOBS=3 m checkapi
Change-Id: I83ae88222110d7afe4009076e951c88a5188ca83
2020-10-26 11:38:44 +00:00
Anton Hansson
7110ae7a28 Remove module source code from test-api-stubs-docs
This makes it impossible to add new @TestApi in modules, of which
there are none right now and we don't want any going forwards, either.

Bug: 170395679
Test: m test-api-stubs-docs-check-current-api
Change-Id: I527ca7b580350372bee72b65f6596a46eab2ce04
Merged-In: I527ca7b580350372bee72b65f6596a46eab2ce04
2020-10-15 18:38:33 +01:00
Anton Hansson
ae26decc8e Merge "Have test_current be a union of system and test APIs" 2020-10-14 14:43:03 +00:00
Anton Hansson
03b48e3fbe Remove removed-dex-api generation
Nothing uses these outputs anymore. The compat tools have been
migrated to use a new file in I082d18fc2b8a57ea8c5941d5c955a7970ab9d860.

Bug: 158465496
Test: presubmit
Change-Id: I51a1f3f5e43092f5431358d705379cc33b60b835
2020-10-13 09:38:44 +01:00
Anton Hansson
84ffba267e Have test_current be a union of system and test APIs
Include @SystemApi APIs in the test_current stub jar, while keeping
the @TestApi and @SystemApi API txt files tracked separately.

A side-effect of this change is that string constants of @SystemApi
permissions are no longer inlined in the test api tracking, possibly
because metalava was previously incorrectly peeking at @SystemApi
whereas it is now explicitly forbidden to do so. I don't believe the
API txt change has any practical effects.

Bug: 129133308
Test: presubmit
Change-Id: I23d3c88624ee7599485c3390a0440b78bc18a0a2
Merged-In: I23d3c88624ee7599485c3390a0440b78bc18a0a2
2020-10-13 08:25:03 +01:00
Anton Hansson
374c51141a Remove jdiff_enabled from platform metalava runs
The official API differences report is not produced from the
artifacts this rule creates, but by manually running metalava
with the right txt files.

As there are no other known users of these jdiff files, remove them
for now.

Bug: 158465496
Test: m
Change-Id: Iee9dd1a5d5543f3f629e3631c8224e6bfe4dddcb
2020-10-12 18:49:44 +01:00
Anton Hansson
99398da506 Merge "Move the dist rules from monolithic to merged rules" 2020-10-12 10:45:13 +00:00
Anton Hansson
ae4332dc69 Move the dist rules from monolithic to merged rules
These API tracking files are identical except for 2 inlined permission
constants in the public API, which do not matter.

```
@@ -31606 +31606 @@
-    method @Deprecated @RequiresPermission(anyOf={"android.permission.NETWORK_SETTINGS", "android.permission.NETWORK_SETUP_WIZARD"}) public java.util.List<android.net.wifi.hotspot2.PasspointConfiguration> getPasspointConfigurations();
+    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_SETUP_WIZARD}) public java.util.List<android.net.wifi.hotspot2.PasspointConfiguration> getPasspointConfigurations();
@@ -31634 +31634 @@
-    method @Deprecated @RequiresPermission(anyOf={"android.permission.NETWORK_SETTINGS", "android.permission.NETWORK_CARRIER_PROVISIONING"}) public void removePasspointConfiguration(String);
+    method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.NETWORK_SETTINGS, android.Manifest.permission.NETWORK_CARRIER_PROVISIONING}) public void removePasspointConfiguration(String);
```

Bug: 158465496
Test: lunch sdk_phone_armv7 ; m sdk dist ; diff artifacts
Change-Id: Ibde9310bb1f5c0921962c022e158a861b233f6d1
2020-10-09 14:45:24 +01:00
Anton Hansson
c3ef1f564f Add last_released checking for module-lib API too
I missed this in If608be48276f0a7f76afd714656267ed379ce062, which added
last_released tracking to the other *-non-updatable APIs. See that
change for more context.

Bug: 170105267
Test: m checkapi
Change-Id: I32d09c7fc155c04295dc16028a568e3381c09e4b
2020-10-07 14:57:40 +01:00
Anton Hansson
a474d0e92f Merge "Add last_released checking for non-updatable API" 2020-10-05 18:41:06 +00:00
Anton Hansson
3258a479d3 Add last_released checking for non-updatable API
This makes the build fail when APIs are removed from the (non-updatable)
framework.jar, and e.g. into a module. This is in general not safe, so
is a reasonable default. When it needs overriding (when e.g. creating
now modules), incompatibilities.txt can be used for that.

Bug: 170105267
Test: m checkapi
Change-Id: If608be48276f0a7f76afd714656267ed379ce062
Merged-In: If608be48276f0a7f76afd714656267ed379ce062
2020-10-05 16:23:27 +01:00
Treehugger Robot
68d17855ea Merge "Build stub libraries with smaller deps" 2020-10-05 11:17:01 +00:00
Jiyong Park
c0f8a28e54 Build stub libraries with smaller deps
The stub libraries had a dependency to framework-internal-util which is
a collection of java static libraries whose source code is
auto-genmerated (e.g. via protoc, aidl, etc.)

The library was added as a dependency because some Java files that are
fed into the metalava for the stub code generation have references to
some of the auto-generated symbols. However, this is more than
necessary. Furthermore, that setup will create a circular dependency
when framework-internal-utils (or its transitive dependencies) have a
dependency to the stub libraries due to 'sdk_version' setting.

Fixing the problem by replacing the dependency to
framework-internal-util with a few number of libraries.

Bug: 169618843
Test: m
Change-Id: I30c953ed220e84ab295548845fff0b26e3c060b6
2020-10-05 18:30:33 +09:00
Paul Duffin
404b26a761 Use ART stubs source generated by java_sdk_library
Bug: 168301990
Test: Built offline-sdk-docs with and without the change and
      diffed them. There were some changes other than the timestamp.js
      file. With these changes classes that implemented the
      Object.equals(Object) method had some extra documentation that
      explained that the parameter could be null. The reason for this
      change is that the stubs generated with this change includes
      android.annotation.Nullable whereas previously they included
      androidx.annotation.Nullable. The change is a very minor
      improvement over what is currently uploaded to
      developer.android.com/reference so not worth backporting.
      Diffed api/public/current.txt against
      frameworks/base/api/current.txt and made sure that the latter was
      a superset of the former and there were no differences in the area
      that overlapped.
Change-Id: I3767948b4659b18b813c8eed66258af98ac4a241
2020-09-28 19:50:24 +01:00
Anton Hansson
fcb91d4ad0 Move api/*current.txt filegroups into api dir
The StubLibraries bp file is sufficiently humongous without them.

Bug: 169034951
Test: presubmit
Change-Id: I2809f94f950cdebb6c1fbf8de091e9d9443810d6
2020-09-21 17:03:14 +01:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Anton Hansson
bb7674fad3 Merge "Compose the main stubs jars from module stubs" 2020-08-18 15:18:07 +00:00
Anton Hansson
912622f711 Compose the main stubs jars from module stubs
This adds stub generation for the non-updatable part of the platform,
and changes the full stub jars to be a combination of multiple jars:
the stubs of the updatable modules and the stubs of the remaining part
of the platform.

Composing the stub jars like this allows overriding the individual parts
with prebuilts rather than building everything from source. This makes
the build safer, as we can make sure that the stub of the apex that is
used is also what is used to build the rest of the platform against.

The monolithic droidstubs rules remain for now, as it has other
functions than generating stub sources (api lint, current.txt,
checklast). It remains a goal to get rid of this, but by submitting this
CL first it can be done in steps.

Bug: 144149403
Test: m android{,_system}_{monolith,merged}_stubs_current
Test: m
Change-Id: I255486112c03f237aa342cfb93f3b473a2f50470
Merged-In: I255486112c03f237aa342cfb93f3b473a2f50470
(cherry picked from commit 3c1b15a3dea5486b57d3bf1d60a7b7170494274e)
2020-08-17 17:02:47 +01:00
Anton Hansson
cf42e98eef Make framework-res dep in stubs explicit
The android.jar stubs includes the resource from framework-res. This
dependency was previously added implicitly inside the build system, but
using a java_genrule we can add it directly, which makes it easier to
make changes to this rule.

This change has the side-effect of adding the resources to some stubs
that did not previously include the resources (e.g. module-libs), which
I think is desired.

Bug: 161214753
Test: build sdk, diff out/dist before and after (shows resources added
      to some stubs)
Change-Id: I1829789af207cc45c49c0c68369fc7c0c085bcb0
Merged-In: I1829789af207cc45c49c0c68369fc7c0c085bcb0
2020-08-17 12:05:51 +01:00
Anton Hansson
a920550096 Add bp-based disting of android stubs
This used to be done in Make, but with bp-based dist now supporting
tags we can convert these java_library { hostdex: true } libraries
to dist their classes.jar rather than dex jar.

Bug: 161214753
Test: diff results of `m sdk dist`
Merged-In: Id54507e297b5c57d1ce58f14eb347e7661a5328d
Change-Id: Id54507e297b5c57d1ce58f14eb347e7661a5328d
2020-07-22 16:20:46 +00:00
Makoto Onuki
10d116d1ec Merge "Merge module-lib-api-stubs-docs and -non-updatable" am: def1e68ead am: 2f20e9afe7
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1363799

Change-Id: I17cb9dc98f6b8299871a82bd29be8bdf78effbfc
2020-07-16 16:55:57 +00:00
Makoto Onuki
8c61de6ddf Merge module-lib-api-stubs-docs and -non-updatable
Test: build / treehugger
Bug: 146727827
Merged-in: I9e8038b3899270ada12ed4cc057aeace2a36902d
Change-Id: I9e8038b3899270ada12ed4cc057aeace2a36902d
2020-07-16 15:12:05 +00:00
Makoto Onuki
a553a497fd Merge "Proper API hierarchy between MODULE_LIBS and PRIV_APPS system APIs" am: 06b1ba180d am: 1e085a1db4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1360884

Change-Id: Ie45f32b2d46c8ac989a4a9242017eb4c2b73484b
2020-07-15 16:00:22 +00:00
Makoto Onuki
a13287f573 Proper API hierarchy between MODULE_LIBS and PRIV_APPS system APIs
Test: build / treehugger
Bug: 146727827
Exempt-From-Owner-Approval: Cherry-picking from goog/master to aosp/master
Merged-in: Ie1ad6711c490c679ebcfacd97154380a8810ba1c
Change-Id: Ie1ad6711c490c679ebcfacd97154380a8810ba1c
2020-07-15 01:36:38 +00:00
Ramy Medhat
6282833dad Merge "Revert "Enable metalava sandbox in StubLibraries.bp and ApiDocs.bp."" am: 98acc8b4ab am: e487a02166
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1345260

Change-Id: If587bdab312770b4d00a9a83ab477c5f5320a1d8
2020-06-21 01:48:34 +00:00
Ramy Medhat
602016c7db Revert "Enable metalava sandbox in StubLibraries.bp and ApiDocs.bp."
Reason for revert: breaking several builds downstream
Reverted Changes:
Ia5767debc:Enable metalava sandbox in StubLibraries.bp and Ap...
I7256d29f1:Add sandbox property to the javadoc rule.
Ia69440800:Only report a violation when the file exists.

Change-Id: I5651212314fd39b7ba404936dee416f566c682c9
2020-06-20 13:02:35 +00:00
Ramy Medhat
cc8fce1964 Merge "Enable metalava sandbox in StubLibraries.bp and ApiDocs.bp." am: fbb36c8bd8 am: a15550216a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1335073

Change-Id: Id4896589995ff827f6c5cc10058f340a01b642d2
2020-06-20 01:58:49 +00:00