Commit Graph

6194 Commits

Author SHA1 Message Date
Dan Willemsen
9b767e275e Merge "Stop using DIST_DIR directly, use dist-for-goals instead"
am: a8f2601d28

Change-Id: Iabb2ddb086dda71887c3d50152db50f813c9556a
2018-10-16 17:43:35 -07:00
Treehugger Robot
a8f2601d28 Merge "Stop using DIST_DIR directly, use dist-for-goals instead" 2018-10-17 00:18:07 +00:00
Paul Duffin
66e9d98618 Merge "Fix issue with sort_api.sh"
am: f943c52105

Change-Id: I196e57f5d5f96e5f5e1885e893be21ae81b75207
2018-10-16 10:10:45 -07:00
Paul Duffin
c78bea41c6 Fix issue with sort_api.sh
Should use -ne not -neq.

Test: run script manually
Bug: 115609023
Change-Id: I337ed43be1f9250e6c2b2c88d97c68a5c9e8941c
2018-10-16 14:30:01 +01:00
Mathew Inwood
f0a45a4114 Merge "Add new "max-sdk-p blacklist"."
am: adbc7dfc28

Change-Id: Ice435ecdef532f3d25b705cc734773deba84322f
2018-10-16 05:38:00 -07: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
Ryan Mitchell
6ffa32f13d AAPT2: Add the rest of supported manifest elements
am: 00d5548355

Change-Id: I9c8002d2891d762e579d0d987bb52856fb20df17
2018-10-10 16:06:48 -07:00
Ryan Mitchell
840beebdb4 AAPT2: Add supported manifest elements
am: 48d009ad32

Change-Id: Ib620e6c3a5ee6b4a33f4d64a9afa44302de67d7a
2018-10-10 16:00:02 -07:00
Treehugger Robot
e75f2f504e Merge changes from topic "aapt2-manifest-elements"
* changes:
  Remove workarounds for b/79755007
  AAPT2: Add the rest of supported manifest elements
  AAPT2: Add supported manifest elements
2018-10-10 22:29:57 +00:00
Mårten Kongstad
b7c0800fa0 Merge "libandroidfw: move ConfigDescription from aapt2 to libandroidfw"
am: b14c887974

Change-Id: I14be80a2d2c3620919a78da5a42ed56ec1d1737f
2018-10-09 16:04:34 -07:00
Mårten Kongstad
7672daf8e5 Merge changes from topic "idmap2-prerequisites"
am: 62a5d4249f

Change-Id: I8db3f5ba0de6510c3327273c56e9fcc75c836694
2018-10-09 16:00:31 -07:00
Treehugger Robot
b14c887974 Merge "libandroidfw: move ConfigDescription from aapt2 to libandroidfw" 2018-10-09 21:43:38 +00:00
Treehugger Robot
62a5d4249f Merge changes from topic "idmap2-prerequisites"
* changes:
  AssetManager2: optionally keep non-matching configs
  AAPT2: optionally keep resources without default value
  libandroidfw: add resource ID iterator
2018-10-09 21:43:38 +00:00
Dan Willemsen
5cc1700171 Stop using DIST_DIR directly, use dist-for-goals instead
As a preparation in refactoring how we handle dist, I'm making
everything use dist-for-goals. In this case, instead of fully relying on
a phony rule, write the gtest xml into an intermediate folder, and use
dist-for-goals to copy that into the dist dir.

Bug: 117463001
Test: DIST_DIR=dist m aapt2_run_host_unit_tests dist
Test: DIST_DIR=dist m aapt2_run_host_unit_tests dist   (reruns test)
Change-Id: I166c2b3088703875c6028c3479aec7cf09f3f635
2018-10-09 14:28:35 -07:00
Ryan Mitchell
f1aadaf8c5 Merge "Add rtmitchell to AAPT2 OWNERS"
am: 0d3f4e61c9

Change-Id: I5285ed50123ed2fd219c6b9daa5e460c0cbdaa36
2018-10-09 10:31:54 -07:00
Mårten Kongstad
f99eda450f AAPT2: optionally keep resources without default value
Teach "aapt2 link" about a new flag --no-resource-removal. When given,
aapt2 will not filter out resources that lack default values. This is
useful mostly when building overlay packages that define resources for
non-default configurations, such as only for values-sv.

