2035 Commits

Author SHA1 Message Date
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
David Brazdil
16bfa11b73 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.

Bug: 64382372
Test: make
Test: device boots
Change-Id: Id38dd14382e9c2f0e853698ad7df7e9602084336
2018-03-20 13:54:55 +00:00
David Brazdil
873d1d30d5 Add uses of hidden APIs from vendor apps
These will move into the dark greylist once we remove the UI toast.
Merge them with light greylist for now.

Bug: 64382372
Bug: 74589747
Bug: 74588266
Bug: 74586173
Bug: 74586969
Test: make
Change-Id: I8c1d3b67b763e8b14a66874705ba7165cf421e72
Merged-In: I5d0ec308a0187d67df6d9a4f0778c9285dc1e2af
2018-03-16 10:23:09 +00:00
David Brazdil
68e1c1dcf4 Whitelist all @SystemApi and @TestApi for hidden API
We used to greylist @SystemApi and @TestApi individually, but we should
allow all of them to be used. Run Doclava in a separate pass to generate
a list of private APIs, assuming that @SystemApi and @TestApi override
the @hide annotation.

Bug: 64382372
Bug: 74346885
Test: check generated files
Change-Id: Ie3726a294a4fdeb03fc8888878b013c9ad5bd04b
2018-03-08 14:54:56 +00:00
Tobias Thierer
dda16e8e6b Remove com.android.internal{.util} from generated documentation.
com.android.internal.* is meant to be hidden from documentation,
but most of it is erroneously not hidden via @hide or -hidePackage
directives; why documentation is currently generated for Predicate
but not other classes from com.android.internal.util, and why some
but not all classes from that package show up in package-level
documentation (package-summary.html), is not currently understood.

There appears to be a behavior difference between OpenJDK 8 and
OpenJDK 9's javadoc that results in additional classes showing up
in package-summary.html. This CL fixes this by adding -hidePackage
directives for com.android.internal{.util}; other sub-packages of
com.android.internal do not currently show up in documentation and
are not touched by this CL.

Test: Patched this CL into the internal-master branch and ran:
      USE_R8=true EXPERIMENTAL_USE_OPENJDK9=true make offline-sdk-docs
      Checked that this removes all documentation for com.*
      (com.android.internal.util was the only com.* package for which
      documentation was previously generated).
      In other words: Before this CL, [1] existed, but after
      this CL, the entire directory subtree [2] does not exist.
Test: Checked that Predicate was already missing from stubs before this
      CL. In other words, [3] already did not exist before this CL.

[1] out/target/common/docs/offline-sdk/reference/com/android/internal/util/Predicate.html
[2] out/target/common/docs/offline-sdk/reference/com
[3] out/target/common/obj/JAVA_LIBRARIES/android_system_stubs_current_intermediates/classes/com

Bug: 69736344
Bug: 69736236

(cherry picked from commit 97bb6cf371f51549c708cf58a04584968eaf7d5a)

Merged-In: Ic9757f4966f54092aac0191896581fa4222cc634
Change-Id: Ic9757f4966f54092aac0191896581fa4222cc634
2018-03-07 13:57:16 +00:00
Tobias Thierer
97bb6cf371 Remove com.android.internal{.util} from generated documentation.
com.android.internal.* is meant to be hidden from documentation,
but most of it is erroneously not hidden via @hide or -hidePackage
directives; why documentation is currently generated for Predicate
but not other classes from com.android.internal.util, and why some
but not all classes from that package show up in package-level
documentation (package-summary.html), is not currently understood.

There appears to be a behavior difference between OpenJDK 8 and
OpenJDK 9's javadoc that results in additional classes showing up
in package-summary.html. This CL fixes this by adding -hidePackage
directives for com.android.internal{.util}; other sub-packages of
com.android.internal do not currently show up in documentation and
are not touched by this CL.

Test: Patched this CL into the internal-master branch and ran:
      USE_R8=true EXPERIMENTAL_USE_OPENJDK9=true make offline-sdk-docs
      Checked that this removes all documentation for com.*
      (com.android.internal.util was the only com.* package for which
      documentation was previously generated).
      In other words: Before this CL, [1] existed, but after
      this CL, the entire directory subtree [2] does not exist.
Test: Checked that Predicate was already missing from stubs before this
      CL. In other words, [3] already did not exist before this CL.

[1] out/target/common/docs/offline-sdk/reference/com/android/internal/util/Predicate.html
[2] out/target/common/docs/offline-sdk/reference/com
[3] out/target/common/obj/JAVA_LIBRARIES/android_system_stubs_current_intermediates/classes/com

Bug: 69736344
Bug: 69736236

Change-Id: I3243e2820348c338a54e42c72d29bed71389a6c4
2018-03-06 12:05:28 +00:00
Scott Main
b437f30f28 Merge "Enable new yaml file for reference nav that lists all framework files." into oc-mr1-dev am: e3c0216f95
am: 91ca55c174

Change-Id: I04555e22ddd6a26904e0c83d1113d67ff13e69a2
2018-03-01 19:37:38 +00:00
Scott Main
91ca55c174 Merge "Enable new yaml file for reference nav that lists all framework files." into oc-mr1-dev
am: e3c0216f95

Change-Id: I535787ff921cb6e6978e57dd775e7446f67195f8
2018-03-01 19:21:50 +00:00
Scott Main
4f9b48cce4 Enable new yaml file for reference nav that lists all framework files.
This depends on DocLava changes in ag/3382461

bug: b/69845924

test: make ds-docs

