Commit graph

8698 commits

Author SHA1 Message Date
Ted Bauer
efda207c09 Revert "Cache Java codegen'd flags in static member variables."
This reverts commit afe55106e5.

Reason for revert: causes a bug b/311187402

Change-Id: Ic3f56fbb66a6412cd702cebd9e4247032f950324
2023-11-15 16:52:02 +00:00
Ted Bauer
afe55106e5 Cache Java codegen'd flags in static member variables.
By caching flag values directly in member variables instead of caching
a HashMap and accessing that, flag reads avoid `hashCode()`, map
lookup, and Boolean.parse runtime costs. Flag reads are turning out
to have performance problems in hot paths, so this should help to
alleviate that.

Bug: 309625014
Test: m
Change-Id: I923bf6af2ae3fcbbf2fee7126b492a47cd6049ad
2023-11-14 12:02:01 -05:00
Justin Yun
136fa83d4e Merge "Define BOARD_API_LEVEL and BOARD_API_LEVEL_FROZEN" into main 2023-11-13 23:40:06 +00:00
Treehugger Robot
534b47bc8e Merge "Require scl files in ExecutionModeScl" into main 2023-11-13 21:39:12 +00:00
Cole Faust
6309234411 Require scl files in ExecutionModeScl
Also remove json from scl file builtins, as it's not in bazel.

Bug: 309686282
Test: Presubmits
Change-Id: I6227c5dc14922b4682380254b4716b4ae38c47b9
2023-11-13 11:47:30 -08:00
Zi Wang
2b09495e2a Merge "Update test: true to mode: "test"" into main 2023-11-13 19:23:55 +00:00
Justin Yun
23d52435f3 Define BOARD_API_LEVEL and BOARD_API_LEVEL_FROZEN
BOARD_API_LEVEL and BOARD_API_LEVEL_FROZEN are set by the release
flags.
BOARD_API_LEVEL sets ro.board.api_level that shows the API level of
the vendor API surface.
BOARD_API_LEVEL_FROZEN sets ro.board.api_frozen that shows if the
ro.board.api_level is finalized.

Bug: 295269182
Test: getprop ro.board.api_level
Change-Id: Ie57c57b6c9f1fc0c98968195843059a48da8e512
2023-11-10 16:31:04 +09:00
Zi Wang
0ab8a96dcf Update test: true to mode: "test"
Test: CI

Bug: 309990433
Change-Id: I31644510002560fd81c41fbe37f0872fc1135390
2023-11-09 16:33:39 -08:00
Treehugger Robot
124101862b Merge "Prevent using symlinks to starlark files" into main 2023-11-10 00:00:41 +00:00
Cole Faust
ccd26808af Prevent using symlinks to starlark files
Symlinks are frequently confusing / a source of bugs. They also don't
provide much utility over just loading the other file and re-exporting
its symbols, so recommend doing that instead.

Test: Presubmits
Change-Id: Ie3052ebc0add77f1746d6321fbdf7bc15df9819b
2023-11-09 14:32:55 -08:00
Dennis Shen
05585a9fa3 Merge changes from topic "rust_caching" into main
* changes:
  aconfig: Cache flag values for rust codegen
  aconfig: Cache flag values for c/c++ codegen
2023-11-09 20:03:42 +00:00
Dennis Shen
737b8e30a1 aconfig: Cache flag values for rust codegen
Bug: b/307336730
Test: atest aconfig.test
Change-Id: I01741a4205cbe4e9b007f43b043505bcbcf05cd8
2023-11-09 15:15:54 +00:00
Abhishek Nigam
1dfca46094 Revert "Move more non-AB code to separate files"
This reverts commit 513b86e5c2.

Change-Id: I6aae60642772a052404eb1773966b2e637864bbc
2023-11-08 22:29:18 +00:00
Abhishek Nigam
b148ac22f8 Revert "Fix non-AB ota generation failure"
This reverts commit 782b752889.

