Commit Graph

23731 Commits

Author SHA1 Message Date
Anton Hansson
44b2e0dfcb development: Set LOCAL_SDK_VERSION where possible.
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.

Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.

Test: make relevant packages
Bug: 73535841
Change-Id: I371bd0b43e66bcc4be1e26decb95c70519ac3342
2018-02-21 19:02:11 +00:00
Treehugger Robot
86c0968a05 Merge "Build libsimplejni using SDK" 2018-02-15 07:41:37 +00:00
Treehugger Robot
6f08ea2f38 Merge "Python 3 compatibility." 2018-02-14 22:40:43 +00:00
Dan Albert
1b06c6e40d Python 3 compatibility.
Test: ndk/run_tests.py
Bug: None
Change-Id: Id0d2d8024adec880c1a41b524704df1641cda065
2018-02-14 12:46:58 -08:00
Jayant Chowdhary
2cfca9462e Merge "Add an additional test for ODR." 2018-02-14 18:19:11 +00:00
Jiyong Park
6a91a9ad8a Build libsimplejni using SDK
The lib hasn't been built using SDK and thus has been causing link-type
check warning from SimpleJNI which is built using SDK. Since the warning
will turn into error soon, fixing the warning by correctly building the
lib with SDK.

Bug: 69899800
Test: m -j SimpleJNI is successful and does not show any link-type check
warning

Change-Id: I51edfe296c70ac99ac7698b5e06ec0e0c678945c
2018-02-14 17:10:57 +09:00
Treehugger Robot
dc4e0eb605 Merge "Purge more of development/ndk." 2018-02-14 07:30:18 +00:00
Jayant Chowdhary
6a9e6fb6d3 Merge "Show added record fields in diff report as well." 2018-02-14 00:26:54 +00:00
Logan Chien
c81c54bad7 Merge "sourcedr: Add VNDK dependency check tool" 2018-02-13 04:42:22 +00:00
Logan Chien
b460981888 sourcedr: Add VNDK dependency check tool
This commit adds check_vndk_dep.py which checks the module dependencies
to ensure there are no modules violating VNDK requirements.

Test: check_vndk_dep.py [root-file]
Change-Id: Icfdc066b0f986bf0fb56aaf2d26957948f6fdd4d
2018-02-13 10:33:34 +08:00
Andreas Gampe
94d4d65137 Merge "Stubs: Disable Errorprone warnings" 2018-02-13 00:20:38 +00:00
Jayant Chowdhary
3bc023f373 Add an additional test for ODR.
Also add missing test source files.

Test: tests/test.py

Change-Id: I44ec2cab9596e4722600995855d0a035e304e7ae
2018-02-12 13:43:54 -08:00
Dan Albert
72e43ce150 Purge more of development/ndk.
The static libraries now come from prebuilts/ndk and the CRT sources
now come from bionic.

Test: treehugger
Bug: None
Change-Id: I2e8075d6acca60e64d0c3173713be2bf102a09d8
2018-02-12 11:25:09 -08:00
Treehugger Robot
8337ffeae2 Merge "Support mounting the odm image" 2018-02-12 05:44:47 +00:00
Treehugger Robot
9240289080 Merge "gzip reference dumps while copying to ref-dump-dir." 2018-02-09 20:25:17 +00:00
Jayant Chowdhary
d1f8fc226b gzip reference dumps while copying to ref-dump-dir.
Remove the additional step of gzipping reference dumps manually.

Test: utils/create_reference_dumps.py --version current -ref-dump-dir
      $ANDROID_BUILD_TOP/prebuilts/abi-dumps/vndk; mm -j64 in
      external/libexif.

Change-Id: Ib22a3b4fa90e4f849529efc4b03ab43d87996458
2018-02-09 10:29:57 -08:00
Jayant Chowdhary
326a4ed367 Merge "Fix map key in header-abi-diff while extracting user defined types." 2018-02-07 23:47:19 +00:00
Jayant Chowdhary
7cc00996e5 Fix map key in header-abi-diff while extracting user defined types.
The key being added to respective maps which facilitate diffing of
unreferenced user defined types was earlier the linker set key. The
unique id should be used instead. This is because linker set keys for C
and C++ types can be the same, but their unique id's cannot. Thus,
having linker set keys as a key leaves open the possibility of false
type aliasing, whereas the unique id does not.

