Commit Graph

8601 Commits

Author SHA1 Message Date
Treehugger Robot
8370a90e0f Merge "Move auto_gen_test_config.py to argparse." into main am: badadf9c4b
Original change: https://android-review.googlesource.com/c/platform/build/+/2756029

Change-Id: Ifd79709be40665ddd7fdc9c62bfc74d917bf3b92
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-20 10:30:50 +00:00
Jingwen Chen
4bccadd460 Move auto_gen_test_config.py to argparse.
Follow up to aosp/2752414

Test: atest-dev auto_gen_test_config_test
Change-Id: I401c6213f0ed5e97eb97b1c603a8b6c5286f0d88
2023-09-19 06:36:19 +00:00
Jingwen Chen
20ebf61214 Merge "Make auto_gen_test_config available to Bazel." into main am: 84b5bb9139
Original change: https://android-review.googlesource.com/c/platform/build/+/2752414

Change-Id: I733ef23456e96bb888b94bd440dab7706eb380d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-19 00:04:46 +00:00
Jingwen Chen
f3406e64f7 Make auto_gen_test_config available to Bazel.
In the Bazel rule, the actual AndroidManifest.xml file isn't available
in the providers of the android_binary dependency. And for good reason,
we should also rely on aapt2 to dump the manifest contents from the
final packaged APK anyway, but this auto gen script doesn't support
reading the output of aapt2 dump.

This CL adds a simple reader of the output of `aapt2 dump xmltree`, and
enabled if the xmltree content is passed to this tool instead of
AndroidManifest.xml.

Also fixup auto_gen_test_config_test.py. The test was completely failing.

Test: atest auto_gen_test_config_test
Test: presubmits

Change-Id: I7fecd927d0ed7847b6463d964b3698f4164b0177
2023-09-18 12:34:29 +00:00
Treehugger Robot
ca8e0fba2a Merge "Respect framework partition set while merging meta files" into main am: b25e443bc5
Original change: https://android-review.googlesource.com/c/platform/build/+/2749885

Change-Id: Ib22c0f6680d7cc30909dd975faebeae9d066bda2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-15 19:08:12 +00:00
Treehugger Robot
b25e443bc5 Merge "Respect framework partition set while merging meta files" into main 2023-09-15 17:52:17 +00:00
Dennis Song
36ce326f95 Respect framework partition set while merging meta files
The framework_partition_set would be generated from
framework_item_list and we should respect this partition
set while merging META/ab_partitions.txt.

This is to handle the case when we use a complete merged
target files package as the framework-target-files, where
its ab_partitions.txt may have non-framework partitions.
So we need to filter them out to prevent from the merged
meta file has some partitions that don't exist.

Test: merge_target_files &&
        add_img_to_target_files &&
	img_from_target_files &&
	flash device
Bug: 300193612
Change-Id: I0a76d706a20dcaffa2533278db7383563f03ec02
2023-09-15 06:20:19 +00:00
Zhi Dou
093793c8d7 Merge "aconfig: throw exception if reading from DeviceConfig fails" into main am: c20d115562
Original change: https://android-review.googlesource.com/c/platform/build/+/2751666

Change-Id: I2cd0def3e284c39230780e9c8a8bb60debce3bb9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 19:52:38 +00:00
Treehugger Robot
fe1cb899b2 Merge "aconfig: Fix missing header in the generated c/cpp code" into main am: 2cb7622dca
Original change: https://android-review.googlesource.com/c/platform/build/+/2752628

Change-Id: If1cd7c0f6f62b1ee0ab41f673d648ed6cd6f0566
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-14 19:52:21 +00:00
Zhi Dou
c20d115562 Merge "aconfig: throw exception if reading from DeviceConfig fails" into main 2023-09-14 19:28:16 +00:00
Dennis Shen
a1de8fd435 aconfig: Fix missing header in the generated c/cpp code
Test: atest aconfig.test
Change-Id: I0c23299ad366cb5c61b84b738dd9e6bf3428435c
2023-09-14 17:40:13 +00:00
Zhi Dou
73a34ce10a aconfig: throw exception if reading from DeviceConfig fails
Reading value from DeviceConfig may fail if the provider is not ready.
Since DeciceConfig, and Settings class are static wrapper on top of
the provider, it won't cause the instance  initialization issue.
Thus when the issue happens it means the provider is not initialized.

