omni: Allow to opt out from omni kernel build

GKI devices should build the kernel within the hermetic kernel build environment.
https://source.android.com/docs/core/architecture/kernel/stable-kmi#hermetic-build-process

Change-Id: Id920c433a9b68b77cdee1cdd29ae1ae8309aed2c
diff --git a/build/tasks/kernel.mk b/build/tasks/kernel.mk
index dc4632d..abfa57c 100644
--- a/build/tasks/kernel.mk
+++ b/build/tasks/kernel.mk
@@ -62,6 +62,7 @@
 #   NEED_KERNEL_MODULE_VENDOR_OVERLAY  = Optional, if true, install kernel
 #                                          modules in vendor overlay instead of vendor
 
+ifneq ($(TARGET_USES_KERNEL_PLATFORM),true)
 ifneq ($(TARGET_NO_KERNEL),true)
 ifneq ($(TARGET_NO_KERNEL_OVERRIDE),true)
 
@@ -411,3 +412,4 @@
 
 endif # TARGET_NO_KERNEL_OVERRIDE
 endif # TARGET_NO_KERNEL
+endif # TARGET_USES_KERNEL_PLATFORM
diff --git a/config/BoardConfigOmni.mk b/config/BoardConfigOmni.mk
index a421d1d..5a47ce5 100644
--- a/config/BoardConfigOmni.mk
+++ b/config/BoardConfigOmni.mk
@@ -1,2 +1,5 @@
+ifneq ($(TARGET_USES_KERNEL_PLATFORM),true)
 include vendor/omni/config/BoardConfigKernel.mk
+endif
+
 include vendor/omni/config/BoardConfigSoong.mk