Fix null pointer dereference in Soong on dexpreopt arc-services.

The null pointer dereference was caused by trying to get device name
from a config passed to dexpreopt. For Make modules, the config is a
stub that doesn't have a device name. The fix is to use build directory
instead of device name (it is provided both by the full config passed
to Soong modules and by the stub config passed to Make modules).

Test: walleye-userdebug boots.
Test: aosp_bertha_arm-userdebug builds and generates arc-services.odex.

Bug: 152193534
Change-Id: I7adc173646cae6eaee188c6672629a5a942aea06
Merged-In: I7adc173646cae6eaee188c6672629a5a942aea06
(cherry picked from commit 9790f1058b37bfc3298f068c0a8efe4486944393)
diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go
index 7dd01e2..02e54b3 100644
--- a/dexpreopt/dexpreopt.go
+++ b/dexpreopt/dexpreopt.go
@@ -589,7 +589,7 @@
 // at that time (Soong processes the jars in dependency order, which may be different from the
 // the system server classpath order).
 func SystemServerDexJarHostPath(ctx android.PathContext, jar string) android.OutputPath {
-	return android.PathForOutput(ctx, ctx.Config().DeviceName(), "system_server_dexjars", jar+".jar")
+	return android.PathForOutput(ctx, ctx.Config().BuildDir(), "system_server_dexjars", jar+".jar")
 }
 
 func contains(l []string, s string) bool {