Merge "Allow global overriding LOCAL_JACK_ENABLED"
diff --git a/core/config.mk b/core/config.mk
index 61a198a..ac4f81e 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -427,7 +427,7 @@
 ifneq ($(ANDROID_JACK_EXTRA_ARGS),)
 DEFAULT_JACK_EXTRA_ARGS := $(ANDROID_JACK_EXTRA_ARGS)
 else
-DEFAULT_JACK_EXTRA_ARGS := -D sched.runner=single-threaded --sanity-checks off
+DEFAULT_JACK_EXTRA_ARGS := --sanity-checks off
 endif
 JILL := java -Xmx3500m -cp $(JILL_JAR) com.android.jill.Main
 PROGUARD := external/proguard/bin/proguard.sh
diff --git a/core/dpi_specific_apk.mk b/core/dpi_specific_apk.mk
index a05380f..3790744 100644
--- a/core/dpi_specific_apk.mk
+++ b/core/dpi_specific_apk.mk
@@ -30,14 +30,18 @@
 $(built_dpi_apk): PRIVATE_ADDITIONAL_CERTIFICATES := $(foreach c,\
     $(LOCAL_ADDITIONAL_CERTIFICATES), $(c).x509.pem $(c).pk8)
 
+$(built_dpi_apk): PRIVATE_SOURCE_ARCHIVE :=
 ifneq ($(full_classes_jar),)
 $(built_dpi_apk): PRIVATE_DEX_FILE := $(built_dex)
+ifndef LOCAL_JACK_ENABLED
 # Use the jarjar processed arhive as the initial package file.
 $(built_dpi_apk): PRIVATE_SOURCE_ARCHIVE := $(full_classes_jarjar_jar)
+else
+$(built_dpi_apk): PRIVATE_JACK_INTERMEDIATES_DIR := $(intermediates.COMMON)/jack-rsc
+endif # LOCAL_JACK_ENABLED
 $(built_dpi_apk): $(built_dex)
 else
 $(built_dpi_apk): PRIVATE_DEX_FILE :=
-$(built_dpi_apk): PRIVATE_SOURCE_ARCHIVE :=
 endif # full_classes_jar
 
 # Set up dependenncies and the build recipe.
@@ -56,6 +60,9 @@
 endif
 ifneq ($(full_classes_jar),)
 	$(add-dex-to-package)
+ifdef LOCAL_JACK_ENABLED
+	$(add-carried-jack-resources)
+endif
 endif
 	$(sign-package)
 	$(align-package)