Add filename property to prebuilt_etc

filename property is an optional property that specifies the name of the
installed file which is by default name of the module.

This will be used to APEXs to have ./etc/ld.config.txt files for their
own.

Test: m (prebuilt_etc_test.go added)
Change-Id: Ic8d0c0044c5bc2c6c33117fe2c19ef6ad75451a8
diff --git a/android/prebuilt_etc_test.go b/android/prebuilt_etc_test.go
index 9244647..1ecdf79 100644
--- a/android/prebuilt_etc_test.go
+++ b/android/prebuilt_etc_test.go
@@ -91,3 +91,18 @@
 		t.Errorf("expected 1, got %#v", bar_variants)
 	}
 }
+
+func TestPrebuiltEtcOutputPath(t *testing.T) {
+	ctx := testPrebuiltEtc(t, `
+		prebuilt_etc {
+			name: "foo.conf",
+			src: "foo.conf",
+			filename: "foo.installed.conf",
+		}
+	`)
+
+	p := ctx.ModuleForTests("foo.conf", "android_common_core").Module().(*PrebuiltEtc)
+	if p.outputFilePath.Base() != "foo.installed.conf" {
+		t.Errorf("expected foo.installed.conf, got %q", p.outputFilePath.Base())
+	}
+}