Test: atest aconfig.test.java and manually make a change in the
framework and check the exception message
Bug: 299471646

Change-Id: Ic08d7a9cd32a8810a7274b6d93c249abccb50b9e
2023-09-14 13:00:45 +00:00
Cole Faust
a1e610a819 Merge "Change default logging level to WARNING" into main am: 386470f7d7
Original change: https://android-review.googlesource.com/c/platform/build/+/2748498

Change-Id: Ie6a43959c180245efbeb513fad67da919b2447fb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 21:17:35 +00:00
Cole Faust
386470f7d7 Merge "Change default logging level to WARNING" into main 2023-09-13 20:22:22 +00:00
Mårten Kongstad
7fca45d34a Merge "aconfig: explicitly @hide FLAG_ constants" into main am: 65d19d1403
Original change: https://android-review.googlesource.com/c/platform/build/+/2748397

Change-Id: I82cd8383c2578a30cfb1b25dd9000345537a560a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-13 13:04:51 +00:00
Mårten Kongstad
fb10840da5 aconfig: explicitly @hide FLAG_ constants
Because of a bug in metalava [1], the flag constants are incorrectly
considered not-hidden when metalava generates the API signature files.
This means the FLAG_ constant name will be used, instead of the FLAG_
constant value, which is what we want.

While waiting for b/300211291 to be fixed, explicitly mark the FLAG_
constants as hidden (and keep marking the classes as such).

This CL can be reverted when b/300211291 is fixed.

1. Item.isHiddenOrRemoved does not check if its parent item is hidden,
   tracked in b/300211291

Bug: 297881670
Test: atest aconfig.test aconfig.test.java
Change-Id: I05de8344ccb424bee51c39f9609489ad312397ce
2023-09-13 10:15:01 +02:00
Cole Faust
98142f8446 Change default logging level to WARNING
To avoid spam in the build.

Test: Presubmits
Change-Id: I45db6cd92babda7f83582fd438210cae02c54708
2023-09-12 17:39:47 -07:00
Daniel Zheng
df05d52d18 Merge "Turn on fastboot-info for img_from_target_files" into main am: d6178ee812
Original change: https://android-review.googlesource.com/c/platform/build/+/2747057

Change-Id: I5354fff420dddb8998a81c8ab1132462460cc200
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 22:08:24 +00:00
Daniel Zheng
d6178ee812 Merge "Turn on fastboot-info for img_from_target_files" into main 2023-09-11 21:05:36 +00:00
Cole Faust
ab7ddf8f20 Merge "Clean staging dirs in build_image.py" into main am: 548775d247
Original change: https://android-review.googlesource.com/c/platform/build/+/2746998

Change-Id: I6f1b97ba49fe1bb083ec9d520b5955bbd8580efe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 18:07:50 +00:00
Cole Faust
548775d247 Merge "Clean staging dirs in build_image.py" into main 2023-09-11 17:25:19 +00:00
Daniel Zheng
89a85ba933 Turn on fastboot-info for img_from_target_files
Use fastboot-info for fastboot update

Test: m update_package
Bug: 299854419
Change-Id: I9f7c93f8309a2c136ee81cad1391f93b2feb8156
2023-09-11 09:58:32 -07:00
Mårten Kongstad
6644d9fbe7 Merge "Revert "Revert "aconfig: @hide generated Java code""" into main am: 72c3b38a1d
Original change: https://android-review.googlesource.com/c/platform/build/+/2745644

Change-Id: I8af4c28f0388bafa543112a406a2082b6a0b9814
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 14:53:43 +00:00
Mårten Kongstad
72c3b38a1d Merge "Revert "Revert "aconfig: @hide generated Java code""" into main 2023-09-11 14:08:55 +00:00
Treehugger Robot
bd427b16e4 Merge "aconfig: remove unnecessary clones" into main am: 1ee8f4d232
Original change: https://android-review.googlesource.com/c/platform/build/+/2745641

