2005 Commits

Author SHA1 Message Date
David Brazdil
8503b9045b Rewrite hidden API list generation in Python
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
2018-08-30 16:19:26 +01:00
David Brazdil
9b1068cc52 Support whitelist entries from class2greylist
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
2018-08-23 10:35:05 +01:00
Colin Cross
432141676a Convert platformprotosnano and platformprotoslite to Android.bp
See build/soong/README.md for more information.

Test: m checkbuild
Change-Id: Icfb0001df2e35b5ed799511ff4f2f563d626134b
2018-08-20 13:57:24 -07:00
Mathew Inwood
627a84c26a resolve merge conflicts of 606d3975b23ec725085f8ae16ba4074fd05a556a to stage-aosp-master
Bug: None
Test: I solemnly swear I tested this conflict resolution.
Merged-In: Iaed1cd6bc7419597510bfc1ab30a169f75e4ae3f
Merged-In: I681c1e97d0929cfb1d357b2243ecb210d18f9e87
Change-Id: I01782459e2b02f065671da640d675b898b4727fe
2018-08-06 16:30:26 +01:00
David Brazdil
80e6ac7d2c Revert^2: Start using new list of non-SDK APIs
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)
2018-08-03 11:33:07 +00:00
Sundong Ahn
0cb078bba2 Merge "Change the "since" arguments generation."
am: ea77ee39f5

Change-Id: Ia00ed78e8b22875ad2aba2877f6a6b78f7683e81
2018-08-01 15:55:02 -07:00
Treehugger Robot
ea77ee39f5 Merge "Change the "since" arguments generation." 2018-07-31 23:47:44 +00:00
Nan Zhang
2a924543f6 Merge "Add offline/online-sdk-docs in Soong." into stage-aosp-master 2018-07-31 22:14:41 +00:00
TreeHugger Robot
6928e50c26 Merge "Frameworks: convert platformprotos to soong" into stage-aosp-master 2018-07-30 20:30:35 +00:00
Mathew Inwood
ffc8ebefca Merge "Merge generated greylists into final greylist."
am: aa863ca68e

Change-Id: Ia2686a52c5f53f7a82d6dfb70c5c9cf9430443dd
2018-07-26 01:43:37 -07:00
Nan Zhang
e9a76f7317 Add offline/online-sdk-docs in Soong.
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
2018-07-25 17:42:36 -07:00
Andreas Gampe
37b0763a70 Frameworks: convert platformprotos to soong
(cherry picked from commit af27bf6662efb8bb9fb7943b0fdbac530b0cbc99)

Bug: 64328974
Test: m
Merged-In: I3729a3132c1ef07dded69801373edf51006fa623
Change-Id: I3729a3132c1ef07dded69801373edf51006fa623
2018-07-25 17:35:35 -07:00
Mathew Inwood
1b04588ea6 Merge generated greylists into final greylist.
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
2018-07-23 18:06:58 +01:00
David Brazdil
c9b5e65747 Merge changes If285d71a,Iffe5be7c
am: f37950d8c3

Change-Id: I667c07fa75e0cc5badad3f297fc14316a2acfc42
2018-07-17 03:43:13 -07:00
Sundong Ahn
4ff08f6b5d Change the "since" arguments generation.
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
2018-07-16 18:41:36 +09:00
David Brazdil
6f6a126b9c Build dark greylist from public + light grey API
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
2018-06-07 09:45:01 +00:00
David Brazdil
bad3bf6c22 Merge "Include in hidden API dark greylist based on package name" into pi-dev
am: f36144f575

Change-Id: I2f1e1ccd9de49b95f1c5439b13134cc166645612
2018-05-11 08:24:12 -07:00
David Brazdil
f24f0a9c71 Include in hidden API dark greylist based on package name
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)
2018-05-11 16:18:32 +01:00
David Brazdil
4c3c03129b Include in hidden API dark greylist based on package name
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
2018-05-11 13:27:26 +01:00
David Brazdil
259e1629af Manualy blacklist certain hidden APIs
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)
2018-05-09 09:33:42 +01:00
David Brazdil
6afca53da1 Populate hidden API dark greylist
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)
2018-05-09 09:27:24 +01:00
David Brazdil
74502c7500 Refactor build rules for hidden API lists
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)
2018-05-09 09:24:02 +01:00
David Brazdil
f96cb681c4 Merge changes I8b20e03c,Id1ef4ab5,Ie34adb8b into pi-dev
am: a08802dac1

