Effective in 2026, to align with our trunk stable development model and ensure platform stability for the ecosystem, we will publish source code to AOSP in Q2 and Q4. For building and contributing to AOSP, use android-latest-release. The android-latest-release manifest branch will always reference the most recent release pushed to AOSP. For more information, see Changes to AOSP.
Stay organized with collections
Save and categorize content based on your preferences.
MixKernelTargetPreparer
public
class
MixKernelTargetPreparer
extends BaseTargetPreparer
implements
IConfigurationReceiver,
ILabPreparer
A ITargetPreparer that allows to mix a kernel image with the device image.
Summary
Protected methods |
String[]
|
getKernelVersionFromImage(File image)
Extracts the kernel version from a boot/vendor_boot/system_dlkm/vendor_dlkm image files.
|
IRunUtil
|
getRunUtil()
Get the IRunUtil instance to use.
|
String[]
|
parseKernelVersion(String source, String kernelVersionString)
|
void
|
runMixKernelTool(ITestDevice device, File oldDeviceDir, File kernelDir, File gkiDir, File newDeviceDir)
Run mix kernel tool to generate the new device build
Mixing tool Usage: build_mixed_kernels device_dir out_dir target flavor kernel_dir
|
void
|
validateKernelCompatibility(String imageName, String[] imageVersion, String[] bootVersion, ITestDevice device)
|
void
|
validateKernelVersion(File kernelDir, File gkiDir, ITestDevice device)
Validate kernel versions in the images are expected.
|
Public constructors
MixKernelTargetPreparer
public MixKernelTargetPreparer ()
Public methods
setConfiguration
public void setConfiguration (IConfiguration configuration)
Injects the IConfiguration in use.
| Parameters |
configuration |
IConfiguration |
public void setUp (TestInformation testInfo)
Perform the target setup for testing.
| Parameters |
testInfo |
TestInformation: The TestInformation of the invocation. |
Protected methods
getKernelVersionFromImage
protected String[] getKernelVersionFromImage (File image)
Extracts the kernel version from a boot/vendor_boot/system_dlkm/vendor_dlkm image files.
| Parameters |
image |
File: The File to the image file. |
| Returns |
String[] |
A ERROR(/String[]) containing the parsed kernel version info: [kernelVersion,
patchLevel, pageSize]. Returns null if the version string cannot be parsed. |
parseKernelVersion
protected String[] parseKernelVersion (String source,
String kernelVersionString)
| Parameters |
source |
String |
kernelVersionString |
String |
protected void runMixKernelTool (ITestDevice device,
File oldDeviceDir,
File kernelDir,
File gkiDir,
File newDeviceDir)
Run mix kernel tool to generate the new device build
Mixing tool Usage: build_mixed_kernels device_dir out_dir target flavor kernel_dir
| Parameters |
device |
ITestDevice: the test device |
oldDeviceDir |
File: the directory File contains old device images |
kernelDir |
File: the directory File contains kernel images destination |
gkiDir |
File: the directory File contains GKI kernel images destination |
newDeviceDir |
File: the directory File where new device images will be generated to |
validateKernelCompatibility
protected void validateKernelCompatibility (String imageName,
String[] imageVersion,
String[] bootVersion,
ITestDevice device)
| Parameters |
imageName |
String |
imageVersion |
String |
bootVersion |
String |
device |
ITestDevice |
validateKernelVersion
protected void validateKernelVersion (File kernelDir,
File gkiDir,
ITestDevice device)
Validate kernel versions in the images are expected. Throw exception if not valid.
| Parameters |
kernelDir |
File: the directory File contains kernel images |
gkiDir |
File: the directory File contains GKI images |
device |
ITestDevice: the ITestDevice |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-22 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-06-22 UTC."],[],[]]