Commit graph

9282 commits

Author SHA1 Message Date
Treehugger Robot
64dac049a6 Merge "check-flagged-apis: consider superclasses when looking up symbol" into main 2024-05-07 14:18:20 +00:00
Dennis Shen
260663ddfc Merge "aconfig: update storage file mapping api" into main 2024-05-07 14:10:47 +00:00
Mårten Kongstad
5413a1e55d Merge "check-flagged-apis: record super class when parsing classes" into main 2024-05-07 13:52:21 +00:00
Treehugger Robot
4925954a79 Merge changes Ia6dfcfa8,I8d93c230,I4db7ff47,I003535c7,I8c0619fa into main
* changes:
  check-flagged-apis: consider interfaces when looking up symbol
  check-flagged-apis: skip self-referential interfaces
  check-flagged-apis: record interfaces when parsing classes
  check-flagged-apis: add more details to Symbol class
  check-flagged-apis: api-versions.xml: correctly parse nested class ctor
2024-05-07 13:42:25 +00:00
Mårten Kongstad
e812039036 check-flagged-apis: consider superclasses when looking up symbol
If a symbol can't be found in a class, (recursively) check the class'
superclass before reporting the symbol as missing.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: I8ef1fbfcc51e0c5ba00959536c087213d688fe39
2024-05-07 13:28:54 +02:00
Mårten Kongstad
c3f05a6d92 check-flagged-apis: record super class when parsing classes
Extend ClassSymbol with a nullable reference to the class' superclass.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: Ia2741a4d7fb5de908a03ef640f5fcd38d0ce0e28
2024-05-07 13:28:53 +02:00
Mårten Kongstad
d2c707613e check-flagged-apis: consider interfaces when looking up symbol
When searching for potential errors, if a symbol can't be found in the
api-verions.xml data, check if it is present in any of the class'
interfaces.

A follow-up CL will add similar logic to handle super classes.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: Ia6dfcfa8495b89465db60f6a4eb77d304112046b
2024-05-07 13:28:53 +02:00
Mårten Kongstad
04d8b46c37 check-flagged-apis: skip self-referential interfaces
The return value of ClassItem.allInterfaces will sometimes include the
interface itself (e.g.
android.accessibilityservice.BrailleDisplayController). It is unclear
when this happens; it doesn't happen for the unit test.

Update the logic to record the interfaces for a class to filter out
interfaces named the same as the class.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Test: croot && ./build/tools/check-flagged-apis/check-flagged-apis.sh
Change-Id: I8d93c230dfedde30e8d43fefd560a47944085d3a
2024-05-07 13:16:13 +02:00
Mårten Kongstad
7c3571fe8b check-flagged-apis: record interfaces when parsing classes
Extend ClassSymbol with a list of the interfaces that class implements.
This will be used in a follow-up CL to improve the logic that checks if
a class member exists in the api-versions.xml data.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: I4db7ff47c3ce40ca892cb872810dd559426dfcb8
2024-05-07 13:16:13 +02:00
Mårten Kongstad
a1fe37137e check-flagged-apis: add more details to Symbol class
Change Symbol from a wrapper around a String to a more fleshed out data
class; symbols now encode if they represent a class, or a class member
(including a reference to the containing class).

Bug: 334870672
Test: atest --host check-flagged-apis-test
Test: croot && ./build/tools/check-flagged-apis/check-flagged-apis.sh # with and without this CL; the output should be the same
Change-Id: I003535c721c45d559d00fb3e008325e1db0e18c0
2024-05-07 13:16:13 +02:00
Mårten Kongstad
02525a88de check-flagged-apis: api-versions.xml: correctly parse nested class ctor
The constructor of a nested class is represented as follows in
api-versions.xml:

  <class name="android/Clazz$Foo$Bar" since="1">
    <method name="&lt;init>()V"/>
  </class>

The nested dollar signs are not replaced by forward slashes before the
parsing logic uses `split("/")` to find the name of the inner-most
class, incorrectly resulting in `Class$Foo$Bar` instead of `Bar`. Fix
this by immediately replacing dollar signs with forward slashes after
extracting the package and class.

Also clean up the following call of `Symbol.create`.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: I8c0619faae90ded7eb14dcc20ecb94a086a1c764
2024-05-07 13:16:13 +02:00
Jiyong Park
0a5b852656 Merge "Move fs_config_[files|dirs]_<partition> to soong" into main 2024-05-07 02:17:23 +00:00
Jooyung Han
5548c31901 Merge "Remove unused testdata" into main 2024-05-07 01:37:05 +00:00
Jiyong Park
8d6481b92c Move fs_config_[files|dirs]_<partition> to soong
Note that not all partitions are moved to Soong. Soong doesn't yet
support *_dlkm partitions and the oem partition.

This change also removes dead code for support VNDK snapshot.

Finally, as a minor clean up, the leading '_' is dropped from the module
names _fs_config_*. There's no need to hide the module names.