Change-Id: I56c58fc168543e844c723d0bbcd29f6b15fa4d51
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 13:17:34 +00:00
Treehugger Robot
1ee8f4d232 Merge "aconfig: remove unnecessary clones" into main 2023-09-11 12:51:17 +00:00
Mårten Kongstad
65efa27f71 Revert "Revert "aconfig: @hide generated Java code""
This reverts commit c0e8ffea41.

Reason for revert: The detected build breakage was unrelated to the aconfig change. Details in b/297881670#comment11.

Change-Id: Ia32bc2e796ed3de7fa049c2c2db340f4325a2853
2023-09-11 12:17:25 +00:00
Mårten Kongstad
fa7b2ec189 Merge "Revert "aconfig: @hide generated Java code"" into main am: 4afc5d7b2b
Original change: https://android-review.googlesource.com/c/platform/build/+/2745642

Change-Id: Ib64656b57b1d7118a4718c41f46857b9c694db33
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 11:45:00 +00:00
Mårten Kongstad
e1b7b7a500 Merge "aconfig: @hide generated Java code" into main am: fd6cd13947
Original change: https://android-review.googlesource.com/c/platform/build/+/2745699

Change-Id: Ie4496b863a6452365847d814284c31de18d56d84
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-11 11:44:41 +00:00
Mårten Kongstad
4afc5d7b2b Merge "Revert "aconfig: @hide generated Java code"" into main 2023-09-11 11:06:14 +00:00
Mårten Kongstad
c0e8ffea41 Revert "aconfig: @hide generated Java code"
This reverts commit 379e09d157.

Reason for revert: Seems to have broken the build. Reverting while investigating.

Change-Id: I37c9a065853ef07b1f1c18355205a2f49dd816c4
2023-09-11 11:00:42 +00:00
Mårten Kongstad
fd6cd13947 Merge "aconfig: @hide generated Java code" into main 2023-09-11 10:44:23 +00:00
Mårten Kongstad
b5133f6ad4 aconfig: remove unnecessary clones
Improve performance slightly: remove unnecessary clone operations, or
use references where a new object is not needed.

Bug: 283910447
Test: atest aconfig.test
Change-Id: I75205ffa1723dd2654039baac882c225d2653c86
2023-09-11 11:10:21 +02:00
Mårten Kongstad
379e09d157 aconfig: @hide generated Java code
Flagged APIs are annotated using `@FlaggedApi(Flags.FLAG_NAME)`, where
Flags.FLAG_NAME was auto-generated by aconfig.

When metalava generates an API signature file, it can either

  a) insert the value of the constant ("com.foo.bar.flag_name"), or
  b) insert the name of the constant (FLAG.NAME)

In the case of @FlaggedApi, we want a). This requires that

  x) metlava has access to the definition of the constant while generating the API signature file, and
  y) the constant is not part of the API surface of the API signature file

x) is handled by the build system, y) is handled by the aconfig code
generation.

This CL @hide:s all generated Java code, to make sure it is accessible
within the platform, but never part of any API surface.

Bug: 297881670
Test: atest aconfig.test aconfig.test.java
Change-Id: I328ed1a652a4e5e293f2f4b11f916d29fc2fbcbd
2023-09-11 10:31:46 +02:00
Cole Faust
152cdfab7c Clean staging dirs in build_image.py
build_image.py now accepts a --input-directory-filter-file argument
that contains a list of files to consider from the input directory.
A new, temporary input directory will be created, and only the
considered files will be copied to it.

This removes most of the need for `m installclean`, as old files or
files built manually will no longer end up on the partition.

Bug: 205632228
Test: Presubmits
Change-Id: I07e0bf8e840abf0b51a2fdf67b758905fb3c5b5b
2023-09-08 16:24:26 -07:00
Treehugger Robot
7677eb46cd Merge "Add per partition timestamp to 16K boot OTA" into main am: 6f0db025d0
Original change: https://android-review.googlesource.com/c/platform/build/+/2744293