bug: 308932171
tested: locally generated and applied ota on nonab device
Change-Id: I67b26be01d6240b2cb332e13bc7c7959de128755
2023-11-08 22:29:18 +00:00
Dennis Shen
96506f4349 aconfig: Cache flag values for c/c++ codegen
Bug: b/307336730
Test: atest aconfig.test
Change-Id: Id604cf154d09a48f657277af6d799f0e17bc4e93
2023-11-08 19:19:35 +00:00
Treehugger Robot
bf25b080d6 Merge "Generate incremental OTAs for 16K/4K boot option" into main 2023-11-08 00:11:41 +00:00
Cole Faust
5b8dda087d Only allow .scl files to load other .scl files
.scl files are starlark configuraiont language files, which is starlark
without any of the bazel buildin symbols.

This is to match bazel's behavior, and it doesn't make sense for
scl files to load bzl files.

We should change all the release config bzl files to scl, and then
also make it so that when using executionModeScl you can only load
scl files.

Test: go test
Change-Id: I196bcf3a4548118791ed1d47c2d37e46a1ef86c4
2023-11-07 11:27:41 -08:00
Kelvin Zhang
65c1162eb5 Generate incremental OTAs for 16K/4K boot option
Previously, the 16K/4K boot options OTAs are full OTAs, resulting in
file size of ~20MB each, and ~40M for both OTAs. To reduce the space
usage, use incremental OTAs instead.

Test: th
Bug: 302759296
Bug: 293313353
Change-Id: I61cc84c6c13f151dd6bc5ff37dd31daa5fb31abd
2023-11-06 12:37:49 -08:00
Oriol Prieto Gascó
8b1d74ec60 Merge "Revert^2 "aconfig: cache flag value in generated java code"" into main 2023-11-01 21:56:38 +00:00
Kelvin Zhang
8c9166ae37 Convert partition size to int before CheckSize
Test: th
Change-Id: Ic312e40fdad99afd65b4fc259395b8952bb038c6
2023-11-01 10:14:13 -07:00
Kelvin Zhang
9f9ac4e8a0 Fix prebuilt boot image hermetic build
Break when we find a working salt, certain devices have boot image
containing both the kernel and ramdisk, resulting in the ramdisk being
used as salt. Since core/Makefile uses kernel as salt, update python
code to match.

Bug: 293313353
Test: th
Change-Id: I68b5a8c2f0747ddf68f775bc2a6c5db46eb7eb64
2023-11-01 10:14:13 -07:00
Zhi Dou
72c2a93006 Revert^2 "aconfig: cache flag value in generated java code"
This reverts commit 257f64347d.

Reason for revert: fix in Roboletric will subimt together with this change

Change-Id: I03c9ed627e6a4153db9c9074daf821ea6d19bc33
2023-11-01 16:42:31 +00:00
Kelvin Zhang
782b752889 Fix non-AB ota generation failure
Test: ota generation on pinot target
Bug: 308615740
Change-Id: I8b540516c0ba9e3acb23eebad8569a6dbf2ef9f3
2023-10-31 19:42:39 -07:00
Dan Shi
d22a5558f4 Merge "Remove EXTRA_TEST_RUNNER_CONFIGS option in template for autogen instrumentation test" into main 2023-11-01 00:56:21 +00:00
Dan Shi
042bb8c6dc Remove EXTRA_TEST_RUNNER_CONFIGS option in template for autogen instrumentation test
Instrumentation test config created by autogen is still using python script
auto_gen_test_config.py, which doesn't support extra_runner_options yet.

Bug: 308627607
Test: m FrameworksCorePackageInstallerSessionsTests
Change-Id: Ib3bef791a9d1b3e0b68f5845dc20d2c5ec5791ec
2023-10-31 15:44:16 -07:00
Treehugger Robot
a8d60eb042 Merge "Move more non-AB code to separate files" into main 2023-10-31 17:47:23 +00:00
Kelvin Zhang
513b86e5c2 Move more non-AB code to separate files
non-AB has different lifetime and development cycles from AB. To avoid
accidentally breaking each other when making changes, put non-AB code in
its own files.

Test: local non-AB OTA generation
Bug: 296485685

Merged-In: I0736ecef343834c746464666a454a8bfcd4a20ea

Change-Id: I0736ecef343834c746464666a454a8bfcd4a20ea
2023-10-30 23:43:15 +00:00
Wei Li
52c2ea6a18 Merge "Generate SBOM of .kcm files in layoutlib." into main 2023-10-30 17:37:09 +00:00
Dave Mankoff
9d9d6556dc Merge "Let aconfig protos be read by FlagFlipper" into main 2023-10-30 15:27:33 +00:00
Zhi Dou
257f64347d Revert "aconfig: cache flag value in generated java code"
This reverts commit 3dea629a9e.

Reason for revert: b/308228560

Change-Id: I6511def2e53ab793c5fd78f65bea14eeebc5cdb2
2023-10-30 13:24:31 +00:00
Zhi Dou
3dea629a9e aconfig: cache flag value in generated java code
This change add cache in generated jave code to improve the performance.

The cache is a DeviceConfig.Properties. One Properties contains all
flag values from the given namesapce.

The Properties for a given namespace is initialized as null, and the
first call for any flags in that Properties will trigger the call to
fetch all the values. After the first call, the flag values are stored
in the Properties, so the following calls will directly get the value
from the Properties instead from the backup storage.

Test: atest aconfig.test.java
Bug: 307511846
Change-Id: Ic43626101c28099199b6faa419cf1945bd53b15d
2023-10-27 23:53:09 +00:00
Dave Mankoff
0e0c3dec70 Let aconfig protos be read by FlagFlipper
Bug: 307526764
Test: manually built
Change-Id: I689a15cc8c97a814df6f8e45bcf7f732d1693835
Merged-In: I689a15cc8c97a814df6f8e45bcf7f732d1693835
2023-10-27 18:43:50 +00:00
Kelvin Zhang
2ab6986dd9 Make non-ab code path compatible with extracted target files
Bug: 296485685
Test: ota_from_target_files -v -i non_ab.zip non_ab.zip ota.zip
Change-Id: I13ed54bfe7d14d2d1e87f45564da465a77bc2d1d
2023-10-27 11:01:27 -07:00
Wei Li
ee4ab5359d Generate SBOM of .kcm files in layoutlib.
Bug: 303905932
Test: CIs; m layoutlib dist
Change-Id: Iab35c44bdfff7ea82734a8efd37dfa005bae2664
2023-10-25 15:49:26 -07:00
Kelvin Zhang
160762a276 Use deterministic salt for AVB footer of prebuilt boot img
When target specified a prebuilt boot.img, current build system will add
avb hash footer to it with a random salt. Use a deterministic salt
instead for more reproducible builds. To stay consistent with
non-prebuilt boot.img code path, we extract the kernel image from
prebuilt boot.img and uses sha256sum of kernel image as the salt.

Test: th
Bug: 293313353
Change-Id: I988999ddc4f18e0b8677b05a3165c847b6a11b52
2023-10-25 13:28:11 -07:00
Kelvin Zhang
9d74128194 Allow -v option to change log level
Setting logging level to 'NOTSET' would tell logging module to inherit
logging level from handlers. Since the verbosity of handlers is
controlled by -v option, this allows sign_apex.py to give verbose output
if -v is specified.

Test: th
Bug: 307191956
Change-Id: I9c1db107cf4eae80ab570d892b0465b3902298fd
2023-10-24 21:58:28 -07:00
Wei Li
420d7d5878 Merge "Initial implementation of layoutlib SBOM generation." into main 2023-10-24 17:11:20 +00:00
Zhi Dou
79a45fa178 Merge "overrideflags: change local override list name" into main 2023-10-23 20:55:15 +00:00
Zhi Dou
b66973688e overrideflags: change local override list name
Change local override list name to "ACONFIG_VALUES_LIST_LOCAL".

Bug: 298692416
Test: source build/envsetup.sh && overrideflags, and then check the
output

Change-Id: I6c2b8dcf6291a1fd7012e714fa91ca6bf0b47cf2
2023-10-23 18:19:29 +00:00
Kelvin Zhang
9e348cfc6b Merge "Allow OEMs to bypass the on device SPL downgrade check" into main 2023-10-23 18:17:59 +00:00
Kelvin Zhang
d51332c82f Allow OEMs to bypass the on device SPL downgrade check
Certain OEMs bootloader implementation allow SPL downgrade. Allow on
device SPL downgrade check to be bypassed.

Test: th
Bug: 306271739
Change-Id: Iba991e12d36291e2d0547c94ef54c750d87f35fb
2023-10-23 10:10:33 -07:00
Zhi Dou
8817eed1af change path to shell_utils.sh
Bug: 298692416
Test: source build/envsetup.sh && overrideflags, and then check the
output

Change-Id: Idf254b66da17079db2d08e98a9914e1c2f9f6097
2023-10-23 13:41:07 +00:00
LaMont Jones
6aa030026c Merge "add script to help override flag value locally" into main 2023-10-20 22:24:24 +00:00
Zhi Dou
77c9f0c9cb add script to help override flag value locally
Add a script to help to create flag value building rules.

The script will only extract necessary information from the value file
but it will not validate the file. The validation will defer to building
system.

For input

```
flag_value {
    package: "com.android.aconfig.test"
    name: "disabled_ro"
    state: DISABLED
    permission: READ_ONLY
}
flag_value {
    package: "com.android.demoapp.test"
    name: "enabled_ro"
    state: DISABLED
    permission: READ_WRITE
}
flag_value {
    package: "com.android.aconfig.test"
    name: "enabled_rw"
    state: ENABLED
    permission: READ_WRITE
}
```

The output Android.bp file will be like
```
VALUE_LIST_LIST = [
    aconfig-local-com.android.demoapp.test,
    aconfig-local-com.android.aconfig.test
]

aconfig_values {
    name: "aconfig-local-com.android.demoapp.test",
    package: "com.android.demoapp.test",
    srcs: [
        "override_values.textproto",
    ]
}

aconfig_values {
    name: "aconfig-local-com.android.aconfig.test",
    package: "com.android.aconfig.test",
    srcs: [
        "override_values.textproto",
    ]
}
```

Bug: 298692416
Test: source build/envsetup.sh && overrideflags, and then check the
output

Change-Id: Ife4063e079811e0b29046be7a6bc127cad668ed0
2023-10-20 21:04:00 +00:00
Juan Yescas
4d136f5265 Merge "16k: Sign the APKs to support 4k/16k page sizes" into main 2023-10-20 04:09:43 +00:00
Juan Yescas
5c6b6f24a3 16k: Sign the APKs to support 4k/16k page sizes
The page agnostic targets have to support 4k/16k page sizes. For
these targets, the APKs have to be aligned at 16k boundaries.

Bug: 302343940
Test: source build/envsetup.sh
      lunch aosp_cf_arm64_phone_pgagnostic
      m
      launch_cvd -userdata_format=ext4
Change-Id: Ia0e39a90c0d6a3e62d450157fdfd5e3ee36d346e
2023-10-20 03:13:39 +00:00
Wei Li
ee7365981e Merge "Support third_party.identifier in METADATA files of external packages." into main 2023-10-20 01:48:33 +00:00
Thiébaud Weksteen
ed5abbdea4 Merge "Revert "Add sign_sepolicy_path for a binary to sign sepolicy.apex."" into main 2023-10-19 22:48:25 +00:00
Sandeep Dhavale
cc1a560241 Merge "Add support for specifying erofs blocksize" into main 2023-10-19 21:46:58 +00:00
Wei Li
427dacb239 Support third_party.identifier in METADATA files of external packages.
Bug: 303688820
Test: CIs
Test: "m sbom" after lunch
Change-Id: Ic329d87cdcfbe4152b0fe6a8fd71c4867593b674
2023-10-18 16:45:31 -07:00