Test: python3 tests/test.py

Test: python3 tests/test.py \
      MyTest.test_libc_and_cpp_with_unused_struct_and_libc_and_cpp_with_unused_cstruct;
      before this change, this test fails; after this change, the test
      passes.

Change-Id: I91816167a48308a8c812d01e0a09e9bb70c60b50
2018-02-07 13:04:30 -08:00
Jayant Chowdhary
0e9140f645 Show added record fields in diff report as well.
This makes it easier to ascertain why the size of a record changed /
offsets of fields changed.

Bug: 72697345

Test: tests/test.py

Change-Id: I41ea02c0459043e8036398034a1b92761e49957e
2018-02-06 18:47:46 -08:00
Andreas Gampe
bd40595d86 Stubs: Disable Errorprone warnings
The stubs are auto-generated and lack lots of annotations. Furthermore,
the originating code will already lead to warnings. So suppress all
Errorprone warnings for stub code.

Test: m
Test: m javac-check RUN_ERROR_PRONE=true
Change-Id: I214f348e2ecef5d640fa488f3d4cf9a18b942430
2018-02-05 14:52:17 -08:00
Treehugger Robot
499490e7e1 Merge "Add libcompiler_rt-extras from prebuilts/ndk." 2018-02-01 23:54:43 +00:00
Dan Albert
bbdeccffb3 Add libcompiler_rt-extras from prebuilts/ndk.
Still not ready to adopt the new static libraries, but we've needed
this for a while now. Copy it into place for now.

These came from the current prebuilts/ndk, which themselves came from
AOSP master build 4567395.

Test: ndk/checkbuild.py && ndk/run_tests.py
Bug: https://github.com/android-ndk/ndk/issues/294
Change-Id: Ia713a957df5c913b36d5f6c8fff35bbb11315ae8
2018-02-01 22:03:22 +00:00
SzuWei Lin
e6a22f3ca5 Support mounting the odm image
Some checkers could read information from odm image. e.g.
sepolicy_checker could also check the compatibility between
system image and odm image. The patch revises the common image source
argument parser and CompositeMounter to support the odm image.

Bug: 72720671
Test: gsi_util pull --odm $OUT/system.img /odm/system/build.prop
Change-Id: I586decaf96640679c7a8e7ec52086d55510fbdeb
2018-02-01 15:09:40 +08:00
Treehugger Robot
51d992d60d Merge "gsi_util: adds sepolicy_checker" 2018-02-01 07:08:28 +00:00
Logan Chien
59b5e45274 Merge "vndk-def: Add --check-apk to check-dep command" 2018-02-01 02:01:05 +00:00
Treehugger Robot
5c4b70c509 Merge "gsi_util: refactors Checker and VintfChecker" 2018-01-31 23:47:03 +00:00
Bowgo Tsai
3128bff672 gsi_util: adds sepolicy_checker
The sepolicy checker merges SEPolicy files from /system and
/vendor, /odm as the init process does when the device boots a GSI.
When the merge failed in init, the device will refuse to boot
Android OS and will jump to fastboot mode directly. It needs serial log
for diagnosis.

The action of SEPolicy merge can be done on host side, to do a trial
merge, prior to flash a GSI. The newly added sepolicy_checker is
designed for this.

Bug: 72069105
Test: m gsi_util
Test: gsi_util list_checks, output is 'vintf', 'sepolicy'
Test: gsi_util --debug check_compat --system $OUT/system.img --vendor adb sepolicy

Change-Id: I842067e447b96e2ba124f03f51831cd289f47dc1
2018-01-31 20:07:28 +08:00
Bowgo Tsai
97a65926d2 gsi_util: refactors Checker and VintfChecker
This change includes several refactoring:
  1. Adds more function/class comments.
  2. Renames the fields in namedtuples 'CheckListItem' and 'CheckResultItem'.
  3. Fixes the vintf check issue. It should do two checks:
     system -> vendor and vendor -> system, instead of one direction.
  4. Fixes import statements, should only import module or package name.
  5. Use python3-style print() function instead of print statement.
  6. Fix the missing 'import errno' in image_mounter.
  7. Checks *.py under 'checker' folder can pass 'pylint'.
     Disables the check for a given line if it cannot pass.
     e.g.,  pylint: disable=too-few-public-methods
  8. Changes 'summary' result from a string 'pass' to '#pass/#total'.