Change-Id: I96a6db27c937060b3c374802921590598693ecf0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 22:54:42 +00:00
Treehugger Robot
6f0db025d0 Merge "Add per partition timestamp to 16K boot OTA" into main 2023-09-08 22:25:29 +00:00
Firman Prayoga
e4a3296f1d Merge "Revert "Clean staging dirs in build_image.py"" into main am: 44d86b138b
Original change: https://android-review.googlesource.com/c/platform/build/+/2746515

Change-Id: Ibe31fc87779099b74bb20625ce1ee931907d0708
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-08 04:31:46 +00:00
Firman Prayoga
44d86b138b Merge "Revert "Clean staging dirs in build_image.py"" into main 2023-09-08 04:06:57 +00:00
Firman Prayoga
df21706765 Revert "Clean staging dirs in build_image.py"
Revert submission 2736954-proper_installclean

Reason for revert: Potential culprit for build breakage b/299545346

Reverted changes: /q/submissionid:2736954-proper_installclean

Change-Id: I2b0671bd40b7a74ef02923a777ec899401691454
2023-09-08 01:24:45 +00:00
Treehugger Robot
cb4bb177bd Merge "[zip] Set all entry times before 1980 to 1980-01-01" into main am: 05a03698b7
Original change: https://android-review.googlesource.com/c/platform/build/+/2744613

Change-Id: I5435006901820b183b2530d4c178d864ded77296
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-07 19:52:10 +00:00
Treehugger Robot
05a03698b7 Merge "[zip] Set all entry times before 1980 to 1980-01-01" into main 2023-09-07 18:54:47 +00:00
Cole Faust
8af587010b Merge "Clean staging dirs in build_image.py" into main am: c383825953
Original change: https://android-review.googlesource.com/c/platform/build/+/2736954

Change-Id: I8731127af428888c1be3035c0e9f3244964ab7e3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-07 17:18:12 +00:00
Cole Faust
c383825953 Merge "Clean staging dirs in build_image.py" into main 2023-09-07 16:41:45 +00:00
Mark Punzalan
0d7190b413 [zip] Set all entry times before 1980 to 1980-01-01
Before this change, entry times before 1980 had the year changed to 1980
but the month/day/hour/minutes/seconds were all kept as-is.

Bug: 277978832
Test: atest zipalign_tests
Change-Id: I9f87e98a6b985002578490b87c654fee86c65d62
2023-09-06 21:44:40 +00:00
Kelvin Zhang
b5661d6ef5 Add per partition timestamp to 16K boot OTA
update_engine requiers per partition timestamp if this partition's build
prop includes build.date.utc.

Test: th
Bug: 293313353
Change-Id: I6bf3de8e855f0830b26bdbe2cbdc78ba891662a7
2023-09-06 13:02:19 -07:00
Treehugger Robot
8b0299785e Merge "Use localtime_r() on Windows too." into main am: 2462269f1f
Original change: https://android-review.googlesource.com/c/platform/build/+/2741081

Change-Id: I69aaad5de1db6ebfc204a41a29034a8dc4f6779b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06 18:57:56 +00:00
Cole Faust
48b81e7386 Clean staging dirs in build_image.py
build_image.py now accepts a --input-directory-filter-file argument
that contains a list of files to consider from the input directory.
A new, temporary input directory will be created, and only the
considered files will be copied to it.

This removes most of the need for `m installclean`, as old files or
files built manually will no longer end up on the partition.

Bug: 205632228
Test: Presubmits
Change-Id: I4c82ac7f1ed49a37271755749c8f72afeeb7f295
2023-09-06 11:51:13 -07:00
Treehugger Robot
2462269f1f Merge "Use localtime_r() on Windows too." into main 2023-09-06 18:12:22 +00:00
Zhi Dou
a5b2b5d6a8 Merge "aconfig: flag java lib enable optimization" into main am: 58fd788f51
Original change: https://android-review.googlesource.com/c/platform/build/+/2741013

Change-Id: Ide04bb0809d46e45dcb044b2c05e6d4860e3c4c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-09-06 13:30:20 +00:00