Test: manual: build package with resource only in values-vs, verify apk with aapt2 dump
Change-Id: Idc513bcb3f43bbff7f073163562c3dfccdb9bc9b
Merged-In: Idc513bcb3f43bbff7f073163562c3dfccdb9bc9b
2018-10-09 14:02:14 +00:00
Mårten Kongstad
5c541f6e36 libandroidfw: move ConfigDescription from aapt2 to libandroidfw
This is to allow idmap2 to access ConfigDescription.

Test: libandroidfw_tests
Test: aapt2_tests
Change-Id: I54210bbbd8dad5903cb7100807df977efa394ad5
Merged-In: I54210bbbd8dad5903cb7100807df977efa394ad5
2018-10-08 09:56:09 -07:00
Ryan Mitchell
6d0dbbbab3 Add rtmitchell to AAPT2 OWNERS
Per talks with Svet, it is time I became a co-owner of AAPT2 with
toddke. I look forward to continuing to support and improve AAPT2.

Change-Id: I3a0f1c8a708abc41045b95dc958dbeb96a5160ff
2018-10-04 11:54:29 -07:00
Chih-hung Hsieh
15dcc77fee Merge "Add noexcept to move constructors and assignment operators."
am: 9166e89374

Change-Id: I079060ef610c2d90c57140f001225c163a3dd21a
2018-10-01 18:09:38 -07:00
Chih-hung Hsieh
9166e89374 Merge "Add noexcept to move constructors and assignment operators." 2018-10-02 00:37:46 +00:00
Pirama Arumuga Nainar
206ccf1f61 Merge "Do not use StringPiece in ExtractJavaIdentifier"
am: 20ecc6397b

Change-Id: I3c70a4b9db43d9590f52cdb6972cf9fba3501787
2018-10-01 17:25:02 -07:00
Treehugger Robot
20ecc6397b Merge "Do not use StringPiece in ExtractJavaIdentifier" 2018-10-01 23:37:31 +00:00
Chih-Hung Hsieh
fc81626ba6 Add noexcept to move constructors and assignment operators.
Bug: 116614593
Test: build with WITH_TIDY=1
Change-Id: Ic3993d88eb3066aef402d74c4d543c56a1dfd5c3
2018-10-01 20:23:02 +00:00
Ryan Mitchell
47be78e523 Merge "Change FileStream test buffer from char* void*"
am: b839befd7b

Change-Id: Iffc125b995827c455fb4f2c3b2dca15de3321a86
2018-09-26 15:14:41 -07:00
Ryan Mitchell
b839befd7b Merge "Change FileStream test buffer from char* void*" 2018-09-26 21:58:44 +00:00
Ryan Mitchell
8f37734cf4 Change FileStream test buffer from char* void*
It seems like GoogleTest prints string parameters before checking them.
This can be a problem in FileStream tests since these buffers are not
null terminated.  ASan reports heap-buffer-overflow.

Test: m SANITIZE_HOST=address
out/soong/.intermediates/frameworks/base/tools/aapt2/aapt2_tests/linux_glibc_x86_64_asan/aapt2_tests \
      LD_LIBRARY_PATH=out/soong/.intermediates/external/libcxx/libc++/linux_glibc_x86_64_shared
out/soong/.intermediates/frameworks/base/tools/aapt2/aapt2_tests/linux_glibc_x86_64_asan/aapt2_tests

Change-Id: I9a1956d815729de23c7038fb0d498240eb917070
2018-09-26 14:54:45 -07:00
Pirama Arumuga Nainar
9ba5cb4796 Do not use StringPiece in ExtractJavaIdentifier
Bug: http://b/91353691

After assigning the result of TransformToFieldName to 'result', the
underlying storage is destroyed after the 'if' statement of the function
call.  'result' ends up with garbage if the identifier has a '-'.

ManifestClassGeneratorTest.NormalizePermissionNames is broken for this
reason in 32-bit Windows when using libc++ and 32-bit Linux.  ASAN also
reports this failure for both 32-bit and 64-bit linux.

Test: Run test on the cases mentioned above and ensure all of them pass.
Change-Id: I69163c423c1171b7ac7838f2abe06bdf8058df4c
2018-09-25 13:21:35 -07:00
Chih-Hung Hsieh
18242e5c08 Merge "Fix clang-tidy performance warnings in frameworks/base."
am: 4a2dd10d83

