Bram Bonné ae12b3c5a1 Ports the first part of encryption/key to AOSP.
A few additional changes (apart from style and usual dependencies) were needed:
- Dependency on KeyStore was removed (see b/75771701).
- References to internal names were removed or renamed.
- ByteStringUtils is used as a replacement for the Guava bytes-to-hex-string conversions.
- Uses java's Optional rather than Guava's Optional.
- Change to Slog for logging.
- TertiaryKeyRotationTracker.MAX_BACKUPS_UNTIL_TERTIARY_KEY_ROTATION is now a constant rather than a flag.

Bug: 111386661
Test: atest RunFrameworksServicesRoboTests
Change-Id: If9bcfb1f73ba78c278947b8499236bb536e625eb
2018-12-05 16:11:28 +00:00
..
2018-11-13 11:26:43 -08:00
2018-11-21 13:52:34 +00:00
2018-08-10 12:41:19 +00:00

This folder is for Robolectric tests inside the platform.

To add a test class annotate it as follows:

@RunWith(FrameworkRobolectricTestRunner.class)
@Config(manifest = Config.NONE, sdk = 26)
@SystemLoaderClasses({ClassUnderTest.class, DependencyClasses.class})
@SystemLoaderPackages({"com.android.server.yourmodule"})

Robolectric loads some classes that it decides from versioned jars of the framework. Since we are
part of the framework some of our classes get loaded from these jars. This is NOT what we want, we
want to test against what we wrote in the tree. Because of this we use a custom test runner,
FrameworkRobolectricTestRunner, that bypasses these jars and loads certain classes from the system
class loader.

To specify which classes to load use either @SystemLoaderClasses or @SystemLoaderPackages. In
practice:
* You MUST put the class under test here.
* If you encounter any exceptions that might be caused by a different version of the class being
loaded, such as NoSuchMethodException, put the class involved in the exception in this annotation
and try again.

Check Android.mk file for more info.