Bug: 70253825
Test: m gsi_util
Test: gsi_util --debug check_compat --system $OUT/system.img --vendor adb
Test: gsi_util --debug check_compat --system $OUT/system.img --vendor $OUT/vendor.img
Test: gsi_util check_compat --only-summary --system $OUT/system --vendor $OUT/vendor
Test: gsi_util --debug check_compat --system adb --vendor adb vintf
Change-Id: Ia08d1fbeee62f62667876b54778489c89e4228a1
2018-01-31 18:47:27 +08:00
Logan Chien
eed2296559 vndk-def: Add --check-apk to check-dep command
This commit adds --check-apk to check-dep command to discover the
JNI dependencies in the APK files.

Test: ./vndk_definition_tool.p check-dep --check-apk \
  --system ...  --vendor ... --tag-file ... --module-info ...

Bug: 71880346
Change-Id: Ie464f3e6f96ebc0c4d9dcdfc5513002f555e758b
2018-01-31 15:51:26 +08:00
Treehugger Robot
3f7d731fbd Merge "Support 'uses-permission.*' case" 2018-01-31 02:50:43 +00:00
Jayant Chowdhary
336b2ecfbb Merge "Don't diff records / enums already diffed through referenced type diffs." 2018-01-30 23:34:38 +00:00
Jayant Chowdhary
9c9a34b081 Don't diff records / enums already diffed through referenced type diffs.
This causes unnecessary verbosity in diff reports.

Test: The following:
  Without this change:
  header-abi-diff -arch arm64 -lib libcpp_referenced_records -old \
  tests/reference_dumps/arm64/libgolden_cpp.so.lsdump -new \
  tests/reference_dumps/arm64/libgolden_cpp_change_member_access.so.lsdump -o \
  unref_diff -check-all-apis; unref_diff has LowVolumeSpeaker as an
  unreferenced diff as well as a referenced diff.

  With this change:
  Run the same test command as above; unref_diff has LowVolumeSpeaker
  only as a referenced diff.

Change-Id: Iddb2ed2f759637f53b00fd1398395a1b1c207116
2018-01-30 13:45:51 -08:00
changho.shin
b7efebb0bb Support 'uses-permission.*' case
Some applications declare their privileged permission as 'uses-permission-sdk-23(m)',
not 'uses-permission'. Adding '.*' to current regex expression to cover all the cases.

Test: python development/tools/privapp_permissions/privapp_permissions.py

Change-Id: I1ea8c9361bb53035481418631b34607ffecb238c
Signed-off-by: changho.shin <changho.shin@lge.com>
2018-01-30 12:37:11 +09:00
Treehugger Robot
a553f9832c Merge "Remove root permission requirement" 2018-01-30 03:26:18 +00:00
Treehugger Robot
2c2e007276 Merge changes from topic "libc++abi"
* changes:
  Add libdl.a from prebuilts/ndk.
  Remove mips static libraries and crt sources.
2018-01-30 01:04:33 +00:00
Dan Albert
91e7e76a77 Add libdl.a from prebuilts/ndk.
We aren't quite ready to fully move to the new static libraries, but
we need libdl.a for using libc++ in a static executable (the unwinder
uses dladdr).

Test: ndk/checkbuild.py && ndk/run_tests.py
Bug: None
Change-Id: Ibc2ba4b27cc1fc1fb229719ea3c3c37cb8819fd3
2018-01-29 14:42:46 -08:00
Dan Albert
6127694c15 Remove mips static libraries and crt sources.
Test: ndk/checkbuild.py
Bug: None
Change-Id: Ic7ac690f9b8d63fb80f63a2ccd9ea76b040196d3
2018-01-29 14:42:13 -08:00
Treehugger Robot
fa565a60e0 Merge "Made privapp_permissions.py more dynamic." 2018-01-29 19:14:39 +00:00
Treehugger Robot
65f8b7218a Merge "Revise code of gsi_util help" 2018-01-29 18:43:56 +00:00
SzuWei Lin
c1496d986e Remove root permission requirement
The original solution to access the content in an image file is
'mount' which needs root permision. Replaces 'mount' with 'debugfs',
which does not need root permission and will be useful on server
side usage.

