2016 Commits

Author SHA1 Message Date
Mathew Inwood
5037a7eb93 Merge "Merge hidden API metadata into a single CSV file." 2018-10-17 09:20:04 +00:00
Mathew Inwood
ea14c0c36f Merge hidden API metadata into a single CSV file.
Add a python script to merge the CSV files, dealing with the fact that the
source columns may differ due to the annotation properties present in the
source.

Add this new file and the existing greylist.txt files as dependencies of
the 'dist' target, so that they appear as artifacts on the build server.
This allows them to be processed later by reading them from the build
server.

Test: m out/target/common/obj/PACKAGING/hiddenapi-greylist.csv
Bug: 117314178
Change-Id: Ib9e5da90e4c32333a3f4f02ee7f159f77086ae5e
2018-10-16 12:12:27 +01:00
Mathew Inwood
50dea42729 Add new "max-sdk-p blacklist".
This will contain greylist entries accessible by apps with a
targetSdkVersion of less than Q. Currently empty, will be populated in
follow up CLs.

For now, these APIs are just merged into the light greylist at build time,
pending support in the runtime for implementing the correct runtime
behavior.

Also fix a bug in sort_api.sh so it deals with empty API lists
correctly.

Bug: 115609023
Test: m
Change-Id: I213874062f393f96d120648a934ae5ad7aba93af
2018-10-15 16:38:12 +01:00
Treehugger Robot
61d0ec49ef Merge "Enable jdiff for api-stubs-docs" 2018-09-19 03:02:19 +00:00
Treehugger Robot
324083b211 Merge "Change the dist path of api files" 2018-09-18 02:29:44 +00:00
Nan Zhang
81f29f5cd6 Enable jdiff for api-stubs-docs
And also clean legacy MK code in Android.mk

Test: api-stubs-docs-diff
Bug: b/78245848
Change-Id: I733e0e2c29f8273db3ffb9730c70d5b4e2b1438d
2018-09-17 15:29:11 -07:00
David Brazdil
4a55eebf26 Revert "Check in P dark greylist, use it for hidden API list generation"
This reverts commit 3cc74c71ef907a76547424aea6597f7b2907e9fb.
We saw app crashes due stricter classification of non-SDK APIs.

Bug: 115284625
Bug: 113881436
Test: phone boots

Change-Id: I689d0fbf66fabeffa5032e13f2f1f314c50b6cc5
2018-09-11 11:43:07 +01:00
Mathew Inwood
5e37d22671 Include dark greylist entries from annotations.
@UnsupportedAppUsage annotations support setting a maxTargetSdk property
on the which results in the member being placed on the dark grey list,
or in future on a P or Q blacklist.

Bug: 114361293
Test: m
Change-Id: I33be28f8afb034a030bdf5cf29d43ba72f50bfcd
2018-09-07 16:52:25 +01:00
David Brazdil
081a589ad9 Mark hidden API lists .KATI_RESTAT
Change hidden API list generation build rule so that it checks if
outputs have changed and only commit them when changes have been made.
.KATI_RESTAT instructs ninja to restat the outputs and remove reverse
dependencies when rebuilding dependencies is not needed.

Bug: 113278235
Test: m appcompat
Change-Id: Ic3ec82534a6d79b6a85f865a6e9eb5f0b3f12424
2018-09-06 12:15:11 +01:00
David Brazdil
3cc74c71ef Check in P dark greylist, use it for hidden API list generation
We want to preserve the same semantics as P wrt dark greylist. This will
eventually become the "blacklist for target SDK >= P".

Bug: 113881436
Test: phone boots
Change-Id: I3bb72102e1d054eb0f2cae089ab633a0bc2bb276
2018-09-06 11:10:51 +01:00
Sundong Ahn
c21f78e238 Change the dist path of api files
The dist path of the api files are changed for consistency of dist path.

Test: make -j40 PRODUCT-sdk_phone_armv7-sdk dist sdk_repo
Change-Id: I8dae352288458f6305ab6a0e5210c042ab372e33
2018-09-03 15:13:31 +09:00
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