Change-Id: Ic7266f1c23ab5218f47bf65bb2bde6f79a07a910
2018-09-24 11:50:54 -07:00
Chih-Hung Hsieh
6b3fac2945 Fix clang-tidy performance warnings in frameworks/base.
* Use more efficient overloaded string methods.

Bug: 30411878
Test: build with WITH_TIDY=1
Change-Id: Ia387e61770e1e7211280ed028ef0eef6e632a1d2
2018-09-24 16:29:26 +00:00
Paul Duffin
b2e9c6652e Merge "Add serialization methods to whitelist not light greylist"
am: f7190b65ab

Change-Id: Idecb27314ecbdea74354afb4f320eda124bfc72d
2018-09-24 04:23:27 -07:00
Paul Duffin
e9622a3d3a Add serialization methods to whitelist not light greylist
Checked the contents of the hiddenapi lists before and after the change
and the methods were definitely moved from light greylist to the
whitelist.

Flashed the device and checked the log and did not see anything out of
the ordinary.

Test: frameworks/base/tools/hiddenapi/generate_hiddenapi_lists_test.py
Change-Id: I9b4b2426251e99495f65ae02a3c2c32ce6966625
2018-09-21 11:05:06 +01:00
Mathew Inwood
57a4bae7c3 Merge "Don't fail if there are no comments."
am: daabcae955

Change-Id: I7d8139a98913ae17491f73314bd426287374c270
2018-09-14 21:55:58 -07:00
Mathew Inwood
6be0fdde4a Don't fail if there are no comments.
Grep exits with non-zero if it find no matches. But it doesn't matter in
this case, so just carry on.

Test: frameworks/base/tools/hiddenapi/sort_api.sh \
Test:    frameworks/base/config/hiddenapi-light-greylist.txt
Change-Id: I7c219ee617f7dfa3cff5232ab979cc4ba38ebbfd
2018-09-14 15:29:35 +01:00
Ryan Mitchell
00d5548355 AAPT2: Add the rest of supported manifest elements
Adds elemnts that are parsed in PackageParser to the manifest parsing of
AAPT2.

<package> found in <manifest>
<preferred> found in <manifest><application><activity>

Bug: 79755007
Test: manual building of broken targets listed in the bug
Change-Id: Ic7d17e62d04aa46757d2ed7482ec0aff93ce9ee5
Merged-In: Ic7d17e62d04aa46757d2ed7482ec0aff93ce9ee5
(cherry picked from commit 28afe682cd)
2018-09-13 22:12:37 -07:00
Ryan Mitchell
48d009ad32 AAPT2: Add supported manifest elements
Adds some elements present in res/values/attrs_manifest.xml to manifest
parsing.

<additional-certificate> in <manifest><application><uses-static-library>
<meta-data> in <manifest><permission>
<package-verifier> in <manifest>
<restrict-update> in <manifest>

Bug: 79755007
Test: manual
Change-Id: I50520a99ce5ced9908001430b2108d7a5c71f8a7
Merged-In: I50520a99ce5ced9908001430b2108d7a5c71f8a7
(cherry picked from commit 66f6cfb8a5)
2018-09-13 22:11:59 -07:00
Jeff Sharkey
ac2b7439d9 Merge changes from topic "ownerz"
am: 98cd65e17f

Change-Id: I42a137e73ab409a03f26abb0394be229c9d43e12
2018-09-11 16:15:49 -07:00
Jeff Sharkey
5b471996eb Tweaks to AOSP upload hook logic.
Lists all matching files, and slightly more robust path handling.

Bug: 113136846
Test: manual
Change-Id: Ic1971a3df97b8b137993b5856b47d0d706a996cd
2018-09-11 12:14:48 -06:00
Jeff Sharkey
0a9c731969 Upload hook that guides people towards AOSP.
The canonical location of certain parts of the source tree live in
AOSP, and should not be changed internally to avoid merge conflicts.

This initially starts with "OWNERS" files, but the hook can easily
be repeated to match any files based on file path regexes.

Bug: 113136846
Test: manual
Change-Id: I113e63b6133f20389d84ec0d6d8b81cdbdf35d38
Merged-In: I113e63b6133f20389d84ec0d6d8b81cdbdf35d38
2018-09-11 11:09:05 -06:00
David Brazdil
5c6894a85b Merge "Revert "Check in P dark greylist, use it for hidden API list generation""
am: e87700fc97

