Merge "Export the cert path for runtime_resource_overlay."
This commit is contained in:
commit
411a98a917
|
@ -341,7 +341,7 @@ func (app *AndroidApp) AndroidMkEntries() []android.AndroidMkEntries {
|
||||||
|
|
||||||
entries.SetBoolIfTrue("LOCAL_PRIVILEGED_MODULE", app.Privileged())
|
entries.SetBoolIfTrue("LOCAL_PRIVILEGED_MODULE", app.Privileged())
|
||||||
|
|
||||||
entries.SetPath("LOCAL_CERTIFICATE", app.certificate.Pem)
|
entries.SetString("LOCAL_CERTIFICATE", app.certificate.AndroidMkString())
|
||||||
entries.AddStrings("LOCAL_OVERRIDES_PACKAGES", app.getOverriddenPackages()...)
|
entries.AddStrings("LOCAL_OVERRIDES_PACKAGES", app.getOverriddenPackages()...)
|
||||||
|
|
||||||
for _, jniLib := range app.installJniLibs {
|
for _, jniLib := range app.installJniLibs {
|
||||||
|
@ -699,6 +699,7 @@ func (r *RuntimeResourceOverlay) AndroidMkEntries() []android.AndroidMkEntries {
|
||||||
Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk",
|
Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk",
|
||||||
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
ExtraEntries: []android.AndroidMkExtraEntriesFunc{
|
||||||
func(entries *android.AndroidMkEntries) {
|
func(entries *android.AndroidMkEntries) {
|
||||||
|
entries.SetString("LOCAL_CERTIFICATE", r.certificate.AndroidMkString())
|
||||||
entries.SetPath("LOCAL_MODULE_PATH", r.installDir.ToMakePath())
|
entries.SetPath("LOCAL_MODULE_PATH", r.installDir.ToMakePath())
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -1243,6 +1243,8 @@ type RuntimeResourceOverlay struct {
|
||||||
|
|
||||||
properties RuntimeResourceOverlayProperties
|
properties RuntimeResourceOverlayProperties
|
||||||
|
|
||||||
|
certificate Certificate
|
||||||
|
|
||||||
outputFile android.Path
|
outputFile android.Path
|
||||||
installDir android.InstallPath
|
installDir android.InstallPath
|
||||||
}
|
}
|
||||||
|
@ -1288,6 +1290,7 @@ func (r *RuntimeResourceOverlay) GenerateAndroidBuildActions(ctx android.ModuleC
|
||||||
certificates = processMainCert(r.ModuleBase, String(r.properties.Certificate), certificates, ctx)
|
certificates = processMainCert(r.ModuleBase, String(r.properties.Certificate), certificates, ctx)
|
||||||
signed := android.PathForModuleOut(ctx, "signed", r.Name()+".apk")
|
signed := android.PathForModuleOut(ctx, "signed", r.Name()+".apk")
|
||||||
SignAppPackage(ctx, signed, r.aapt.exportPackage, certificates)
|
SignAppPackage(ctx, signed, r.aapt.exportPackage, certificates)
|
||||||
|
r.certificate = certificates[0]
|
||||||
|
|
||||||
r.outputFile = signed
|
r.outputFile = signed
|
||||||
r.installDir = android.PathForModuleInstall(ctx, "overlay", String(r.properties.Theme))
|
r.installDir = android.PathForModuleInstall(ctx, "overlay", String(r.properties.Theme))
|
||||||
|
|
|
@ -2242,10 +2242,15 @@ func TestRuntimeResourceOverlay(t *testing.T) {
|
||||||
if expected != signingFlag {
|
if expected != signingFlag {
|
||||||
t.Errorf("Incorrect signing flags, expected: %q, got: %q", expected, signingFlag)
|
t.Errorf("Incorrect signing flags, expected: %q, got: %q", expected, signingFlag)
|
||||||
}
|
}
|
||||||
|
path := android.AndroidMkEntriesForTest(t, config, "", m.Module())[0].EntryMap["LOCAL_CERTIFICATE"]
|
||||||
|
expectedPath := []string{"build/make/target/product/security/platform.x509.pem"}
|
||||||
|
if !reflect.DeepEqual(path, expectedPath) {
|
||||||
|
t.Errorf("Unexpected LOCAL_CERTIFICATE value: %v, expected: %v", path, expectedPath)
|
||||||
|
}
|
||||||
|
|
||||||
// Check device location.
|
// Check device location.
|
||||||
path := android.AndroidMkEntriesForTest(t, config, "", m.Module())[0].EntryMap["LOCAL_MODULE_PATH"]
|
path = android.AndroidMkEntriesForTest(t, config, "", m.Module())[0].EntryMap["LOCAL_MODULE_PATH"]
|
||||||
expectedPath := []string{"/tmp/target/product/test_device/product/overlay"}
|
expectedPath = []string{"/tmp/target/product/test_device/product/overlay"}
|
||||||
if !reflect.DeepEqual(path, expectedPath) {
|
if !reflect.DeepEqual(path, expectedPath) {
|
||||||
t.Errorf("Unexpected LOCAL_MODULE_PATH value: %v, expected: %v", path, expectedPath)
|
t.Errorf("Unexpected LOCAL_MODULE_PATH value: %v, expected: %v", path, expectedPath)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue