Merge "AIDEGen: Causes device build to fail"
diff --git a/aidegen/constant.py b/aidegen/constant.py
index ec986e0..769a1a0 100644
--- a/aidegen/constant.py
+++ b/aidegen/constant.py
@@ -22,6 +22,10 @@
 ANDROID_HOST_OUT = os.environ.get(constants.ANDROID_HOST_OUT)
 ANDROID_ROOT_PATH = os.environ.get(constants.ANDROID_BUILD_TOP)
 ROOT_DIR = os.path.join(ANDROID_ROOT_PATH, 'tools/asuite/aidegen')
+ANDROID_OUT_DIR = os.environ.get(constants.ANDROID_OUT_DIR)
+ANDROID_PRODUCT_OUT = os.environ.get(constants.ANDROID_PRODUCT_OUT)
+OUT_DIR = ANDROID_OUT_DIR or ANDROID_PRODUCT_OUT
+BLUEPRINT_JSONFILE_OUTDIR = os.path.join(OUT_DIR, 'soong')
 KEY_PATH = 'path'
 KEY_DEP = 'dependencies'
 KEY_DEPTH = 'depth'
diff --git a/aidegen/lib/module_info_util.py b/aidegen/lib/module_info_util.py
index dc5ecdb..640de53 100644
--- a/aidegen/lib/module_info_util.py
+++ b/aidegen/lib/module_info_util.py
@@ -40,7 +40,6 @@
 from atest import constants
 
 _BLUEPRINT_JSONFILE_NAME = 'module_bp_java_deps.json'
-_BLUEPRINT_JSONFILE_OUTDIR = 'out/soong/'
 _KEY_CLS = 'class'
 _KEY_PATH = 'path'
 _KEY_INS = 'installed'
@@ -191,7 +190,7 @@
     """
     return os.path.join(
         os.environ.get(constants.ANDROID_BUILD_TOP),
-        _BLUEPRINT_JSONFILE_OUTDIR, _BLUEPRINT_JSONFILE_NAME)
+        constant.BLUEPRINT_JSONFILE_OUTDIR, _BLUEPRINT_JSONFILE_NAME)
 
 
 def _merge_module_keys(m_dict, b_dict):