Change-Id: Ic4c73f2f482ab9260479e44e69a26bb55e510cca
2018-09-11 09:46:18 -07:00
David Brazdil
4a55eebf26 Revert "Check in P dark greylist, use it for hidden API list generation"
This reverts commit 3cc74c71ef.
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
David Brazdil
5c776dea7e Merge changes from topic "hiddenapi-dark-grey"
am: 3d93d8f323

Change-Id: I7ee3cfd512553bcf5ff3297a7df0db6786d3436a
2018-09-07 03:00:37 -07:00
David Brazdil
38d2793a7d Check in P dark greylist, use it for hidden API list generation
am: 3cc74c71ef

Change-Id: I266a8661800078c7fd3f1717b94c81f3a7e9545a
2018-09-07 02:48:00 -07:00
David Brazdil
3d93d8f323 Merge changes from topic "hiddenapi-dark-grey"
* changes:
  Ignore comment lines in hidden api lists
  Mark hidden API lists .KATI_RESTAT
  Check in P dark greylist, use it for hidden API list generation
2018-09-07 09:31:56 +00:00
Tobias Thierer
e03a757d87 Merge "Fix compilation when targeting OpenJDK 9."
am: 0d2f465ed7

Change-Id: I066771334a0d7c4d79c4035ccce95c08d7a23892
2018-09-06 12:31:56 -07:00
Tobias Thierer
8fb3615729 Fix compilation when targeting OpenJDK 9.
CL [1] added a new compilation target that uses internal API
that is now in the jdk.compiler module and is not exported
(it is subject to removal without notice in future versions of
OpenJDK). The fact that these packages are not exported suggests
that a replacement API is already available, but I don't know the
details.

For now, this CL uses javac command-line flags to export these
packages, which fixes compilation. Since the commit message from
CL [1] implies that the entire tool can be removed once bug 77284273
is fixed, a longer-term solution should not be required.

[1] https://android-review.googlesource.com/c/platform/frameworks/base/+/745655
    commit bad89e5e5b

Test: The following breaks before but not after this CL:
  EXPERIMENTAL_USE_OPENJDK9=true make unsupportedappusage-annotation-processor
Bug: 113853502

Change-Id: I24b77af9262891428a01e2eccc18fa3a5c3b3bc9
2018-09-06 17:33:57 +01:00
David Brazdil
ae88d4e21e Ignore comment lines in hidden api lists
It is sometimes useful to add comments at the top of a source file. This
patch changes hidden API list generation to ignore lines beginning with
a hash.

Note that due to the sorting constraints on hidden API lists, comments
can be only at the top of the files.

Test: m appcompat
Change-Id: I1bc6fd44d1b1f10a5adc45093d7f7ed5a0c5a54f
2018-09-06 15:10:28 +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
Mathew Inwood
22ea0b7a52 Merge "Processor for @UnsupportedAppUsage annotations."
am: e5440456ca

Change-Id: I5e4d53b92c20bf3c34248c6cf4798ab4ba34af7c
2018-09-05 09:33:33 -07:00
Mathew Inwood
bad89e5e5b Processor for @UnsupportedAppUsage annotations.
The processor outputs unsupportedappusage_index.csv, containing source
position info for every@UnsupportedAppUsage annotation processed. It is a
mapping of dex signature to the source postion of the annotation on that
signature. It is used as input for scripts which update the annotations.

We include a META-INF file which causes the compiler to automatically
pick up the annotation processor. Otherwise we would need to explicitly
specify the processor with a -processor flag to javac.

We create a new build target for just the @UnsupportedAppUsage annotation
and the @IntDef annotation (which it depends on) so that the processor can
also depend on that directly.

The processor only runs on a new build target framework-annotation-proc
so that it is not invoked as part of a regular build. This is done so
that we don't slow down peoples builds: Soong does not support annotation
processors when javac sharding is in use. This workaround can be removed
once b/77284273 is fixed.

Test: m framework-annotation-proc
Bug: 113853502

Change-Id: Ie9cd5a90ddf7a51f6035e849703fc39ad9127557
2018-09-05 15:01:21 +01:00
David Brazdil
8f7b234417 Merge "Rewrite hidden API list generation in Python"
am: a264c2c83e

Change-Id: Ib785891e303ef7c4a78175debae3e92b3a82410f
2018-08-30 11:18:29 -07:00