- Dec 12, 2023
-
-
Jeff Sharkey authored
As test authors onboard their bivalent tests, they'll be using the `@IgnoreUnderRavenwood` annotation to quietly ignore tests that don't currently have enough Ravenwood support to run. However, over time the Ravenwood environment will continue to gain new functionality, and we'd like an easy way to "probe" those previously-ignored tests to see if any of them started passing. This change implements this using a locally-configured flag that unconditionally runs all tests under Ravenwood, and reports failures for any tests marked as `@IgnoreUnderRavenwood` that are now passing. (As these "failures" might be confusing for normal test authors, we leave it disabled by default in the build, and leave it for internal Ravenwood maintainers.) To confirm this works, implement two new methods on Parcel, and detect the relevant tests that started passing. Bug: 292141694 Test: atest CtsUtilTestCasesRavenwood CtsUtilTestCases Change-Id: Ied2a5e3d1781c76a4f3506192d015309f2f424b2
-
- Dec 08, 2023
-
-
Dmitri Plotnikov authored
Bug: 314797745 Test: atest PowerStatsTestsRavenwood Test: atest PowerStatsTests Change-Id: I28f823608041cc7606bd848f3618c9c0ae5adace
-
- Dec 07, 2023
-
-
Jeff Sharkey authored
Since feature flags are becoming an important part of development work, ensure that Ravenwood tests can use existing tools such as `SetFlagsRule` to populate values for code-under-test to consume. To enable this, we extend `AndroidHeuristicsFilter` to recognize feature flags generated code, and include that in the Ravenwood environment by default. Bug: 311370221 Test: atest FrameworksCoreTestsRavenwood FrameworksCoreTests Change-Id: I526af65f816d153cb6e365cf6810a5a304d3e6a6
-
- Dec 05, 2023
-
-
Jeff Sharkey authored
Tests for these internal utils are local within the frameworks/base/ repo, instead of in CTS. To help future-proof, bring the entire utils/* test directory by default into the Ravenwood suites, and give developers the way to easily opt-out with @IgnoreUnderRavenwood at the class level. Bug: 292141694 Test: atest FrameworksCoreTestsRavenwood FrameworksCoreTests Test: atest FrameworksUtilTestsRavenwood FrameworksUtilTests Change-Id: I5251dca752396faa77774659d0923d8cdb719830
-
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
-
- Dec 04, 2023
-
-
Makoto Onuki authored
Bug: 292141694 Test: ./scripts/run-all-tests.sh Change-Id: If16c9abaeeefbf68acac0f90d8ef394871ce542a
-
- Dec 01, 2023
-
-
Makoto Onuki authored
Bug: 292141694 Test: ./scripts/run-all-tests.sh Change-Id: I9b1db65d9c0cdac1012637d60a3bc6c3bbe3f5d6
-
Makoto Onuki authored
Bug: 292141694 Test: Tree hugger Change-Id: Ica5cfff6bc209376ab39f665d48f992c143c49a2
-
Makoto Onuki authored
Now we inject 5 annotations: HostStubGenKeptInImpl HostStubGenKeptInStub HostStubGenProcessedAsIgnore HostStubGenProcessedAsSubstitute HostStubGenProcessedAsThrow Bug: 311174191 Test: ./scripts/run-all-tests.sh Change-Id: I9bf399bfdb789bc95be77fe51cd1579358e2dcee
-
Makoto Onuki authored
If there's a nested class like A$B$C and C doesn't have a class-wide policy, HSG was supposed to look at A$B's ("direct outer class") policy, but it was using A's policy. Fixed it. Bug: 311174191 Test: ./scripts/run-all-tests.sh Test: atest --host CtsGraphicsTestCasesRavenwood \ CtsTextTestCasesRavenwood \ CtsOsTestCasesRavenwood \ CtsAccountManagerTestCasesRavenwood \ CtsContentTestCasesRavenwood \ CtsProtoTestCasesRavenwood \ CtsUtilTestCasesRavenwood \ CtsDatabaseTestCasesRavenwood Change-Id: I4881caac5e91366cf60e1aa232ecaf6b7c88aecf
-
- Nov 30, 2023
-
-
Jeremy Meyer authored
This reverts commit 917043bc. Reason for revert: Roll forward with fix Test: Automatic Bug: 296324826 Change-Id: I42a0b48c02fd497b2174c0c65f300265202f7ab1
-
Makoto Onuki authored
Guava has classes outside of com.google.comm. Bug: 311174191 Test: ./scripts/run-all-tests.sh Change-Id: I9ccd79e8a97be7473a754a4f3ed83ff73c5e4f84
-
Junwei Wang authored
This reverts commit 32154d2c. Reason for revert: DroidMonitor: potential culprit of build break. Verifying via ABTD before reverting as a part of standard investigation. Change-Id: Iad0379e1498bfee91b4e7c0cb6c50f2a5ce800ad
-
- Nov 29, 2023
-
-
Makoto Onuki authored
Bug: 311174191 Test: N/A Change-Id: Ief5c80d6a03c58830329c81a8c0350ff1955583e
-
Jeff Sharkey authored
As part of upcoming `servicestests` work, this change makes some general changes. We don't currently have Mainline stubs included in the Ravenwood runtime, so this change "hides" references in `PackageManagerInternal` and `ActivityManagerInternal` while keeping the clients working. Adds support for `Process.setCanSelfBackground()` to support ServiceThread. Adds support for `LocalServices`, along with a new hook to clear out any registered services between each Ravenwood test. Bug: 292141694 Test: atest CtsUtilTestCasesRavenwood Change-Id: Iea3b4a5bf2ebebb34d56cfc76014fc07987cf355
-
Jeff Sharkey authored
These are common utility classes used by framework code, so support them and their relevant tests. Since they depend on ErrnoException and IoUtils, bring over limited versions of those classes into `libcore-fake`, and compile them into the Ravenwood runtime using variant washing. Bug: 292141694 Test: atest FrameworksCoreTestsRavenwood FrameworksUtilTestsRavenwood Change-Id: Ib44dedacfa4d12a7d697973caf070477ed07202d
-
Makoto Onuki authored
See below for the log filename. Also disable an unimplemented flag. Bug: 311174191 Test: ./scripts/run-all-tests.sh Test: m framework-minus-apex.ravenwood and examine console output and out/soong/.intermediates/frameworks/base/framework-minus-apex.ravenwood-base/android_common/gen/hoststubgen_framework-minus-apex.log Change-Id: I9997370c93e2fe90276d5f3e657d45d440ca0a59
-
Jeremy Meyer authored
Test: Automatic Bug: 296324826 Change-Id: I06b8df4fd53304d6663e80879892a635168ab28b
-
- Nov 28, 2023
-
-
Makoto Onuki authored
In some cases, filter classes need to use [outermostFilter] to refer to policies on other items. Bug: 292141694 Test: run-all-tests.sh Change-Id: I6f2796fb44e7f70e9f64f77107b2046c3733e0e2
-
Makoto Onuki authored
Also fix the AIDL class detection. Test: m framework-minus-apex.ravenwood and make sure IAccountAthenticator and its nested classes are all kept. Test: ./run-all-tests.sh Change-Id: Idb870a6e7558f7303a2072afbede2a868204e2bf
-
- Nov 22, 2023
-
-
Makoto Onuki authored
Also remove unused option Bug: 292141694 Test: run-all-tests.sh Change-Id: I32c663100362c9bf19ed42c6453bdf097bb20b49
-
Makoto Onuki authored
The text policy file now allows ":aidl" as a "special class name" and allow setting a policy for AIDL generated classess. Test: run-all-tests.sh Bug: 292141694 Change-Id: I5373bf96047f9d0accf9321e6f82082c65124138
-
- Nov 21, 2023
-
-
Makoto Onuki authored
- Now both --out-stub-jar and --out-impl-jar are optional - Disable --enable-non-stub-method-check by default (it's not fully implemented anyway) - Delete the script `run-ravenwood-test` since now atest just works. Test: run-all-tests.sh Bug: 292141694 Change-Id: I3b7d63600139425e5fffc12930ee860edf2acd7f
-
Jeff Sharkey authored
Now that we have a solid foundation of classes available, one of the tricker pieces is supporting Handler/Looper under Ravenwood. At its core, the native implementation of MessageQueue can be emulated using core JVM primitives, which is enough to reliably pass CTS. Advanced features like FileDescriptor events will need to wait until we eventually have real JNI support. Fix obscure bug with SystemClock; must be positive number. Always start our "fake" pointers from 1 to prevent `nullptr` oddness. Bug: 292141694 Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases Change-Id: I0f82b659973443968ef2609a7e3151f381abff29
-
- Nov 20, 2023
-
-
Jeff Sharkey authored
Internal test authors are likely going to want to use internal utilities that aren't in the official API surface. This change adds those to Ravenwood, along with local tests to confirm they work. Bug: 292141694 Test: atest-dev FrameworksUtilTestsRavenwood Change-Id: I0f4df50416d153418d4525bd8ec5c4dbf04521a2
-
- Nov 17, 2023
-
-
Makoto Onuki authored
... with native substition classes. It turned out native methods can be non-static. Now we handle them in this way: - The substitution method still needs to be static. - And take the original 'this' as the first argument. The first argument type must match the source class. (e.g. the arg type can't be `Object`) Test: run-all-tests.sh Bug: 292141694 Change-Id: I9a53e1c155e138e466589c1a7684dcc86601e9c8
-
- Nov 15, 2023
-
-
Jeff Sharkey authored
Initial pass at foundational classes under android.content, along with CTS to verify consistency. Methods that interface to broader parts of OS remain marked as "throw" for the moment, such as cross-process work and StrictMode. Bug: 292141694 Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases Test: atest-dev CtsContentTestCasesRavenwood CtsContentTestCases Change-Id: Ic3deafb1f4058fcc104882a3508728994669f7d2
-
Jeff Sharkey authored
We have the XML interfaces from libcore, but the implementations there are tied closely to things like StringPool. We thankfully have our own human-readable XML serializer that we could use, but there's unfortunately not a good pull parser. To get us unstuck for the moment, pivot the internals to unconditionally use the binary XML format, which at least we know is thoroughly tested, and any data written through this path can then also be parsed. This is enough to support PersistableBundle, and we'll circle back to get ourselves a human-readable XML implementation in the future. Bug: 292141694 Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases Change-Id: I875a3a2b0e95e52861afe187e2a5e9f1e740d8d5
-
- 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 13, 2023
-
-
Jeff Sharkey authored
The Ravenwood environment doesn't support IPC, but much of the code that developers intend to test (such as AIDL stubs) still relies on baseline same-process behavior to be intact. This change adds UID and PID support to Process and Binder, but we carefully communicate that it's only available when the test author has configured it via a RavenwoodRule. This ensures that tests don't accidentally rely on unexpected defaults, as some tests will want AID_SYSTEM, and others want a normal app UID. Also bring along SystemClock, PatternMatcher, and ParcelUuid along with relevant tests. Finally, now that we have an IgnoreUnderRavenwood annotation, we can pivot back our default failure to be a RuntimeException instead of an AssumptionViolatedException. Bug: 292141694 Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases Change-Id: I5f54c3179b2d305b9ab9144c43fd063c6b756e44
-
- Nov 10, 2023
-
-
Jeff Sharkey authored
These inline annotations make maintenance commitments easier for code owners to reason about. Bug: 292141694 Test: atest-dev CtsUtilTestCasesRavenwood CtsUtilTestCases Change-Id: Ia3479c7fd66123e2cc759c661fc551967ecdec08
-
Makoto Onuki authored
For now, we inherit the visibility of the enclosing class. So there's now way to make them "throw" yet. Bug: 310212493 Bug: 292141694 Test: run-all-tests.sh Test: atest --no-bazel-mode CtsUtilTestCasesRavenwood Change-Id: I590e4e972a3b0812c0470c9872c02cf7293e83f6
-
Makoto Onuki authored
Also add some presubmit tests as a smoke test. Bug: 292141694 Test: run-all-tests.sh Test: atest --no-bazel-mode CtsUtilTestCasesRavenwood Change-Id: I30569313b764dfa30db9c2c5627050da4a6a1d67
-
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
-
-
Makoto Onuki authored
Bug: 292141694 Test: run-all-tests.sh Test: atest --no-bazel-mode CtsUtilTestCasesRavenwood Change-Id: I492206e4b14e02fb3d563c3bc5cd2f0b4907317a
-
Mark Punzalan authored
Bug: 297373084 Test: atest aapt2_tests Change-Id: I7567aa8f41e6fde7334430446a940eb6b04c1446
-
- Nov 08, 2023
-
-
Jeff Sharkey authored
We have baseline implementations of the Parcel and Bundle, so we're ready to support them under the Ravenwood environment. Brings along the relevant CTS to prove that it works consistently on both devices and Ravenwood. Make a few test-driven bug fixes to Parcel code. Currently does not support FDs or Binders. Add new `@IgnoreUnderRavenwood` annotation that is respected by a new `RavenwoodRule`, letting the same test code be shared to run under both devices and Ravenwood. Currently packaged under our own area of the tree, but named to match layout of `platform_testing` for future migration. Add "ThrowClass" policy. Bug: 292141694 Test: atest-dev CtsOsTestCasesRavenwood CtsOsTestCases:ParcelTest CtsOsTestCases:BundleTest Change-Id: I88d19afff47fbea6557e922a10e8555ee0f70ba3
-
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 07, 2023
-
-
Makoto Onuki authored
Only implicitly include auto-generated enum members. Bug: 292141694 Test: run-all-tests.sh Test: atest --no-bazel-mode CtsUtilTestCasesRavenwood Change-Id: Iab2f3ec28fb47293e342e09aee9a2596baa31800
-
- Nov 06, 2023
-
-
Makoto Onuki authored
Example: --package-redirect dalvik:com.android.hoststubgen.substitution.dalvik will rewrite all references to classes `dalvik.*` to `com....dalvik.*`. This allows us to define libcore substitution classes in a different package. This is useful becuase javac won't let us add classes to the `dalvic` package which is already taken by the libcore module. Bug: 292141694 Test: run-all-tests.sh Change-Id: I01e72f4b4a7ce4baefaaccddbb462edd84267e0e
-