Generating hidden API lists has grown in complexity and the original
Makefile rule has become a bottleneck for build times. Rewrite the
logic in Python.
Bug: 113278235
Bug: 73736106
Test: frameworks/base/tools/hiddenapi/generate_hiddenapi_lists_test.py
Change-Id: I63f03133d70260d06c55f482b844a4980dc6f734
Whitelist used to be the same as all entries in API stubs. This is no
longer true as libcore will generate hidden bridge methods which are
supposed to be whitelisted. CL in build/make calls class2greylist on
each boot classpath module to dump their list and this patch creates
a build rule for the new whitelist.
Bug: 112186571
Test: m appcompat, diff public-list.txt whitelist.txt
Change-Id: I7b3957ea9ed8bebb483609d94b1e6f169f4379dd
The `hiddenapi` build tool has been extended to provide a full list
of non-SDK APIs in an effort to remove dependency on Doclava.
This patch changes the build rules generating non-SDK API lists to
start using hiddenapi's list instead of Doclava's.
Consequences:
(a) some greylist entries change signature (fixing Doclava varargs bug)
(b) cloned public fields are now whitelisted (b/79432238)
(c) new APIs need to be greylisted because they are used by apps
Bug: 79432238
Bug: 79409988
Bug: 76424618
Test: phone boots
Merged-In: I681c1e97d0929cfb1d357b2243ecb210d18f9e87
Change-Id: I681c1e97d0929cfb1d357b2243ecb210d18f9e87
(cherry picked from commit b59c36f51c3c4b7595718f325b38c11352237b2b)
Since support libraries have been migrated to Soong, these docs modules
currently are ready to be supported in Soong.
Bug: b/70351683
Test: m -j offline-sdk-docs
Change-Id: I8739d94909c7cc830c30fa3d1047d26761cc5076
Merged-In: I8739d94909c7cc830c30fa3d1047d26761cc5076
With annotations for greylist entries, each java target generates it own
greylist.txt file. Merge all of these into the final greylist.txt.
Bug: 110868826
Test: m
Change-Id: I6a64c65000f1fd9f49e09b5b498bdccc3560d606
If we add a new sdk library starting with android, there is a build
error because of the wrong "since" argument. So we have to change to
android.txt and android.xml instead of android.* in since-arg.
Bug: 77577799
Test: Verified variable is the same before & after.
Change-Id: I3016181a97e565ebba67c1828d76ddf9a7d6f860
The dark greylist is meant to contain non-SDK APIs which are "related"
to APIs accessible to apps without restrictions. The list used to be
built as all non-SDK APIs in the same package as those on the light
greylist. That is not sufficient and should include the public SDK API
packages too.
This patch modifies the makefile to generate a list of public API DEX
signatures with Doclava and then use that as a basis for the dark
greylist generation.
Bug: 80461842
Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt
Change-Id: I4b1588013f26661207126b4006cdef0a0fc8ae2c
Dark greylist has so far been populated with the remaining class
members of classes listed on the light greylist. This patch changes
the rule to include all remaining classes and class members in the
same package (sub-packages not included).
Bug: 64382372
Test: make -j64 out/target/common/obj/PACKAGING/hiddenapi-dark-greylist.txt
Change-Id: Icf3f60f1e776f092103c612fc3995ce0e66617ea
Merged-In: Icf3f60f1e776f092103c612fc3995ce0e66617ea
(cherry picked from commit 4c3c03129ba95dccab30ba7579dc91b97843271f)
Dark greylist has so far been populated with the remaining class
members of classes listed on the light greylist. This patch changes
the rule to include all remaining classes and class members in the
same package (sub-packages not included).
Bug: 64382372
Test: make -j64 out/target/common/obj/PACKAGING/hiddenapi-dark-greylist.txt
Change-Id: Icf3f60f1e776f092103c612fc3995ce0e66617ea
Previous CL introduced the concept of populating the dark greylist
with remaining members of classes on the light greylist. This breaks
the assumption that some methods/fields will always remain blacklisted.
Introduce a new file which forces their blacklisting and adjust the
build rules accordingly.
Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt
Merged-In: I8b20e03c50f4027a24d2a6081bedb08bc8a34011
Change-Id: I8b20e03c50f4027a24d2a6081bedb08bc8a34011
(cherry picked from commit 4b34f79a35a6602962ed1df1accd9d6ea6e41e77)
This patch will iterate over all classes in the light greylist and
add the remaining (currently blacklisted) class members into the
dark greylist. This is meant to mitigate the impact of the feature
on legacy apps, in case their hidden API uses have not been detected
by our analyses. The dark greylist entries will be available to apps
targeting pre-P SDK versions, but blocked for apps targeting P or later.
Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-dark-greylist.txt
Merged-In: Id1ef4ab523b3b4d1333b5fbf2b3e6622ef2be607
Change-Id: Id1ef4ab523b3b4d1333b5fbf2b3e6622ef2be607
(cherry picked from commit 185f00e6677cea3fb135648f4a19d22dec54bbb5)
The build rules were getting messy and too difficult to extend.
Extract assertions into own functions, create shared variables.
Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt
Merged-In: Ie34adb8b5349b30daa2e9e4976d285f6d9711f0e
Change-Id: Ie34adb8b5349b30daa2e9e4976d285f6d9711f0e
(cherry picked from commit 721bc8e6a8b1350c62b4a570f523541d1ce1124a)
Previous CL introduced the concept of populating the dark greylist
with remaining members of classes on the light greylist. This breaks
the assumption that some methods/fields will always remain blacklisted.
Introduce a new file which forces their blacklisting and adjust the
build rules accordingly.
Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt
Change-Id: I8b20e03c50f4027a24d2a6081bedb08bc8a34011
This patch will iterate over all classes in the light greylist and
add the remaining (currently blacklisted) class members into the
dark greylist. This is meant to mitigate the impact of the feature
on legacy apps, in case their hidden API uses have not been detected
by our analyses. The dark greylist entries will be available to apps
targeting pre-P SDK versions, but blocked for apps targeting P or later.
Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-dark-greylist.txt
Change-Id: Id1ef4ab523b3b4d1333b5fbf2b3e6622ef2be607
The build rules were getting messy and too difficult to extend.
Extract assertions into own functions, create shared variables.
Bug: 64382372
Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt
Change-Id: Ie34adb8b5349b30daa2e9e4976d285f6d9711f0e
The CL copies the build rule for hidden API lists from the internal
tree to AOSP. This is not a cherry-pick but it will make the rules
the same in all the branches. As a result, the blacklist becomes
enabled in AOSP.
Test: make
Merged-In: I8757a66bf625388e6f6419714ef5bba7af5d93ea
Change-Id: I567c10dc8e833aa0a6775ab91f2ce9553b0dd8df
Create an empty file in the build rule instead. Do not merged this
beyond AOSP. We have an implicitly built blacklist everywhere else.
Bug: 64382372
Test: make
Change-Id: I4e13e5daf635934a152d389a95bf45c482b5a87f
Merged-In: Ifa912f8751025b7de24a982a1a227a9c27d18267
Add a new Makefile rule 'hiddenapi-b-blacklist' which takes the
manually published hiddenapi-p-light-greylist.txt and subtracts it
from private-dex.txt built for the current branch. This is meant to
provide an approximation of the blacklist in internal branches.
Bug: 64382372
Test: make hiddenapi-aosp-blacklist
Change-Id: I528a70cc6a71e988b53d94ca7ef81d6c181e5153
Internal master tree is still invoking Doclava with a Makefile build
rule for hidden API, while the remaining Doclava rules have been
migrated to Soong. Do the same for hidden API.
Test: make out/soong/.intermediates/frameworks/base/hiddenapi-lists/android_common/private-dex.txt
Merged-In: Ifa912f8751025b7de24a982a1a227a9c27d18267
Change-Id: Ifa912f8751025b7de24a982a1a227a9c27d18267
(cherry picked from commit 4f9d4d566c6022f18c245380a2f6cd51957ac12a)
@removed APIs are not part of the public SDK but we do not want
to block access to them. Use the recently added removed-dex.txt
list of @removed API signatures and merge it into the hidden API
light greylist programmatically.
Note that due to Doclava's rule precedence, @removed APIs which
override a public SDK method are considered public and are
whitelisted. We have to intersect removed-dex.txt with private-dex.txt
to satisfy the rule that light greylist is a subset of private-dex.txt.
Bug: 78182899
Test: make out/target/common/obj/PACKAGING/removed-dex.txt
Change-Id: I44e54c405fc667d54a990b9ded1de8456802545e
CL Iba8869ce6e4f401a8e420ad83ab459d25bbbaae0 added Doclava support
to generate a list of @removed API. Add a rule which builds that
list.
Bug: 78182899
Test: make out/target/common/obj/PACKAGING/removed-dex.txt
Merged-In: Ifa912f8751025b7de24a982a1a227a9c27d18267
Merged-In: I80860c2b9f7213db65d0a9ca65bd645187aa0ce0
Change-Id: I688c14e0d2fbfafe9ac212e6abdc3593cb744ef9
Also remove some duplicated code between public api and
system, by making a new make macro.
Paths before:
frameworks/base/../../prebuilts/sdk/api/28
frameworks/base/../../prebuilts/sdk/system-api/28
Paths after:
prebuilts/sdk/28/public/api/android
prebuilts/sdk/28/system/api/android
Test: make offline-sdk-referenceonly-diff
Test: make offline-system-sdk-referenceonly-diff
Bug: 77525052
Change-Id: I54989816ea09ad7a1e2f2355926678e6d2edb27c
This directory is going away. Migrate to the new paths, and replace the
long list of "since" arguments with a loop in the makefile. Also fix the
soong buildfile to use the new path and the 28 prebuilts.
This removes the need to update it every time an API is finalized (in make,
I don't know how to make loops in soong).
Bug: 77525052
Test: Verified variable is the same before & after, except for path change
Change-Id: I1d4e87e7840e979b83779a2aefe176e7c1ed1527
Merged-In: I1d4e87e7840e979b83779a2aefe176e7c1ed1527
This directory is going away. Migrate to the new paths, and replace the
long list of "since" arguments with a loop in the makefile. Also fix the
soong buildfile to use the new path and the 28 prebuilts.
This removes the need to update it every time an API is finalized (in make,
I don't know how to make loops in soong).
Bug: 77525052
Test: Verified variable is the same before & after, except for path change
Change-Id: I1d4e87e7840e979b83779a2aefe176e7c1ed1527
I'm replacing this list with a for-loop in master, so it shouldn't need
updating in future (except for temporary apis).
Bug: 77588754
Test: make docs
Change-Id: Ib48218e303b53e2b16a13866e4423ee2ad1c2f4a
APIs which have not been explicitly greylisted have so far been put
on the dark greylist. This patch changes the default to blacklist and
therefore enables strict enforcement.
This reverts commit f712b23d56226c788f7892a984fb9abe6f5144c2.
Bug: 64382372
Test: make
Change-Id: I1608b1adbe5dcafd13335691ddeb94abbb2c6e71
This patch adds a build-time rule that adds all members with signatures:
readObject(Ljava/io/ObjectInputStream;)V
readObjectNoData()V
readResolve()Ljava/lang/Object;
serialVersionUID:J
serialPersistentFields:[Ljava/io/ObjectStreamField
writeObject(Ljava/io/ObjectOutputStream;)V
writeReplace()Ljava/lang/Object;
to the hidden API light greylist. This is needed so that apps can retain
the ability to write their own serializers.
Bug: 64382372
Bug: 73255398
Test: make
Change-Id: I0103f47044e957bbff0a39230ff53562f3feddac
This reverts commit 16bfa11b73a34be1f1c72d2ffe86702f85378e92.
Reason for revert: Revert until b/76138670 is fixed
Bug: 64382372
Bug: 76138670
Bug: 76157445
Change-Id: Iaf6c76b773fbea4d4710b38808dee2e7e06f5e78
Remove old droiddoc targets for api-stubs, system-api-stubs, and test-api-stubs.
And also set api_tag_name, api_filename, private_api_filename, and etc.
properties in Android.bp for new droiddoc.
Test: manually compare if dependencies change after Soong based droiddoc runs.
Bug: b/70351683
Change-Id: I8d944c83de120ec8148276adc1c9872113d9d29b
Merged-In: I8d944c83de120ec8148276adc1c9872113d9d29b
Remove old droiddoc targets for api-stubs, system-api-stubs, and test-api-stubs.
And also set api_tag_name, api_filename, private_api_filename, and etc.
properties in Android.bp for new droiddoc.
Test: manually compare if dependencies change after Soong based droiddoc runs.
Bug: b/70351683
Change-Id: I8d944c83de120ec8148276adc1c9872113d9d29b
Merged-In: I8d944c83de120ec8148276adc1c9872113d9d29b