Change-Id: Icfc9aab47db9568d5c06b11c3713f49924b94438
2018-05-08 11:40:26 -07:00
David Brazdil
4b34f79a35 Manualy blacklist certain hidden APIs
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
2018-05-08 17:12:38 +01:00
David Brazdil
185f00e667 Populate hidden API dark greylist
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
2018-05-08 17:12:38 +01:00
David Brazdil
721bc8e6a8 Refactor build rules for hidden API lists
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
2018-05-08 17:12:28 +01:00
David Brazdil
d39b9be2f7 Enable hidden API blacklist in AOSP
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
2018-05-08 12:50:27 +01:00
David Brazdil
b545e03683 Remove hiddenapi-blacklist.txt
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
2018-05-03 12:14:45 +01:00
David Brazdil
cc88bdc14c Add rule to build hidden API blacklist
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
2018-05-03 10:54:26 +01:00
Anton Hansson
e16051a077 Merge "Update apidiff source files to use new api location." into pi-dev-plus-aosp 2018-05-02 16:25:42 +00:00
David Brazdil
51c439d79c Build hidden API DEX signatures with Soong
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)
2018-05-02 16:20:01 +01:00
David Brazdil
0319384019 Merge non-SDK @removed API and light greylist
am: 0585533a85

Change-Id: I3b052c65e23b813f96df9a8d28fe81961bf42a7f
2018-05-02 07:43:11 -07:00
David Brazdil
0585533a85 Merge non-SDK @removed API and light greylist
@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
2018-05-02 14:29:20 +00:00
David Brazdil
0f0abb2593 Build list of @removed API's dex signatures
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
2018-05-02 08:54:50 +00:00
Anton Hansson
cfa700dd85 Update apidiff source files to use new api location.
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
2018-04-23 18:03:15 +01:00
Anton Hansson
e5bf20608a Move frameworks/base off the SRC_API_DIR variable.
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
2018-04-23 15:46:19 +01:00
Anton Hansson
6a9e72651b Move frameworks/base off the SRC_API_DIR variable.
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
2018-04-23 11:44:53 +01:00
Anton Hansson
6939c142e0 Merge "Update docs 'since' for API 28." into pi-dev
am: 93f457c531

Change-Id: I86d0f88190fa9603ac3eef6468a73d32c1a633e3
2018-04-19 08:42:56 -07:00
Anton Hansson
092d9b8088 Update docs 'since' for API 28.
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
2018-04-19 14:21:44 +01:00
Alan Viverette
55d013b0fa Merge "Federate platform docs against AndroidX" into pi-dev
am: 73a66276e3

Change-Id: I037ae591cb7fbdf33260ff7494a28a0ae22919c1
2018-03-29 15:04:15 +00:00
Alan Viverette
67b51d4691 Federate platform docs against AndroidX
Bug: 76692459
Test: make docs
Change-Id: If1523ee47bcc58151a641938ac6f4a6e7ae1af0b
2018-03-28 17:13:13 -04:00
David Brazdil
9d184a24e8 Merge "Revert Revert: Enable hidden API blacklist" into pi-dev
am: c60a932ae5

Change-Id: I95c824b6107083667be474c4fc1f8d3bbd22648e
2018-03-28 15:54:06 +00:00
David Brazdil
36bbf124b8 Revert Revert: Enable hidden API blacklist
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
2018-03-28 15:05:22 +00:00
David Brazdil
3f3487d64e Merge "Add serialization methods to hidden API light greylist" into pi-dev
am: 02175b7847

Change-Id: Ie625488ec40b3fd18d11043a1d25f5ccb487c351
2018-03-27 17:23:54 +00:00
David Brazdil
357170b180 Add serialization methods to hidden API light greylist
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
2018-03-27 16:54:53 +00:00
Mathieu Chartier
eff60b2742 Merge "Revert "Enable hidden API blacklist"" into pi-dev
am: 90ad15400a

Change-Id: I1d2b05e6959538b5b60a63f76fcd10b42b8e83a5
2018-03-22 20:28:44 +00:00
David Brazdil
f712b23d56 Revert "Enable hidden API blacklist"
This reverts commit 16bfa11b73a34be1f1c72d2ffe86702f85378e92.

Reason for revert: Revert until b/76138670 is fixed

Bug: 64382372
Bug: 76138670
Bug: 76157445
Change-Id: Iaf6c76b773fbea4d4710b38808dee2e7e06f5e78
2018-03-22 20:10:26 +00:00
Nicolas Geoffray
07e1fb65ba Merge "Enable hidden API blacklist" into pi-dev
am: 34aae0daad

Change-Id: Ie71f420a40afcd63b0bf758e17fefe4ea59aee1b
2018-03-21 11:04:27 +00:00
Nan Zhang
7bfac8dce2 Remove Make side (system/test-)api-stubs droiddoc targets
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
2018-03-20 16:22:30 -07:00
Nan Zhang
54963cba91 Remove Make side (system/test-)api-stubs droiddoc targets
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
2018-03-20 11:43:51 -07:00