Always turn on TARGET_BUILD_USE_PREBUILT_SDKS for unbundled build.

Before this change, TARGET_BUILD_USE_PREBUILT_SDKS was turned on only if
TARGET_BUILD_APPS or TARGET_BUILD_UNBUNDLED_IMAGE is set. After this
change, TARGET_BUILD_USE_PREBUILT_SDKS is always turned on if
TARGET_BUILD_UNBUNDLED is set.

We need this change because we need to build ART services on the thin
manifest, and ART's build script only sets TARGET_BUILD_UNBUNDLED.

Bug: 177273468
Test: (on aosp-master-art) . ./build/envsetup.sh && lunch arm_krait-eng && art/tools/buildbot-build.sh --target
Change-Id: I1b5f63043d518ac8306bd172ef8afd69ab3ae8e5
diff --git a/core/build-system.html b/core/build-system.html
index b872909c..181e939 100644
--- a/core/build-system.html
+++ b/core/build-system.html
@@ -444,8 +444,12 @@
 <p>Unbundled build has several meanings by the context.
 Let me explain the meaning by the flags related to "unbundled build"</p>
 <h4>TARGET_BUILD_UNBUNDLED</h4>
-<p>The source tree might not have the full platform sources. It is always set if
-<code>TARGET_BUILD_APPS</code> or <code>TARGET_BUILD_UNBUNDLED_IMAGE</code> is set.</p>
+<p>
+    The source tree might not have the full platform sources. It turns on
+    <code>TARGET_BUILD_USE_PREBUILT_SDKS</code>, unless
+    <code>UNBUNDLED_BUILD_SDKS_FROM_SOURCE</code> is set. It is always set if
+    <code>TARGET_BUILD_APPS</code> or <code>TARGET_BUILD_UNBUNDLED_IMAGE</code> is set.
+</p>
 <h4>TARGET_BUILD_USE_PREBUILT_SDKS</h4>
 <p>It is an internal flag. If it is set, prebuilt SDKs are used, even if a module's
 <code>LOCAL_SDK_VERSION</code> is <code>current</code> (including <code>system_current</code>,
diff --git a/core/config.mk b/core/config.mk
index 5ef9211..f971c51 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -494,7 +494,9 @@
 DISABLE_PREOPT :=
 ifneq (,$(TARGET_BUILD_APPS)$(TARGET_BUILD_UNBUNDLED_IMAGE))
   DISABLE_PREOPT := true
-  ifndef UNBUNDLED_BUILD_SDKS_FROM_SOURCE
+endif
+ifeq (true,$(TARGET_BUILD_UNBUNDLED))
+  ifneq (true,$(UNBUNDLED_BUILD_SDKS_FROM_SOURCE))
     TARGET_BUILD_USE_PREBUILT_SDKS := true
   endif
 endif