- Jan 11, 2024
-
-
Nelson Li authored
After checking, the modules under these directories can not be built because the upper-level directories lack Android.mk. Even if these Android.mk are included, they cannot be tested correctly with atest. Bug: 319568429 Test: N/A Change-Id: I797d2327e340fcd38cde03dd0f520ec756be5fc3
-
Nelson Li authored
After checking, the modules under these directories can not be built because the upper-level directories lack Android.mk. In addition, the format of the Android.mk in these directories is also incorrect, and if it is included, it will cause the build to break. Bug: 319565408 Test: N/A Change-Id: I1a7b2fc2ad78bcbcd6cd3f65c0a5043656711dae
-
- Jan 10, 2024
-
-
Mark Punzalan authored
Previously, aapt2 would read arguments from files but they all have to be in one line, separated by spaces. Now they can be spread over multiple lines in the file. Bug: 297373084 Bug: 315329624 Test: Called `aapt2 link ... --feature_flags @args.txt` with args.txt containing flag values over multiple lines. Verified the resulting APK has the expected output. Change-Id: I91be6c7a869f63eafd88c04de69401d248f05545
-
- Jan 05, 2024
-
-
Mark Punzalan authored
The behavior of the filter depends on the minSdkVersion. If > UDC, manifest elements will be untouched. Otherwise, they will be removed depending on the value of the flag in the `android:featureFlag` attribute. Bug: 297373084 Test: atest aapt2_tests Change-Id: Ib07c45752a4cc00bfdae7fedc745ce267ec7082a
-
- Dec 15, 2023
-
-
Tor Norbye authored
Lint now forces you to explicitly set an explicit display name for composite quick fixes (it used to just default to the nested quickfix' display name, but this is sometimes misleading so now lint checks need to explicitly do this.) Test: SimpleManualPermissionEnforcementDetectorTest.kt Bug: Not filed Change-Id: Ie46d32833efc7bd9f7051acf6b45327d4fda7927
-
- Dec 11, 2023
-
-
Cole Faust authored
A change is being made to how sandboxed actions work, and now the targets of symlinks need to be listed in the Android.bp file. Add them to compile_data. Bug: 307824623 Test: m out/soong/.intermediates/frameworks/base/tools/aapt2/integration-tests/SymlinkTest/AaptSymlinkTest/android_common/lint/lint-baseline.xml Change-Id: I304a1e98045ba6ff19dc8052b2187d53c29e02bc
-
Colin Cross authored
These tests are testing aapt2 outputs and shouldn't use ResourceProcessorBusyBox. Bug: 294256649 Test: m javac-check Change-Id: I28f093d697448131968ed4c4c32e31b9a8fb3036 Merged-In: I28f093d697448131968ed4c4c32e31b9a8fb3036
-
- Dec 05, 2023
-
-
Yi Kong authored
frameworks/base/tools/aapt2/link/ManifestFixer.cpp:341:23: error: unused variable 'attr' [-Werror,-Wunused-variable] 341 | if (xml::Attribute* attr = el->FindAttribute(xml::kSchemaAndroid, "glEsVersion")) { | ^~~~ Test: presubmit Change-Id: Icec4737a5f8076173a2aff54532a79fa123df326
-
- Nov 14, 2023
-
-
Mark Punzalan authored
FeatureFlagsFilter looks for `android:featureFlag` attributes in the XML and removes elements according to the given flag values. Bug: 297373084 Test: atest aapt2_tests Change-Id: Icf97de2152c0c53b0b4518ae837e0d198873d1c5
-
- Nov 10, 2023
-
-
Thiébaud Weksteen authored
This detector ensures that all AIDL-generated interfaces are annotated with one permission annotation (@EnforcePermission, @NoPermissionRequired, or @PermissionManuallyEnforced). It is part of the framework linters and disabled by default. It will be enabled explicitly in a subsequent change (for services/Android.bp). The baseline of the services will also be updated to capture the current status of non-annotated interfaces. Bug: 220214993 Test: atest --host AndroidFrameworkLintCheckerTest Change-Id: I0fbd41b63465f119d90505153fa3a98c0fcdc798
-
- Nov 09, 2023
-
-
Mark Punzalan authored
Bug: 297373084 Test: atest aapt2_tests Change-Id: I7567aa8f41e6fde7334430446a940eb6b04c1446
-
- Nov 08, 2023
-
-
Thiébaud Weksteen authored
In commit 9252e5ce, the logic did not ensure that the super method belonged to the Stub class, and not any arbitrary method in a parent. Refactor EnforcePermissionUtils by: - Removing isContainedInSubclassOfStub() in favour of containingStub(), which returns the Stub PsiClass. Document that this method does not mean that the argument is necessary an AIDL-generated method. - Update getContainingAidlInterface() to pass the PsiClass to findSuperMethod. This ensures that only the Stub class and its parents are considered. - Drop the check for IINTERFACE_INTERFACE. This is already verified in the inner call to isStub(). The same logic is applied manually to EnforcePermissionDetector, as each condition in getContainingAidlInterface() raises a different error message. Add a test to confirm the behaviour of EnforcePermissionDetector. Bug: 307433823 Test: atest --host AndroidGlobalLintCheckerTest Test: atest --host AndroidFrameworkLintCheckerTest Test: enforce_permission_counter Change-Id: If791b6d8741e5db483589446484bb68061b67b70
-
- Nov 03, 2023
-
-
Thiébaud Weksteen authored
It is possible to simply pass the `nowarn` flag to Soong via Android.bp instead of modifying Soong itself. Bug: 220214993 Test: n/a Change-Id: I38a3cfbe3b6d9ad144f13d53da85bb47475e75bd
-
Cole Faust authored
This causes non-reproducable builds. Bug: 307824623 Test: ./build/soong/tests/genrule_sandbox_test.py UpdatableSystemFontTest_NotoColorEmojiV0.ttf Change-Id: I2f055740f44153a85fad6040d825c2e80bf2e77d
-
- Nov 01, 2023
-
-
Inseob Kim authored
filter-product option is added to aapt2 compile, which filters values with a given product and removes all other values (including default). The motivation of this change is to generate product-specific RRO automatically, making a main resource APK (e.g. framework-res.apk) identical in all targets. Bug: 294799593 Test: build (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5fe521e5b3bd5e7ef17dc50425060680cadb4e0e) Merged-In: I42eb3e134c7aa120f6bbe2d26d311bd46b586595 Change-Id: I42eb3e134c7aa120f6bbe2d26d311bd46b586595
-
- Oct 31, 2023
-
-
Thiébaud Weksteen authored
Previously, if a method: 1. was annotated with @EnforcePermission, 2. belonged to a class which implements an AIDL interface, 3. but did not override a method from that interface; an error was returned as the call to the helper was missing. The correct error for this case is that the method should not use the annotation. Update the detector and add a test for this case. Bug: 307433823 Test: atest --host AndroidGlobalLintCheckerTest Change-Id: I04c68e95bc4932459b46982a7dd1814424ff6b46
-
Thiébaud Weksteen authored
Enable ISSUE_ENFORCE_PERMISSION_HELPER and ISSUE_MISSING_ENFORCE_PERMISSION on EnforcePermissionDetectorTest. Update the Stub to avoid false negatives (and better reflect AIDL generated code). This is a no-op to confirm that issues do not negatively impact each other. Bug: 307433823 Test: atest --host AndroidGlobalLintCheckerTest Change-Id: I9ab2b654932a6d228a2a646e5b1fa9c5fc16db02
-
Azhara Assanova authored
Short strings in this context are permission strings without the leading "android.permission.", e.g. a short string for "android.permission.MODIFY_AUDIO_ROUTING" is "MODIFY_AUDIO_ROUTING". Bug: 270686198 Test: atest --host AndroidGlobalLintCheckerTest Change-Id: Ic01049613316b79123ce2300511efb5fd8143d4c Merged-In: Ic01049613316b79123ce2300511efb5fd8143d4c
-
- Oct 27, 2023
-
-
Thiébaud Weksteen authored
The ISSUE_MISUSING_ENFORCE_PERMISSION issue was referencing the wrong Detector implementation. Test: m AndroidGlobalLintChecker && m lint-check Change-Id: Id07b18a98fd5ca925bb00683ec8ec0c31b0e44d0 Merged-In: Id07b18a98fd5ca925bb00683ec8ec0c31b0e44d0
-
Thiébaud Weksteen authored
Increase the scope of the linters to be executed even for tests. Bug: 270596429 Test: m lint-check Test: remove annotation and helper call in EnforcePermissionTestHelper; m lint-check; the two errors are raised. (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d16e10024b498484f8ac8d7fefa7405093210fde) Merged-In: Ic8348b668664747b8a1f3c56359cdf9c02132f59 Change-Id: Ic8348b668664747b8a1f3c56359cdf9c02132f59
-
Thiébaud Weksteen authored
Both classes shared similar code. The main merging is between visitAnnotation and visitMethod. The tests are not modified beyond what is strictly necessary. This ensures that this refactoring does not break existing functionality. Bug: 260314719 Test: atest --host AndroidGlobalLintCheckerTest Test: atest --host AndroidGlobalLintCheckerIntegrationTest Change-Id: I6d09d311f6d8bee88ea2b2d2cd4e647d941d9979
-
- Oct 26, 2023
-
-
Mark Punzalan authored
Adding a placeholder so that soong build integration can happen in parallel with the implementation of this flag. Bug: 297373084 Bug: 306024510 Test: m aapt2 Change-Id: If9df57daaa871c11e146a8a8f8113fceb2fd96c2
-
- Oct 11, 2023
-
-
Mark Punzalan authored
Like we currently do for @TestApi and @SystemApi, we look for "@FlaggedApi" and its parameters in the comment above the resource. Bug: 295328308 Test: Did the following: 1. Ran `atest aapt2_tests` 2. Ran `aapt2 link` on public-staging.xml with an added @FlaggedApi in the comment for the resource currently there. Verified the @FlaggedApi annotation is present in the generated R.java. 3. Ran `m framework-minus-apex` and it built successfully. 4. Modified the @FlaggedApi comment with an invalid value (e.g., `Flags.FOO` which does not exist). The build failed. Since @FlaggedApi is a source-only annotation (i.e., not present in the R.class file), we want to verify it was actually used in the build. (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:6fa7a3c7c5213ad3a94406f46fec6d1219b3fa43) Merged-In: I0739f888d40269915c0acea5650c386da1a1782e Change-Id: I0739f888d40269915c0acea5650c386da1a1782e
-
- Oct 06, 2023
-
-
Krzysztof Kosiński authored
Bug: 255714762 Test: presubmit Change-Id: I7e29732e1e77e37cfb491521d14d2f3eb07deb36 Merged-In: I7e29732e1e77e37cfb491521d14d2f3eb07deb36
-
Krzysztof Kosiński authored
Bug: 255714762 Test: presubmit Change-Id: I7e29732e1e77e37cfb491521d14d2f3eb07deb36 Merged-In: I7e29732e1e77e37cfb491521d14d2f3eb07deb36
-
- Oct 02, 2023
-
-
Thiébaud Weksteen authored
Bug: 302400088 Test: atest --host AndroidGlobalLintCheckerIntegrationTest Change-Id: Ie71a8976a62b42ab490f43ead2764747686d181f
-
- Oct 01, 2023
-
-
Thiébaud Weksteen authored
This test ensures that the linter is correctly executed and reports an error. It uses the `lint.suppress_exit_code` to silence the error when building the test library (otherwise, this module would fail to build on a checkbuild). Bug: 302400088 Test: atest --host AndroidGlobalLintCheckerIntegrationTest Change-Id: Ib9e9deec16f6b703139fb85337f4a826a99ec033
-
- Sep 27, 2023
-
-
Thiébaud Weksteen authored
The target list of enforce_permission_counter can be reconstructed based on the dependencies of the "services" module. Add the ability to soong_lint_fix to collect and parse module_bp_java_deps.json which contains the dependency list. SoongLintFix is split into 2 classes: SoongWrapper and SoongLintFix. The former is used as a general wrapper to invoke Soong and parse the module files. The latter, a subclass of SoongWrapper, contains the calls to the different steps. The building and loading of module-info.json and module_bp_java_deps.json is now done dynamically whenever required. Bug: 298285238 Test: enforce_permission_counter Test: lint_fix --no-fix --check AnnotatedAidlCounter --lint-module AndroidUtilsLintChecker services.autofill Change-Id: I781e9cdf80feb4c4d480673e044d526c528f8412
-
- Sep 22, 2023
-
-
Thiébaud Weksteen authored
Commit df4cd065 updated how command line arguments are parsed. However, sys.argv[0] should be ignored (as this is the name of the program). Remove the argument, so the default value (sys.argv[1:]) is used. Also, use the embedded_launcher so that the help renders as: usage: lint_fix [-h] instead of: usage: usage: __soong_entrypoint_redirector__.py [-h] Test: lint_fix --print --no-fix --check AnnotatedAidlCounter \ --lint-module AndroidUtilsLintChecker services.autofill Change-Id: I00e3e3b70c9715e363d3448ae84bf9ff161f2306
-
- Sep 19, 2023
-
-
Thiébaud Weksteen authored
Add a tool "enforce_permission_counter" which leverages lint_fix and the AndroidUtilsLintChecker linter to report on the number of AIDL methods that have been migrated to use the @EnforcePermission annotation (or @RequiresNoPermission). Test: enforce_permission_counter Test: lint_fix --print --no-fix --check AnnotatedAidlCounter \ --lint-module AndroidUtilsLintChecker services.autofill Bug: 298285238 Change-Id: I521ab5358476f63387674e17c601da3b63cbc1d8
-
- Sep 14, 2023
-
-
Yurii Zubrytskyi authored
Change-Id: Ie3392afbd2832f00083e15f849b0a7d689583560
-
- Sep 12, 2023
-
-
Tomasz Wasilczyk authored
Bug: 295394788 Test: m checkbuild Change-Id: I6aa039b6b2a4944e3537ef133f8785890d957edd
-
- Sep 08, 2023
-
-
Elliott Hughes authored
I don't know why I didn't clean these up when I learned about this trick. Test: treehugger Change-Id: Iec74cab28c782a61ef3e48210f3a48043e981212
-
- Sep 07, 2023
-
-
Thiébaud Weksteen authored
Test: lint_fix --print --no-fix --check AnnotatedAidlCounter --lint-module AndroidUtilsLintChecker services.autofill services.usage Change-Id: I08f5aa3e74db8ff24544bbdd3edb0635a0d2fb52
-
Thiébaud Weksteen authored
Bug: 298285238 Test: lint_fix --print --no-fix --check AnnotatedAidlCounter --lint-module AndroidUtilsLintChecker services.autofill Test: atest --host AndroidUtilsLintCheckerTest Change-Id: I7876e44cabc006de9b996f84477e15071cb95203
-
Ryan Prichard authored
After upgrading libc++, Clang fails to compile DumpManifest.cpp. prebuilts/clang/host/linux-x86/clang-r498229/include/c++/v1/__memory/unique_ptr.h:63:19: error: invalid application of 'sizeof' to an incomplete type 'aapt::CommonFeatureGroup' static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type"); ^~~~~~~~~~~ Fix the problem by deferring the instantiation of ~unique_ptr, by making the ManifestExtractor constructor out-of-line and moving it and the initialization of commonFeatureGroup_ to a point after CommonFeatureGroup has been defined. Bug: b/175635923 Test: treehugger Change-Id: I9ab51f29724fded24773344aa36763ffeea02d00 Merged-In: I9ab51f29724fded24773344aa36763ffeea02d00
-
Ryan Prichard authored
After upgrading libc++, Clang fails to compile DumpManifest.cpp. prebuilts/clang/host/linux-x86/clang-r498229/include/c++/v1/__memory/unique_ptr.h:63:19: error: invalid application of 'sizeof' to an incomplete type 'aapt::CommonFeatureGroup' static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type"); ^~~~~~~~~~~ Fix the problem by deferring the instantiation of ~unique_ptr, by making the ManifestExtractor constructor out-of-line and moving it and the initialization of commonFeatureGroup_ to a point after CommonFeatureGroup has been defined. Bug: b/175635923 Test: treehugger (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:42d2e51bf78bec72031e5f7a70422851b302d1f4) Merged-In: I9ab51f29724fded24773344aa36763ffeea02d00 Change-Id: I9ab51f29724fded24773344aa36763ffeea02d00
-
Thiébaud Weksteen authored
Bug: 298285238 Test: m AndroidGlobalLintChecker Change-Id: I4e90a0452caaf69ec5da680b7955b16eb1387871
-
- Sep 05, 2023
-
-
Tomasz Wasilczyk authored
Bug: 295394788 Test: make checkbuild Change-Id: I370f66c469de73064dec2e42c539dc236dd69d1e
-
- Sep 01, 2023
-
-
Tomasz Wasilczyk authored
Test: m checkbuild Bug: 295394788 Change-Id: I9488bc5632cbd47c83f6b5f2df4c87eb324a1e8e
-