Bug: 337993745
Test: m
Change-Id: I5beec5c6734291b9361f870fc1a8dba19def062e
2024-05-07 08:50:10 +09:00
Dennis Shen
a49f1ba5c5 aconfig: update storage file mapping api
Return a pointer of MappedStorageFile/MutableMappedStorageFile instead
of an object of MappedStorageFile/MutableMappedStorageFile. Now added
destructor for MappedStorageFile/MutableMappedStorageFile to unmap the
in memory file to free up memory.

Bug: b/321077378
Test: atest -c
Change-Id: Iaa02696feb07ff383f0c7e46b645d82e57c38254
2024-05-06 17:25:59 +00:00
Paul Duffin
771a201f3d Use complete api-versions.xml for module-lib and system-server
Previously, the check-flagged-apis.sh script used `api-versions.xml`
for `module-lib` and `system-server` which did not include the
latest up-to-date information about updatable modules or historical
information about sdk extensions which lead to false positives for
APIs from those updatable modules. This changes switches to use the
`api-versions.xml` produced by the new `api_versions_*_complete`
modules which does include that information.

Bug: 337836752
Test: Run script before and after applying this change to make sure
      that flagged APIs from updatable modules are no longer
      reported as missing.
Change-Id: If09e89a4595a19d9f00390fb5fbd24330ec11be5
2024-05-03 12:13:32 +01:00
Mårten Kongstad
22063d0670 check-flagged-apis.sh: speed up build step
Instead of building the entire SDK, explicitly build the
api-versions.xml files.

Bug: 334870672
Test: croot && build/tools/check-flagged-apis/check-flagged-apis.sh
Change-Id: Ib165c0acd4766ad3000aaf17220050d5e66ddf2c
2024-05-03 10:05:03 +02:00
Mårten Kongstad
a57d0ef0a1 Merge "check-flagged-apis.sh: use correct path to generated API signature files" into main 2024-05-03 06:53:52 +00:00
Inseob Kim
ab47e15dd1 Merge changes from topic "merge_cc_logtags" into main
* changes:
  Add LOCAL_SOONG_LOGTAGS_FILES
  Add python Soong modules for logtags
2024-05-03 05:10:23 +00:00
Jooyung Han
d6a9631d8b Remove unused testdata
com.android.apex.compressed.v1_original is removed.

Bug: 338157001
Test: releasetools_test
Change-Id: Icd4fe958f260640a541e9843efa64e85036542ed
2024-05-03 11:49:55 +09:00
Treehugger Robot
c039204466 Merge "check-flagged-apis: suppress unused variable warning" into main 2024-05-02 19:01:48 +00:00
Treehugger Robot
83705ef7d1 Merge "check-flagged-apis: add support for method with parameters" into main 2024-05-02 18:59:48 +00:00
Daniel Zheng
76f13d280c Merge "create_brick_ota: logic fix" into main 2024-05-02 18:10:51 +00:00
Treehugger Robot
7bff3a85f9 Merge "Add * support products and modules" into main 2024-05-02 18:07:48 +00:00
Daniel Zheng
7e4cc58f2d create_brick_ota: logic fix
ota_metadata should be initialized outside of the if block.

Bug: 3072303
Test: th
Change-Id: Iabe52be3557c71921586d960d8a8a91c33d5558b
2024-05-02 09:55:45 -07:00
Mårten Kongstad
b9ce4c92e0 check-flagged-apis.sh: use correct path to generated API signature files
The path to the generated API signature files used with --api-signature
in the check-flagged-apis.sh script are different based on the lunch
target used: sometimes it's under $ANDROID_PRODUCT_OUT, other times
under out/target/product/mainline_x86.

Teach check-flagged-apis.sh to dynamically find the correct path by
querying ninja.

