Add privileged app support in Soong am: 16056060d5
am: 129dff903f
am: 6f05b664e4
Change-Id: I454317887c6f4daa2c6f11dfa99ca34b636bb2ac
This commit is contained in:
commit
2b261dbec0
3 changed files with 11 additions and 0 deletions
|
@ -153,6 +153,7 @@ func init() {
|
|||
"LOCAL_PROPRIETARY_MODULE": "proprietary",
|
||||
"LOCAL_VENDOR_MODULE": "vendor",
|
||||
"LOCAL_EXPORT_PACKAGE_RESOURCES": "export_package_resources",
|
||||
"LOCAL_PRIVILEGED_MODULE": "privileged",
|
||||
|
||||
"LOCAL_DEX_PREOPT": "dex_preopt.enabled",
|
||||
"LOCAL_DEX_PREOPT_APP_IMAGE": "dex_preopt.app_image",
|
||||
|
|
|
@ -177,6 +177,9 @@ func (app *AndroidApp) AndroidMk() android.AndroidMkData {
|
|||
|
||||
fmt.Fprintln(w, "LOCAL_FULL_MANIFEST_FILE :=", app.manifestPath.String())
|
||||
|
||||
if Bool(app.appProperties.Privileged) {
|
||||
fmt.Fprintln(w, "LOCAL_PRIVILEGED_MODULE := true")
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -61,6 +61,11 @@ type androidAppProperties struct {
|
|||
Resource_dirs []string
|
||||
|
||||
Instrumentation_for *string
|
||||
|
||||
// Specifies that this app should be installed to the priv-app directory,
|
||||
// where the system will grant it additional privileges not available to
|
||||
// normal apps.
|
||||
Privileged *bool
|
||||
}
|
||||
|
||||
type AndroidApp struct {
|
||||
|
@ -152,6 +157,8 @@ func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
|||
if ctx.ModuleName() == "framework-res" {
|
||||
// framework-res.apk is installed as system/framework/framework-res.apk
|
||||
ctx.InstallFile(android.PathForModuleInstall(ctx, "framework"), ctx.ModuleName()+".apk", a.outputFile)
|
||||
} else if Bool(a.appProperties.Privileged) {
|
||||
ctx.InstallFile(android.PathForModuleInstall(ctx, "priv-app"), ctx.ModuleName()+".apk", a.outputFile)
|
||||
} else {
|
||||
ctx.InstallFile(android.PathForModuleInstall(ctx, "app"), ctx.ModuleName()+".apk", a.outputFile)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue