aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
7 hoursMerge "Revert "Drop cmdgoals special case from prebuilt selection"" into mainHEADmastermainTreehugger Robot
8 hoursMerge "Restrict aconfig version script to linux" into mainTreehugger Robot
9 hoursRevert "Drop cmdgoals special case from prebuilt selection"Spandan Das
This reverts commit e18b9fee63c1ad00398b56b378e650bd073e67f6. Reason for revert: Likely causing build failures for go/ab/git_aosp-main-with-phones Change-Id: If01f58908bd66c7afa42b9c96d048dfcd2d70812
9 hoursMerge "Drop cmdgoals special case from prebuilt selection" into mainTreehugger Robot
11 hoursDrop cmdgoals special case from prebuilt selectionSpandan Das
Before trunk stable, this check ensured that `docs` and `sdk` builds contained all the apis provided by an apex. If source apex was used, it would use the source java_sdk_library. If prebuilt apex was used, it would use the prebuilt java_sdk_library. After trunk stable, all release configurations for platform development use the everything stubs of source java_sdk_library for javac, and exportable stubs of source java_sdk_library for sdk/docs. The exportable stubs is aware of the enabled flags for a specific release configuration. Since sdk and docs builds use the exportable stubs, we can drop this special case to use the prebuilt stubs/srcjar files. Test: presubmits Test: in internal, lunch cf_x86_64_phone-next-userdebug (currently uses bt prebuilts) Test: m docs Test: aninja -t path docs out/soong/.intermediates/packages/modules/Bluetooth/framework/framework-bluetooth.stubs.source/android_common/exportable/framework-bluetooth.stubs.source-stubs.srcjar; still exists after this cl Bug: 308188056 Change-Id: I65da9f25634f0e8c3d514a4c175f89c3e5eb9712
11 hoursRestrict aconfig version script to linuxJared Duke
Avoid breakage on other platforms. Bug: 336657207 Test: m Change-Id: I167dbbe934a133e8f08f630846707870404f62fd
12 hoursMerge "Make system_server.zip compatible with prebuilt apex builds" into mainSpandan Das
12 hoursMerge "Use a version script for libaconfig_storage_read_api_cc" into mainTreehugger Robot
13 hoursMerge "Generate CustomFeatureFlags" into mainJeff DeCew
14 hoursUse a version script for libaconfig_storage_read_api_ccJared Duke
Restrict the set of exported symbols to those in the aconfig_storage namespace by way of a version script. This shrinks the shared lib size by ~75%, from ~800KB to <200KB. Bug: 336657207 Test: m Change-Id: I56044fe667a713cf1d94f96c992f379a5725850f
15 hoursMerge "Allow setting --boot_variable_file in build-ota-package-target" into mainBen Fennema
15 hoursMake system_server.zip compatible with prebuilt apex buildsSpandan Das
This artifact contains the system server jars that were used in the build. At ToT, this was disabled when prebuilts were enabled to prevent version skew between the system server jars built from source, and the system server jars deapexed from the prebuilt apex that was installed into the system image. With this CL, this artifact is now compatible with prebuilts. If a google prebuilt apex is used, system_server.zip will contain the .jar deapexed from that prebuilt. e.g. if art _and_ btservices prebuilts are enabled, then system_server.zip will contain the prebuilt jars for those apexes, and sources for others. This implementation leverages the fact that soong copies the _selected_ system server jars to out/soong/system_server_dexjars for dex2oat. Soong is aware of source/prebuilts, and populates this directory with the correct system server jar. One side effect of this change is that affects the directory structure of the zip. Previously, service-art.jar will be present in the zip file at apex/com.android.art/java/service-art.jar. After this change service-art.jar will be present in the top-level directory of the zip Bug: 308188056 Test: the zip is not bit-identical, but I checked that the file contents are indentical (discussed below) Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.before Test: unzip out/target/product/vsoc_x86_64/system_server.zip.before -d system_server.after Test: find system_server.before/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: find system_server.after/ -type f -printf '%s\t%p\n' | sort -n | cut -f2- | xargs cat | shasum Test: the shasums are identical Test: in internal, lunch cf_x86_64_phone-next-userdebug (next uses bt prebuilts) Test: m nothing Test: aninja -t path out/target/product/vsoc_x86_64/system_server.zip <vendor_dir_path>/BluetoothGooglePrebuilt/com.google.android.btservices.apks; path exists Change-Id: I213150b7ee2b012fd649b308f3c72bebf5ca7bf8
16 hoursAllow setting --boot_variable_file in build-ota-package-targetBen Fennema
For ota generation via build-ota-package-target, match how --oem_settings works, but for --boot_variable_file. Bug: 335732867 Test: Set BOOT_VAR_OTA_CONFIG, make dist, and check ota_metadata Change-Id: I526e2b280eb288f3abaace2a5daac97a0f7ac6d7
19 hoursMerge "check-flagged-apis: parse classes" into mainMichael Wright
19 hoursMerge "check-flagged-apis: add missing requireNotNull" into mainMichael Wright
28 hourscheck-flagged-apis: parse classesMårten Kongstad
Teach check-flagged-apis to parse classes, including inner classes. Bug: 334870672 Test: atest --host check-flagged-apis-test Change-Id: I17f65d3af55a20a1920b47f4c47fd0e92f9fa852
28 hourscheck-flagged-apis: add missing requireNotNullMårten Kongstad
Bug: 334870672 Test: atest --host check-flagged-apis-test Change-Id: Ibffafb504240c82d525105d4678983b30b70592d
30 hoursMerge "Add license metadata declarations which are moved from ↵Wei Li
device/google/gs101/Android.mk." into main
31 hoursMerge "Build audio_effects.xml with Soong" into mainInseob Kim
32 hoursMerge "Define trendy_team_adte under build/make" into mainZhuoyao Zhang
33 hoursDefine trendy_team_adte under build/makeZhuoyao Zhang
trendy_team_adte was defined under tools/asuite, this causes build error for builds that does not contain that project. Move the definition to build/make so it is avaialve for all builds. Test: None Change-Id: I965d460ef556027c0c7dc6dc0ec3434d8898d4b7
37 hoursAdd license metadata declarations which are moved from ↵Wei Li
device/google/gs101/Android.mk. Bug: 310058310 Test: CIs Change-Id: Ie49bce281879ed49482a9a43791b3839328348fa
39 hoursMerge "Allow boot_variable_file to be read from input_target_files" into mainBen Fennema
39 hoursAllow boot_variable_file to be read from input_target_filesBen Fennema
If boot_variable_file is not found locally, look for it inside input_target_files. Bug: 335732867 Test: generate OTA with file in target-files.zip and verify metadata Change-Id: I2e61f50850e82a3795f2e0e1aefcaf2329a8cfb1
39 hoursMerge "Prune unnecessary symbols from read API" into mainTed Bauer
40 hoursMerge "aconfig: update aconfig storage write api and test update" into mainDennis Shen
40 hoursPrune unnecessary symbols from read APITed Bauer
Bug: 328444881 Test: m Change-Id: I3b730a6c3390a5d116d467f15f17e74a9096961d
42 hoursaconfig: update aconfig storage write api and test updateDennis Shen
Simplify storage write api so that we don't need the storage records pb file. Bug: b/312444587 Test: atest -c Change-Id: I7e336b1d7766983364715dae15786b91b0c0743f
2 daysMerge "Add license metadata declarations which are moved from ↵Wei Li
device/google/coral/Android.mk." into main
2 daysMerge "Add appcompat system properties flag to soong" into mainTreehugger Robot
2 daysMerge "Allow specifying load order for 16K kernel modules" into mainTreehugger Robot
3 daysAdd license metadata declarations which are moved from ↵Wei Li
device/google/coral/Android.mk. Bug: 336592724 Test: CIs Change-Id: Ifa586648ec2d25cc4f122ad84894e21fc8acebe5
3 daysGenerate CustomFeatureFlagsJeff DeCew
* Creates a new general-purpose CustomFeatureFlags class * Simplifies FakeFeatureFlagsImpl to be based on that * This allows teams to fake FeatureFlags without having to make changes per flag. * This allows SetFlagsRule to inject an instance of FeatureFlags that would detect if a flag has been read. Bug: 336768870 Flag: none Test: presubmit Change-Id: Id3c2530d484fa5584c46d11381fcfc0ab294f33f NOTE FOR REVIEWERS - original patch and result patch are not identical. PLEASE REVIEW CAREFULLY. Diffs between the patches: "CustomFeatureFlags.java", > + include_str!("../../templates/CustomFeatureFlags.java.template"), > + )?; > + template.add_template( > - ["Flags.java", "FeatureFlags.java", "FeatureFlagsImpl.java", "FakeFeatureFlagsImpl.java"] > - .iter() > - .map(|file| { > - Ok(OutputFile { > - contents: template.render(file, &context)?.into(), > - path: path.join(file), > - }) > - }) > - .collect::<Result<Vec<OutputFile>>>() > + [ > + "Flags.java", > + "FeatureFlags.java", > + "FeatureFlagsImpl.java", > + "CustomFeatureFlags.java", > + "FakeFeatureFlagsImpl.java", > + ] > + .iter() > + .map(|file| { > + Ok(OutputFile { contents: template.render(file, &context)?.into(), path: path.join(file) }) > + }) > + .collect::<Result<Vec<OutputFile>>>() > - const EXPECTED_FAKEFEATUREFLAGSIMPL_CONTENT: &str = r#" > + const EXPECTED_CUSTOMFEATUREFLAGS_CONTENT: &str = r#" > + > - import java.util.HashMap; > - import java.util.Map; > + import java.util.List; > + import java.util.function.BiPredicate; > + import java.util.function.Predicate; > + > - public class FakeFeatureFlagsImpl implements FeatureFlags { > - public FakeFeatureFlagsImpl() { > - resetAll(); > + public class CustomFeatureFlags implements FeatureFlags { > + > + private BiPredicate<String, Predicate<FeatureFlags>> mGetValueImpl; > + > + public CustomFeatureFlags(BiPredicate<String, Predicate<FeatureFlags>> getValueImpl) { > + mGetValueImpl = getValueImpl; > + > - return getValue(Flags.FLAG_DISABLED_RO); > + return getValue(Flags.FLAG_DISABLED_RO, > + FeatureFlags::disabledRo); > - return getValue(Flags.FLAG_DISABLED_RW); > + return getValue(Flags.FLAG_DISABLED_RW, > + FeatureFlags::disabledRw); > - return getValue(Flags.FLAG_DISABLED_RW_EXPORTED); > + return getValue(Flags.FLAG_DISABLED_RW_EXPORTED, > + FeatureFlags::disabledRwExported); > - return getValue(Flags.FLAG_DISABLED_RW_IN_OTHER_NAMESPACE); > + return getValue(Flags.FLAG_DISABLED_RW_IN_OTHER_NAMESPACE, > + FeatureFlags::disabledRwInOtherNamespace); > - return getValue(Flags.FLAG_ENABLED_FIXED_RO); > + return getValue(Flags.FLAG_ENABLED_FIXED_RO, > + FeatureFlags::enabledFixedRo); > - return getValue(Flags.FLAG_ENABLED_FIXED_RO_EXPORTED); > + return getValue(Flags.FLAG_ENABLED_FIXED_RO_EXPORTED, > + FeatureFlags::enabledFixedRoExported); > - return getValue(Flags.FLAG_ENABLED_RO); > + return getValue(Flags.FLAG_ENABLED_RO, > + FeatureFlags::enabledRo); > - return getValue(Flags.FLAG_ENABLED_RO_EXPORTED); > + return getValue(Flags.FLAG_ENABLED_RO_EXPORTED, > + FeatureFlags::enabledRoExported); > - return getValue(Flags.FLAG_ENABLED_RW); > + return getValue(Flags.FLAG_ENABLED_RW, > + FeatureFlags::enabledRw); > - public void setFlag(String flagName, boolean value) { > - if (!this.mFlagMap.containsKey(flagName)) { > - throw new IllegalArgumentException("no such flag " + flagName); > - } > - this.mFlagMap.put(flagName, value); > - } > - public void resetAll() { > - for (Map.Entry entry : mFlagMap.entrySet()) { > - entry.setValue(null); > - } > - } > + > + > - private boolean getValue(String flagName) { > - Boolean value = this.mFlagMap.get(flagName); > - if (value == null) { > - throw new IllegalArgumentException(flagName + " is not set"); > - } > - return value; > + > + protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) { > + return mGetValueImpl.test(flagName, getter); > - private Map<String, Boolean> mFlagMap = new HashMap<>( > - Map.ofEntries( > - Map.entry(Flags.FLAG_DISABLED_RO, false), > - Map.entry(Flags.FLAG_DISABLED_RW, false), > - Map.entry(Flags.FLAG_DISABLED_RW_EXPORTED, false), > - Map.entry(Flags.FLAG_DISABLED_RW_IN_OTHER_NAMESPACE, false), > - Map.entry(Flags.FLAG_ENABLED_FIXED_RO, false), > - Map.entry(Flags.FLAG_ENABLED_FIXED_RO_EXPORTED, false), > - Map.entry(Flags.FLAG_ENABLED_RO, false), > - Map.entry(Flags.FLAG_ENABLED_RO_EXPORTED, false), > - Map.entry(Flags.FLAG_ENABLED_RW, false) > - ) > - ); > + > + public List<String> getFlagNames() { > + return Arrays.asList( > + Flags.FLAG_DISABLED_RO, > + Flags.FLAG_DISABLED_RW, > + Flags.FLAG_DISABLED_RW_EXPORTED, > + Flags.FLAG_DISABLED_RW_IN_OTHER_NAMESPACE, > + Flags.FLAG_ENABLED_FIXED_RO, > + Flags.FLAG_ENABLED_FIXED_RO_EXPORTED, > + Flags.FLAG_ENABLED_RO, > + Flags.FLAG_ENABLED_RO_EXPORTED, > + Flags.FLAG_ENABLED_RW > + ); > + } > + > + const EXPECTED_FAKEFEATUREFLAGSIMPL_CONTENT: &str = r#" > + package com.android.aconfig.test; > + > + import java.util.HashMap; > + import java.util.Map; > + import java.util.function.Predicate; > + > + /** @hide */ > + public class FakeFeatureFlagsImpl extends CustomFeatureFlags { > + private Map<String, Boolean> mFlagMap = new HashMap<>(); > + > + public FakeFeatureFlagsImpl() { > + super(null); > + // Initialize the map with null values > + for (String flagName : getFlagNames()) { > + mFlagMap.put(flagName, null); > + } > + } > + > + @Override > + protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) { > + Boolean value = this.mFlagMap.get(flagName); > + if (value == null) { > + throw new IllegalArgumentException(flagName + " is not set"); > + } > + return value; > + } > + > + public void setFlag(String flagName, boolean value) { > + if (!this.mFlagMap.containsKey(flagName)) { > + throw new IllegalArgumentException("no such flag " + flagName); > + } > + this.mFlagMap.put(flagName, value); > + } > + > + public void resetAll() { > + for (Map.Entry entry : mFlagMap.entrySet()) { > + entry.setValue(null); > + } > + } > + } > + "#; > + > + "com/android/aconfig/test/CustomFeatureFlags.java", > + EXPECTED_CUSTOMFEATUREFLAGS_CONTENT, > + ), > + ( > - let expect_fake_feature_flags_impl_content = r#" > + let expect_custom_feature_flags_content = r#" > + > - import java.util.HashMap; > - import java.util.Map; > + import java.util.List; > + import java.util.function.BiPredicate; > + import java.util.function.Predicate; > + > - public class FakeFeatureFlagsImpl implements FeatureFlags { > - public FakeFeatureFlagsImpl() { > - resetAll(); > + public class CustomFeatureFlags implements FeatureFlags { > + > + private BiPredicate<String, Predicate<FeatureFlags>> mGetValueImpl; > + > + public CustomFeatureFlags(BiPredicate<String, Predicate<FeatureFlags>> getValueImpl) { > + mGetValueImpl = getValueImpl; > + > - return getValue(Flags.FLAG_DISABLED_RW_EXPORTED); > + return getValue(Flags.FLAG_DISABLED_RW_EXPORTED, > + FeatureFlags::disabledRwExported); > - return getValue(Flags.FLAG_ENABLED_FIXED_RO_EXPORTED); > + return getValue(Flags.FLAG_ENABLED_FIXED_RO_EXPORTED, > + FeatureFlags::enabledFixedRoExported); > - return getValue(Flags.FLAG_ENABLED_RO_EXPORTED); > + return getValue(Flags.FLAG_ENABLED_RO_EXPORTED, > + FeatureFlags::enabledRoExported); > - public void setFlag(String flagName, boolean value) { > - if (!this.mFlagMap.containsKey(flagName)) { > - throw new IllegalArgumentException("no such flag " + flagName); > - } > - this.mFlagMap.put(flagName, value); > + > + protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) { > + return mGetValueImpl.test(flagName, getter); > - public void resetAll() { > - for (Map.Entry entry : mFlagMap.entrySet()) { > - entry.setValue(null); > - } > + > + public List<String> getFlagNames() { > + return Arrays.asList( > + Flags.FLAG_DISABLED_RW_EXPORTED, > + Flags.FLAG_ENABLED_FIXED_RO_EXPORTED, > + Flags.FLAG_ENABLED_RO_EXPORTED > + ); > - private boolean getValue(String flagName) { > - Boolean value = this.mFlagMap.get(flagName); > - if (value == null) { > - throw new IllegalArgumentException(flagName + " is not set"); > - } > - return value; > - } > - private Map<String, Boolean> mFlagMap = new HashMap<>( > - Map.ofEntries( > - Map.entry(Flags.FLAG_DISABLED_RW_EXPORTED, false), > - Map.entry(Flags.FLAG_ENABLED_FIXED_RO_EXPORTED, false), > - Map.entry(Flags.FLAG_ENABLED_RO_EXPORTED, false) > - ) > - ); > + > + "com/android/aconfig/test/CustomFeatureFlags.java", > + expect_custom_feature_flags_content, > + ), > + ( > - expect_fake_feature_flags_impl_content, > + EXPECTED_FAKEFEATUREFLAGSIMPL_CONTENT, > + "com/android/aconfig/test/CustomFeatureFlags.java", > + EXPECTED_CUSTOMFEATUREFLAGS_CONTENT, > + ), > + ( > - let expect_fakefeatureflags_content = r#" > + let expect_customfeatureflags_content = r#" > + > - import java.util.HashMap; > - import java.util.Map; > + import java.util.List; > + import java.util.function.BiPredicate; > + import java.util.function.Predicate; > + > - public class FakeFeatureFlagsImpl implements FeatureFlags { > - public FakeFeatureFlagsImpl() { > - resetAll(); > + public class CustomFeatureFlags implements FeatureFlags { > + > + private BiPredicate<String, Predicate<FeatureFlags>> mGetValueImpl; > + > + public CustomFeatureFlags(BiPredicate<String, Predicate<FeatureFlags>> getValueImpl) { > + mGetValueImpl = getValueImpl; > + > - return getValue(Flags.FLAG_DISABLED_RO); > + return getValue(Flags.FLAG_DISABLED_RO, > + FeatureFlags::disabledRo); > - return getValue(Flags.FLAG_DISABLED_RW); > + return getValue(Flags.FLAG_DISABLED_RW, > + FeatureFlags::disabledRw); > - return getValue(Flags.FLAG_DISABLED_RW_IN_OTHER_NAMESPACE); > + return getValue(Flags.FLAG_DISABLED_RW_IN_OTHER_NAMESPACE, > + FeatureFlags::disabledRwInOtherNamespace); > - return getValue(Flags.FLAG_ENABLED_FIXED_RO); > + return getValue(Flags.FLAG_ENABLED_FIXED_RO, > + FeatureFlags::enabledFixedRo); > - return getValue(Flags.FLAG_ENABLED_RO); > + return getValue(Flags.FLAG_ENABLED_RO, > + FeatureFlags::enabledRo); > - return getValue(Flags.FLAG_ENABLED_RW); > + return getValue(Flags.FLAG_ENABLED_RW, > + FeatureFlags::enabledRw); > - public void setFlag(String flagName, boolean value) { > - if (!this.mFlagMap.containsKey(flagName)) { > - throw new IllegalArgumentException("no such flag " + flagName); > - } > - this.mFlagMap.put(flagName, value); > - } > - public void resetAll() { > - for (Map.Entry entry : mFlagMap.entrySet()) { > - entry.setValue(null); > - } > - } > + > + > - private boolean getValue(String flagName) { > - Boolean value = this.mFlagMap.get(flagName); > - if (value == null) { > - throw new IllegalArgumentException(flagName + " is not set"); > - } > - return value; > + > + protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) { > + return mGetValueImpl.test(flagName, getter); > - private Map<String, Boolean> mFlagMap = new HashMap<>( > - Map.ofEntries( > - Map.entry(Flags.FLAG_DISABLED_RO, false), > - Map.entry(Flags.FLAG_DISABLED_RW, false), > - Map.entry(Flags.FLAG_DISABLED_RW_IN_OTHER_NAMESPACE, false), > - Map.entry(Flags.FLAG_ENABLED_FIXED_RO, false), > - Map.entry(Flags.FLAG_ENABLED_RO, false), > - Map.entry(Flags.FLAG_ENABLED_RW, false) > - ) > - ); > + > + public List<String> getFlagNames() { > + return Arrays.asList( > + Flags.FLAG_DISABLED_RO, > + Flags.FLAG_DISABLED_RW, > + Flags.FLAG_DISABLED_RW_IN_OTHER_NAMESPACE, > + Flags.FLAG_ENABLED_FIXED_RO, > + Flags.FLAG_ENABLED_RO, > + Flags.FLAG_ENABLED_RW > + ); > + } > + > + > - ("com/android/aconfig/test/FakeFeatureFlagsImpl.java", expect_fakefeatureflags_content), > + ("com/android/aconfig/test/CustomFeatureFlags.java", expect_customfeatureflags_content), > + ( > + "com/android/aconfig/test/FakeFeatureFlagsImpl.java", > + EXPECTED_FAKEFEATUREFLAGSIMPL_CONTENT, > + ), > --- /dev/null > +++ tools/aconfig/aconfig/templates/CustomFeatureFlags.java.template > +package {package_name}; > + > +{{ if not library_exported- }} > +// TODO(b/303773055): Remove the annotation after access issue is resolved. > +import android.compat.annotation.UnsupportedAppUsage; > +{{ -endif }} > +import java.util.Arrays; > +import java.util.HashSet; > +import java.util.List; > +import java.util.Set; > +import java.util.function.BiPredicate; > +import java.util.function.Predicate; > + > +/** @hide */ > +public class CustomFeatureFlags implements FeatureFlags \{ > + > + private BiPredicate<String, Predicate<FeatureFlags>> mGetValueImpl; > + > + public CustomFeatureFlags(BiPredicate<String, Predicate<FeatureFlags>> getValueImpl) \{ > + mGetValueImpl = getValueImpl; > + } > + > +{{ -for item in flag_elements}} > + @Override > +{{ if not library_exported }} @UnsupportedAppUsage{{ -endif }} > + public boolean {item.method_name}() \{ > + return getValue(Flags.FLAG_{item.flag_name_constant_suffix}, > + FeatureFlags::{item.method_name}); > + } > +{{ endfor }} > + > +{{ -if not library_exported }} > + public boolean isFlagReadOnlyOptimized(String flagName) \{ > + if (mReadOnlyFlagsSet.contains(flagName) && > + isOptimizationEnabled()) \{ > + return true; > + } > + return false; > + } > + > + @com.android.aconfig.annotations.AssumeTrueForR8 > + private boolean isOptimizationEnabled() \{ > + return false; > + } > +{{ -endif }} > + > + protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) \{ > + return mGetValueImpl.test(flagName, getter); > + } > + > + public List<String> getFlagNames() \{ > + return Arrays.asList( > + {{ -for item in flag_elements }} > + Flags.FLAG_{item.flag_name_constant_suffix} > + {{ -if not @last }},{{ endif }} > + {{ -endfor }} > + ); > + } > + > + private Set<String> mReadOnlyFlagsSet = new HashSet<>( > + Arrays.asList( > + {{ -for item in flag_elements }} > + {{ -if not item.is_read_write }} > + Flags.FLAG_{item.flag_name_constant_suffix}, > + {{ -endif }} > + {{ -endfor }} > + ""{# The empty string here is to resolve the ending comma #} > + ) > + ); > +} > --- tools/aconfig/aconfig/templates/FakeFeatureFlagsImpl.java.template > +++ tools/aconfig/aconfig/templates/FakeFeatureFlagsImpl.java.template > -{{ if not library_exported- }} > -// TODO(b/303773055): Remove the annotation after access issue is resolved. > -import android.compat.annotation.UnsupportedAppUsage; > -{{ -endif }} > -import java.util.Arrays; > + > -import java.util.HashSet; > -import java.util.Set; > +import java.util.function.Predicate; > -public class FakeFeatureFlagsImpl implements FeatureFlags \{ > +public class FakeFeatureFlagsImpl extends CustomFeatureFlags \{ > + private Map<String, Boolean> mFlagMap = new HashMap<>(); > + > - resetAll(); > + super(null); > + // Initialize the map with null values > + for (String flagName : getFlagNames()) \{ > + mFlagMap.put(flagName, null); > + } > -{{ for item in flag_elements}} > -{{ if not library_exported }} @UnsupportedAppUsage{{ -endif }} > - public boolean {item.method_name}() \{ > - return getValue(Flags.FLAG_{item.flag_name_constant_suffix}); > + protected boolean getValue(String flagName, Predicate<FeatureFlags> getter) \{ > + Boolean value = this.mFlagMap.get(flagName); > + if (value == null) \{ > + throw new IllegalArgumentException(flagName + " is not set"); > + } > + return value; > -{{ endfor}} > + > -{{ if not library_exported }} > - public boolean isFlagReadOnlyOptimized(String flagName) \{ > - if (mReadOnlyFlagsSet.contains(flagName) && > - isOptimizationEnabled()) \{ > - return true; > - } > - return false; > - } > - > - @com.android.aconfig.annotations.AssumeTrueForR8 > - private boolean isOptimizationEnabled() \{ > - return false; > - } > -{{ -endif }} > - private boolean getValue(String flagName) \{ > - Boolean value = this.mFlagMap.get(flagName); > - if (value == null) \{ > - throw new IllegalArgumentException(flagName + " is not set"); > - } > - return value; > - } > - > - > - private Map<String, Boolean> mFlagMap = new HashMap<>( > - Map.ofEntries( > - {{ -for item in flag_elements }} > - Map.entry(Flags.FLAG_{item.flag_name_constant_suffix}, false) > - {{ -if not @last }},{{ endif }} > - {{ -endfor }} > - ) > - ); > - > - private Set<String> mReadOnlyFlagsSet = new HashSet<>( > - Arrays.asList( > - {{ -for item in flag_elements }} > - {{ -if not item.is_read_write }} > - Flags.FLAG_{item.flag_name_constant_suffix}, > - {{ -endif }} > - {{ -endfor }} > - ""{# The empty string here is to resolve the ending comma #} > - ) > - ); Original patch: diff --git a/tools/aconfig/aconfig/src/codegen/java.rs b/tools/aconfig/aconfig/src/codegen/java.rs old mode 100644 new mode 100644 --- a/tools/aconfig/aconfig/src/codegen/java.rs +++ b/tools/aconfig/aconfig/src/codegen/java.rs @@ -63,21 +63,28 @@ "FeatureFlags.java", include_str!("../../templates/FeatureFlags.java.template"), )?; + template.add_template( + "CustomFeatureFlags.java", + include_str!("../../templates/CustomFeatureFlags.java.template"), + )?; template.add_template( "FakeFeatureFlagsImpl.java", include_str!("../../templates/FakeFeatureFlagsImpl.java.template"), )?; let path: PathBuf = package.split('.').collect(); - ["Flags.java", "FeatureFlags.java", "FeatureFlagsImpl.java", "FakeFeatureFlagsImpl.java"] - .iter() - .map(|file| { - Ok(OutputFile { - contents: template.render(file, &context)?.into(), - path: path.join(file), - }) - }) - .co [[[Original patch trimmed due to size. Decoded string size: 26318. Decoded string SHA1: 7db34b7baf0a0bbaa1cff48b6ccab9c65408e743.]]] Result patch: diff --git a/tools/aconfig/aconfig/src/codegen/java.rs b/tools/aconfig/aconfig/src/codegen/java.rs index 18a4be5..9abc892 100644 --- a/tools/aconfig/aconfig/src/codegen/java.rs +++ b/tools/aconfig/aconfig/src/codegen/java.rs @@ -64,20 +64,27 @@ include_str!("../../templates/FeatureFlags.java.template"), )?; template.add_template( + "CustomFeatureFlags.java", + include_str!("../../templates/CustomFeatureFlags.java.template"), + )?; + template.add_template( "FakeFeatureFlagsImpl.java", include_str!("../../templates/FakeFeatureFlagsImpl.java.template"), )?; let path: PathBuf = package.split('.').collect(); - ["Flags.java", "FeatureFlags.java", "FeatureFlagsImpl.java", "FakeFeatureFlagsImpl.java"] - .iter() - .map(|file| { - Ok(OutputFile { - contents: template.render(file, &context)?.into(), - path: path.join(file), - }) - }) - .collect::<Result<Vec<OutputFile>>> [[[Result patch trimmed due to size. Decoded string size: 26308. Decoded string SHA1: bb07ee948a630a6bc4cfbbf2a8df178f3e6d3103.]]] Change-Id: I94184633303b9d76f7943451fb3b2c93d071ec1c
3 daysMerge "Add --unused parameter to whichgit" into mainFabián Cañas
3 daysMerge "Make check-flagged-apis executable" into mainTreehugger Robot
3 daysMerge "Adding avatar picker to install on all platform phones and tablets" ↵Anna Bauza
into main
3 daysMerge "Drop INDIVIDUALLY_TOGGLEABLE_PREBUILT_MODULES" into mainTreehugger Robot
3 daysAdd --unused parameter to whichgitFabián Cañas
The --unused parameter inverts the output of whichgit, reporting which git projects are not used for a given build target. Test: build/make/tools/whichgit --unused Test: build/make/tools/whichgit --unused --modules framework Existing use-cases should remain unchanged: Test: build/make/tools/whichgit --modules framework Change-Id: Ia4e55a5cb0331d522fed76821fe813ef98c25a67
3 daysDrop INDIVIDUALLY_TOGGLEABLE_PREBUILT_MODULESSpandan Das
This list is used to create soong config namespaces per toggle-able module, and set source_build property. internal and partner branches now use RELEASE_APEX_CONTRIBUTIONS_* for source vs selection, so remove this mechanism to prevent confusing behaviors when these two mechanisms have conflicting values. `art_module.source_build` is a special-case which uses an additional variable `ART_MODULE_SOURCE_BUILD`. This will be tracked in https://r.android.com/3037396 Bug: 308188056 Test: presubmits Test: downloaded this CL in v-aml branch, m out/soong/prebuilt_info.json; file is identical Merged-In: I3f9cbb24d6f3a7a0312683906826708147f469ee Change-Id: I3f9cbb24d6f3a7a0312683906826708147f469ee
3 daysMake check-flagged-apis executableMichael Wright
Occasionally sourcing the script would close my overall shell when it hit an error. By having it just be an executable script, this prevents it from impacting a user's normal shell environment and can depend on it always being bash, rather than whatever shell people happen to be using. Bug: 334870672 Test: tools/check-flagged-apis/check-flagged-apis.sh Change-Id: Ic46cb4fefdea8d51be018d4f7a92b0d9ca7e57b3
3 daysMerge "Update aconfig storage deps for CPP codegen" into mainTed Bauer
3 daysMerge "Add PRODUCT_AVF_MICRODROID_GUEST_GKI_VERSION to ↵Nikita Ioffe
_product_single_value_vars" into main
3 daysMerge "Remove conditional for artifact list" into mainSpandan Das
3 daysMerge "Update sdk finalizer to change soong instead of bazel" into mainTreehugger Robot
3 daysMerge "aconfig: remove cache filtering by container" into mainDennis Shen
3 daysMerge "Set enforce SOONG_GEN_COMPDB=1 when running soong for ide_query" into ↵Michael Merg
main
3 daysRemove conditional for artifact listSpandan Das
The expanded list seems to be no longer required when using prebuilts. Test: downloaded this CL in v-aml-prebuilt-dev Test: lunch gsi_partner_arm-ap31-userdebug && m # no ninja analysis error Change-Id: I818191f36449032aee98879506c1e564fd0bc1b1
3 daysUpdate sdk finalizer to change soong instead of bazelJihoon Kang
Update the map in soong instead of that in bazel Bug: 315353489 Test: manual Merged-In: I3a51be1119109d2a6cf3959bdc8a48192872580f Change-Id: Ia61a17be4a7d85c00d2e9758ea2409019d451dfd
4 daysAdd PRODUCT_AVF_MICRODROID_GUEST_GKI_VERSION to _product_single_value_varsNikita Ioffe
Forgot to add it in aosp/3044155. Bug: 325991735 Test: m Change-Id: I21d08b85b25426e498fc90c90729f7cb01f1f9d1
4 daysMerge "aconfig: update flag info storage file" into mainDennis Shen