kleaf: Add factory config and flag

Use --config=factory for factory builds. Modules can enable factory
features by checking //private/devices/google/common:factory_build.

Bug: 351739558
Change-Id: I00c3d7f6cd79795b46ff5faa023e3ce557e4da4f
Signed-off-by: Jacky Liu <[email protected]>
Signed-off-by: Robin Peng <[email protected]>
diff --git a/device.bazelrc b/device.bazelrc
index a8313ab..037874a 100644
--- a/device.bazelrc
+++ b/device.bazelrc
@@ -4,6 +4,12 @@
 
 build --flag_alias=kernel_package=//common:kernel_package
 
+# Debug configs
+import %workspace%/private/devices/google/common/debug/debug.bazelrc
+
+build:factory --//private/devices/google/common:factory
+build:factory --config=pixel_debug_common
+
 # For compatibility. Recommand to use --kernel_package directly.
 build:aosp_staging --kernel_package=@//aosp-staging
 build:use_source_tree_aosp --kernel_package=@//aosp
@@ -33,9 +39,6 @@
 build:pixel_kunit --//private/devices/google/common:enable_kunit
 build:pixel_kunit --notrim
 
-# Debug configs
-import %workspace%/private/devices/google/common/debug/debug.bazelrc
-
 # Placeholders for device specific bazelrc files. Add as many as you need.
 try-import %workspace%/.d1.bazelrc
 try-import %workspace%/.d2.bazelrc