Expose "full" dexpreopt.config

1. Instead of 'slim' config, use full config even for libs
2. Define moduleJSONConfig for fields which cannot be converted to JSON
field directly(Path type field, ProfileBootListing,
DexPreoptImagesDeps are added in this CL) and exclude fields which is
convertible(DexPreoptImageLocations)

Bug: 158843648
Test: m dist
Change-Id: I3f9192ab5292bd079be1b686bb3b25735a836cbc
diff --git a/dexpreopt/dexpreopt_test.go b/dexpreopt/dexpreopt_test.go
index 12df36b..cd7551c 100644
--- a/dexpreopt/dexpreopt_test.go
+++ b/dexpreopt/dexpreopt_test.go
@@ -166,3 +166,20 @@
 		t.Errorf("\nwant installs:\n   %v\ngot:\n   %v", wantInstalls, rule.Installs())
 	}
 }
+
+func TestDexPreoptConfigToJson(t *testing.T) {
+	config := android.TestConfig("out", nil, "", nil)
+	ctx := android.BuilderContextForTesting(config)
+	module := testSystemModuleConfig(ctx, "test")
+	data, err := moduleConfigToJSON(module)
+	if err != nil {
+		t.Errorf("Failed to convert module config data to JSON, %v", err)
+	}
+	parsed, err := ParseModuleConfig(ctx, data)
+	if err != nil {
+		t.Errorf("Failed to parse JSON, %v", err)
+	}
+	before := fmt.Sprintf("%v", module)
+	after := fmt.Sprintf("%v", parsed)
+	android.AssertStringEquals(t, "The result must be the same as the original after marshalling and unmarshalling it.", before, after)
+}