Bug: 334870672
Test: croot && build/tools/check-flagged-apis/check-flagged-apis.sh
Change-Id: I1b0b41ef3ad1bc7113a3b31323d81251e7e65933
2024-05-02 14:30:56 +02:00
Mårten Kongstad
cd93aeb947 check-flagged-apis: suppress unused variable warning
Bug: 334870672
Test: m check-flagged-apis # verify no Lint warnings
Change-Id: If4fb93703f0f0bf3f27e6ec052cf488796bd717e
2024-05-02 14:01:12 +02:00
Mårten Kongstad
b4a14bfaa9 check-flagged-apis: add support for method with parameters
Teach check-flagged-apis to parse methods containing parameters.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: I171660b914b73fd85e03ed9300c2c81f33d80d61
2024-05-02 09:53:54 +02:00
Mårten Kongstad
ece054c856 check-flagged-apis: change internal format
Switch the internal format to represent Symbols to (something close to)
the format described in section 4.3.2 of the JVM spec, i.e.

  com/android/SomeClass/someMethod(II[Ljava/lang/String;)Z

This will make parsing method parameters from api-versions.xml easier,
as that file already uses this format, and converting API signature
files to the same format is less painful than going in the other
direction.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: I1e1fb8fe208cd51cce2cc129f5aa1cb495672c16
2024-05-02 09:50:33 +02:00
Inseob Kim
f441f7d8fd Add python Soong modules for logtags
Bug: 336189540
Test: m out/soong/.intermediates/all-event-log-tags.txt
Test: m out/target/common/obj/all-event-log-tags
Change-Id: Iae336a05bb2f27564b0bf8d4ea3753a30be89e90
2024-05-02 13:51:34 +09:00
Ted Bauer
daa3c71739 Merge "Update dependencies for new aconfig flag storage" into main 2024-05-01 15:37:20 +00:00
Ted Bauer
4560e3ae8f Update dependencies for new aconfig flag storage
Bug: 328444881
Test: m
Change-Id: I3685a74e9e93a6ecb89a054e243b48b67f470d55
2024-04-30 23:57:51 +00:00
Dennis Shen
c0102331c8 Merge "aconfig: add a new aconfig storage file flag listing api" into main 2024-04-30 23:06:18 +00:00
Dennis Shen
45c94c6421 aconfig: add a new aconfig storage file flag listing api
added a new function called list_flag_with_info to list all the flags
given all four storage files (package.map, flag.map, flag.val, flag.info).
also exported this api thru cxx interface so aconfigd can use it.

Bug: b/312444587
Test: atest -c
Change-Id: Ibbfe657b980d40e25e5e28962b930338192e2d98
2024-04-30 17:52:44 +00:00
Ted Bauer
ced25ac630 Merge "Add cc_defaults containing libs needed for static linking" into main 2024-04-30 01:20:21 +00:00
Treehugger Robot
15967616ca Merge "Add tool to determine if products can be lunched" into main 2024-04-29 23:57:36 +00:00
Ted Bauer
d724dd04e2 Add cc_defaults containing libs needed for static linking
Bug: 328444881
Test: m
Change-Id: I35cbce94301415381b3ad38d7e5c697f9c010856
2024-04-29 23:41:52 +00:00
Fabián Cañas
29252f8001 Add tool to determine if products can be lunched
This could aid in cleaning unmaintained products from manifests.

Change-Id: Ic1ae4d62711cf27f17c1e4c770f64db074768fd5
Test: lunchable
2024-04-29 22:58:11 +00:00
Treehugger Robot
faeac4d7f7 Merge "Drive instrumentation with build flag" into main 2024-04-29 21:26:55 +00:00
Michael Wright
c791547786 Merge "check-flagged-apis: remove debug print" into main 2024-04-29 20:29:51 +00:00
Michael Wright
cfbcdc1ec5 Merge changes Ia860d7b0,Ie98db767 into main
* changes:
  check-flagged-apis: allow / chars in Symbol names
  check-flagged-apis: add support for methods (no parameters)
2024-04-29 20:29:35 +00:00
Ted Bauer
d19d351148 Drive instrumentation with build flag
Bug: 328444881
Test: m
Change-Id: Iebb250e8a836c77b14fcc6b9536eba90f9da7a4b
2024-04-29 20:12:27 +00:00
Treehugger Robot
80c40c4d91 Merge "FakeFeatureFlagsImpl optionally takes defaults via a FeatureFlags." into main 2024-04-29 16:53:28 +00:00
Ted Bauer
d475818504 Merge "Read from new storage in C++ aconfig codegen" into main 2024-04-29 16:47:45 +00:00
Mårten Kongstad
9aef0d9bda check-flagged-apis: remove debug print
Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: Ida3ba78bc240b5aed2382bf5a0ea12e8d1e1d763
2024-04-29 10:35:28 +02:00
Mårten Kongstad
8d74fd0a31 check-flagged-apis: allow / chars in Symbol names
Allow forward slash characters (/) in Symbol names: when adding support
for method arguments, this will be needed.

The current implementation does not change; forward slash conversions to
dots still happen, but now explicitly at the call site of Symbol.create.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: Ia860d7b0c8703fcc56fec6ea722cf995ccf20cd0
2024-04-28 00:50:11 +02:00
Jeff DeCew
23fbd1e2f6 FakeFeatureFlagsImpl optionally takes defaults via a FeatureFlags.
Bug: 337449122
Flag: test_only
Test: presubmit
Change-Id: I45e2a523b36a6b14627c89ee7deffda711a32f5e
2024-04-27 18:08:45 +00:00
Zhuoyao Zhang
836b9e1ba9 Merge "Add a Clearcut tool event logger" into main 2024-04-27 02:39:21 +00:00
Zhuoyao Zhang
7b11b7106a Add a Clearcut tool event logger
Implement a binary that logs tool events to Clearcut. The binary is designed to be eventually called by the `run_tool_with_logging` script in the `envsetup.sh` script that sets up the build environment.

Only start and stop events are currently logged for each invocation.

Test: atest tool_event_logger_test
bug: 331638854
Change-Id: I9268e4cb986975ceda171204e6ce8ef1732eaeea
2024-04-27 01:01:50 +00:00
Mårten Kongstad
40da97047c check-flagged-apis: add support for methods (no parameters)
Teach check-flagged-apis to parse methods. The implementation is only
half done: method signatures that accept parameters are ignored. A
follow-up CL will add support for these.

check-flagged-apis treats constructors and regular methods the same.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: Ie98db767289ac2a35aa85371f60ecb3970170d86
2024-04-27 01:51:08 +02:00