Change-Id: I4acd2c2034581b349ab4c00cbfe195ee5eca2354
2018-03-01 19:03:25 +00:00
Andrew Solovay
73cf7bfd90 Merge "docs: Adding P to the API levels" 2018-02-27 19:46:36 +00:00
Andrew Solovay
61204ce7fe docs: Adding P to the API levels
Based this on SMain@ 's changes in ag/1936024 , which added the O
API level for the O preview.

Doc is staged to:

go/dac-stage/reference/

For an example of a new API class with the watermark, see:

go/dac-stage/reference/android/media/MediaPlayer2.html

Test: make ds-docs
Bug: 73009741
Change-Id: I591419c903222c9ad0c541dcd4bfce6a38ba1f2c
2018-02-26 14:02:22 -08:00
Neil Fuller
76ac7e6319 Remove icu4j dependency.
This dependency is no longer required: it was added
for libcore when libcore was implemented in terms of
com.icu classes. libcore has since moved to android.icu
(in core-libart) and so the droiddoc dependency is no
longer required.

Test: make droid docs
Merged-In: I6e4e79a7df201fdc2cefa60037adf831593eaa0f
Change-Id: I6e4e79a7df201fdc2cefa60037adf831593eaa0f
2018-02-26 21:22:38 +00:00
Neil Fuller
34f7230512 Remove icu4j dependency.
This dependency is no longer required: it was added
for libcore when libcore was implemented in terms of
com.icu classes. libcore has since moved to android.icu
(in core-libart) and so the droiddoc dependency is no
longer required.

Test: make droid docs
Change-Id: I6e4e79a7df201fdc2cefa60037adf831593eaa0f
2018-02-26 21:03:12 +00:00
Andreas Gampe
7b9b5d7544 Framework: Disable [MissingOverride] for platformprotos
Bug: 72714520
Test: m javac-check-platformprotos RUN_ERROR_PRONE=true
Merged-In: I00f5a588fa74621d4c35dc4e39b54536815ad476
Change-Id: I00f5a588fa74621d4c35dc4e39b54536815ad476
2018-02-16 01:34:21 +00:00
Andreas Gampe
3e429f33dd Framework: Disable [MissingOverride] for platformprotos
Bug: 72714520
Test: m javac-check-platformprotos RUN_ERROR_PRONE=true
Change-Id: I00f5a588fa74621d4c35dc4e39b54536815ad476
2018-02-15 17:13:03 -08:00
TreeHugger Robot
05d08d808d Merge "Fix link-type check warnings for platformprotosnano" 2018-02-13 23:18:11 +00:00
Colin Cross
7d07ad1ef2 Merge "Don't put android.os.Parcelable in framework.aidl" am: 0872f6d5e3 am: 6864210fe2
am: 37ba3de333

Change-Id: Ib8d8277171ede82ea4626b6d2de2fcb9c1a1d307
2018-02-13 08:41:41 +00:00
Jiyong Park
f0048397a4 Fix link-type check warnings for platformprotosnano
platformprotosnano is used by cts-amwm-util and this is causing
link-type check warning because cts-amwm-util is built using SDK but
platformprotosnano isn't.

Since platformprotosnano can actually be built with SDK APIs only,
setting LOCAL_SDK_VERSION to 'current' instead of building against
core-oj and core-libart which contain private APIs.

LOCAL_SDK_VERSION := core_current has been tried but it didn't work
because libprotobuf-java-nano is using Android APIs (thus marked as
java:sdk). java:core -> java:sdk dependency is not allowed.

Bug: 69899800
Test: m -j platformprotosnano
Change-Id: I14a9a80bb218dae63e8320b7aab40d7ad48a7a13
2018-02-12 21:57:59 +09:00
Colin Cross
fdbe7d1ca9 Don't put android.os.Parcelable in framework.aidl
Parcelable shouldn't be in the list of parcelables in framework.aidl.
Remove it to fix warning when running aidl:
framework.aidl:287 attempt to redefine built in class android.os.Parcelable

Also make the dependency on sdk_parcelables not be order-only so
framework.aidl gets rebuilt when sdk_parcelables changes.

Bug: 73135791
Test: ParcelableDetectorTest
Test: out/target/common/obj/framework.aidl does not contain android.os.Parcelable
Change-Id: If5222879be9ec1e5fa08810adc624ec526ddc0ec
2018-02-09 11:29:15 -08:00
Nicolas Geoffray
90fa8ef4c9 Revert "Make blacklist the default hidden API list"
Bug: 64382372

This reverts commit 3f4136c3b76d2ec9cdba9caf132d9ca2958821b7.

Reason for revert: Causing too many downstream issues together
    with I2c1353d31386da447456b17f9643c0470128ee3d. Revert to
    unblock pi-release and testing.

Bug: 73105914
Bug: 73103669
Bug: 73106486
Bug: 64382372
Bug: 73103081
Bug: 73119220
Bug: 73114663

Change-Id: I072dd571f779e2b5e405d21eecce5a60d1b3c7f2
2018-02-08 21:44:24 +00:00
David Brazdil
3f4136c3b7 Make blacklist the default hidden API list
Starting with DP1 we will move private APIs that have not been
explicitly greylisted into the blacklist. Modify Android.mk to
generate the API lists accordingly.

Bug: 64382372
Test: make, inspect out/target/common/obj/PACKAGING/hiddenapi-*
Change-Id: I1d817ba6b95058ad052a2c7663ef99257bdeffc1
2018-02-08 03:51:55 +00:00