Bug: 72027809
Test: ./gsi_util.py pull --system system.img /system/build.prop
Change-Id: I7d6d7b75527cd144d55465353531597afa3baedb
2018-01-29 18:58:59 +08:00
SzuWei Lin
a07883696e Revise code of gsi_util help
The patch unifies the code of arguments '--vendor' and '--system',
and to be an argument group 'image sources'.

Bug: 64817940
Test: gsi_util.py for each commands and check the output
Change-Id: I591ef4b922f931b7ceaacc362979156ef830a54e
2018-01-29 14:31:17 +08:00
markdr
9066da53f5 Made privapp_permissions.py more dynamic.
This was done largely so automation can make use of
privapp-permissions.xml generation.

Privapp_permissions.py no longer requires the build environment
to be setup. Instead, system files can be pulled from a connected
device, and aapt & adb can be set via the commandline. Otherwise,
they will default to the environment's default aapt/adb.

Priv-apps and the permission lists can be queried from the device
using command flags as well, removing the need for an Android
image to be built locally.

Bug: None
Test: Diff between previous privapp_permissions output and the
      output for these changes was empty for the following runs:

      ./old_privapp_permissions.py
      vs
      ./new_privapp_permissions.py [-d && -s SERIAL]
      ./new_privapp_permissions.py --aapt /path/to/aapt

      ./old_privapp_permissions.py /path/to.apk
      vs
      ./new_privapp_permissions.py /path/to.apk
      ./new_privapp_permissions.py device:/path/to/apk

Change-Id: Ifaf35607d38c1d74111fd2f05628c0192fc791cb
2018-01-26 14:31:33 -08:00
Logan Chien
6151e1a1ad Merge changes from topic "def-tool-loadlib"
* changes:
  vndk-def: Scan vdex files for dependencies
  vndk-def: Fix is_zipfile() for Python 3.5
  vndk-def: Filter JNI libs for apk-deps
2018-01-26 03:41:16 +00:00
Logan Chien
20773fdfc2 vndk-def: Scan vdex files for dependencies
This commit scans vdex files for dependencies as well.  This commit is
necessary because some apk files or jar files are stripped, i.e. not
containing dex files.

Test: ./vndk_definition_tool.py apk-deps --system ... --vendor ...
Change-Id: I3f9009e0147d244c141f1f4e13369e23801a495a
2018-01-25 23:40:07 +08:00
Logan Chien
26e3d4aaaf vndk-def: Fix is_zipfile() for Python 3.5
Python 3.5 adopts a fancy algorithm to detect the zip file.  It will
search for the magic words in the file, i.e. magic word does not have to
be at the beginning.  This commit adds an extra check to make sure "PK",
the magic word for zip file, is at the beginning of the file.

Test: ./vndk_definition_tool.py apk-deps --system ... --vendor ...
Change-Id: I3e633709bc39187ae807aef97c6e0396d02266ea
2018-01-25 23:37:04 +08:00
Logan Chien
75d6cae1b8 vndk-def: Filter JNI libs for apk-deps
This commit adds a JNI lib filter to reduce the false positives that may
be found by apk-deps.

Test: ./tests/run.py
Test: ./vndk_definition_tool.py apk-deps --system ... --vendor ...
Change-Id: Ic5f1f55a3c92970aa5ddef9b5f6e53a33931d970
2018-01-25 23:32:46 +08:00
Logan Chien
7a56aa9fe7 Merge "vndk-def: Merge SP-NDK into LL-NDK" 2018-01-25 03:23:26 +00:00
Jayant Chowdhary
82e1d2f65e Merge "Do not dump records not visible outside a translation unit." 2018-01-25 00:31:58 +00:00
Jayant Chowdhary
d026c88b34 Do not dump records not visible outside a translation unit.
Also use non-mangled name for C structs and enums as their unique id.

We do this as attempt to protect against bugs similar to those mentioned
in https://android-review.googlesource.com/c/platform/external/clang/+/599002
which might not have been discovered yet.

Bug: 71486971

Test: Build android source tree for aosp_arm64_ab with -no-filter on
      header-abi-dumper.

Test: tests/test.py

Change-Id: I3e25425d9f3015cd7dece3bd5a27f88e050c1acb
2018-01-24 15:12:31 -08:00
Treehugger Robot
628484644a Merge "Additional fix for coversion from type-id to type-string." 2018-01-24 20:54:07 +00:00