Key property is removed from prebuilt_apex
The property is not needed as key is embedded in the apex. Bug: 128344735 Test: m Change-Id: Iae671994fc271593dd9319f6262279736ea34ad1
This commit is contained in:
parent
42cca6c951
commit
c320e8262a
10
apex/apex.go
10
apex/apex.go
|
@ -1317,18 +1317,9 @@ type PrebuiltProperties struct {
|
|||
Src *string
|
||||
}
|
||||
}
|
||||
|
||||
// the name of the apex_key module that contains the matching public key to be installed.
|
||||
Key *string
|
||||
}
|
||||
|
||||
func (p *Prebuilt) DepsMutator(ctx android.BottomUpMutatorContext) {
|
||||
if String(p.properties.Key) == "" {
|
||||
ctx.ModuleErrorf("key is missing")
|
||||
return
|
||||
}
|
||||
ctx.AddDependency(ctx.Module(), keyTag, *p.properties.Key)
|
||||
|
||||
// This is called before prebuilt_select and prebuilt_postdeps mutators
|
||||
// The mutators requires that src to be set correctly for each arch so that
|
||||
// arch variants are disabled when src is not provided for the arch.
|
||||
|
@ -1380,7 +1371,6 @@ func (p *Prebuilt) AndroidMk() android.AndroidMkData {
|
|||
func(w io.Writer, outputFile android.Path) {
|
||||
fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", filepath.Join("$(OUT_DIR)", p.installDir.RelPathString()))
|
||||
fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", p.BaseModuleName()+imageApexSuffix)
|
||||
fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES :=", String(p.properties.Key))
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
package apex
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
|
@ -1248,14 +1246,6 @@ func TestPrebuilt(t *testing.T) {
|
|||
src: "myapex-arm.apex",
|
||||
},
|
||||
},
|
||||
key: "myapex.key"
|
||||
}
|
||||
|
||||
apex_key {
|
||||
name: "myapex.key",
|
||||
public_key: "testkey.avbpubkey",
|
||||
private_key: "testkey.pem",
|
||||
product_specific: true,
|
||||
}
|
||||
`)
|
||||
|
||||
|
@ -1265,24 +1255,4 @@ func TestPrebuilt(t *testing.T) {
|
|||
if prebuilt.inputApex.String() != expectedInput {
|
||||
t.Errorf("inputApex invalid. expected: %q, actual: %q", expectedInput, prebuilt.inputApex.String())
|
||||
}
|
||||
|
||||
// Check if the key module is added as a required module.
|
||||
buf := &bytes.Buffer{}
|
||||
prebuilt.AndroidMk().Extra[0](buf, nil)
|
||||
found := false
|
||||
scanner := bufio.NewScanner(bytes.NewReader(buf.Bytes()))
|
||||
expected := "myapex.key"
|
||||
for scanner.Scan() {
|
||||
line := scanner.Text()
|
||||
tok := strings.Split(line, " := ")
|
||||
if tok[0] == "LOCAL_REQUIRED_MODULES" {
|
||||
found = true
|
||||
if tok[1] != "myapex.key" {
|
||||
t.Errorf("Unexpected LOCAL_REQUIRED_MODULES '%s', expected '%s'", tok[1], expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
t.Errorf("Couldn't find a LOCAL_REQUIRED_MODULES entry")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue