diff --git a/etc/prebuilt_etc.go b/etc/prebuilt_etc.go index d1c1d853e..025ba27aa 100644 --- a/etc/prebuilt_etc.go +++ b/etc/prebuilt_etc.go @@ -55,6 +55,9 @@ func RegisterPrebuiltEtcBuildComponents(ctx android.RegistrationContext) { ctx.RegisterModuleType("prebuilt_usr_share", PrebuiltUserShareFactory) ctx.RegisterModuleType("prebuilt_usr_share_host", PrebuiltUserShareHostFactory) ctx.RegisterModuleType("prebuilt_usr_hyphendata", PrebuiltUserHyphenDataFactory) + ctx.RegisterModuleType("prebuilt_usr_keylayout", PrebuiltUserKeyLayoutFactory) + ctx.RegisterModuleType("prebuilt_usr_keychars", PrebuiltUserKeyCharsFactory) + ctx.RegisterModuleType("prebuilt_usr_idc", PrebuiltUserIdcFactory) ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory) ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory) ctx.RegisterModuleType("prebuilt_dsp", PrebuiltDSPFactory) @@ -609,6 +612,39 @@ func PrebuiltUserHyphenDataFactory() android.Module { return module } +// prebuilt_usr_keylayout is for a prebuilt artifact that is installed in +// /usr/keylayout/ directory. +func PrebuiltUserKeyLayoutFactory() android.Module { + module := &PrebuiltEtc{} + InitPrebuiltEtcModule(module, "usr/keylayout") + // This module is device-only + android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst) + android.InitDefaultableModule(module) + return module +} + +// prebuilt_usr_keychars is for a prebuilt artifact that is installed in +// /usr/keychars/ directory. +func PrebuiltUserKeyCharsFactory() android.Module { + module := &PrebuiltEtc{} + InitPrebuiltEtcModule(module, "usr/keychars") + // This module is device-only + android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst) + android.InitDefaultableModule(module) + return module +} + +// prebuilt_usr_idc is for a prebuilt artifact that is installed in +// /usr/idc/ directory. +func PrebuiltUserIdcFactory() android.Module { + module := &PrebuiltEtc{} + InitPrebuiltEtcModule(module, "usr/idc") + // This module is device-only + android.InitAndroidArchModule(module, android.DeviceSupported, android.MultilibFirst) + android.InitDefaultableModule(module) + return module +} + // prebuilt_font installs a font in /fonts directory. func PrebuiltFontFactory() android.Module { module := &PrebuiltEtc{} diff --git a/etc/prebuilt_etc_test.go b/etc/prebuilt_etc_test.go index dd9958caf..3ee234069 100644 --- a/etc/prebuilt_etc_test.go +++ b/etc/prebuilt_etc_test.go @@ -287,6 +287,48 @@ func TestPrebuiltPrebuiltUserHyphenDataInstallDirPath(t *testing.T) { android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath) } +func TestPrebuiltPrebuiltUserKeyLayoutInstallDirPath(t *testing.T) { + result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` + prebuilt_usr_keylayout { + name: "foo.conf", + src: "foo.conf", + sub_dir: "bar", + } + `) + + p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) + expected := "out/soong/target/product/test_device/system/usr/keylayout/bar" + android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath) +} + +func TestPrebuiltPrebuiltUserKeyCharsInstallDirPath(t *testing.T) { + result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` + prebuilt_usr_keychars { + name: "foo.conf", + src: "foo.conf", + sub_dir: "bar", + } + `) + + p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) + expected := "out/soong/target/product/test_device/system/usr/keychars/bar" + android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath) +} + +func TestPrebuiltPrebuiltUserIdcInstallDirPath(t *testing.T) { + result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` + prebuilt_usr_idc { + name: "foo.conf", + src: "foo.conf", + sub_dir: "bar", + } + `) + + p := result.Module("foo.conf", "android_arm64_armv8-a").(*PrebuiltEtc) + expected := "out/soong/target/product/test_device/system/usr/idc/bar" + android.AssertPathRelativeToTopEquals(t, "install dir", expected, p.installDirPath) +} + func TestPrebuiltFontInstallDirPath(t *testing.T) { result := prepareForPrebuiltEtcTest.RunTestWithBp(t, ` prebuilt_font {