diff options
Diffstat (limited to 'apex/apex.go')
-rw-r--r-- | apex/apex.go | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/apex/apex.go b/apex/apex.go index e01406bc6..33ed11199 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -1828,6 +1828,7 @@ type androidApp interface { Certificate() java.Certificate BaseModuleName() string LintDepSets() java.LintDepSets + PrivAppAllowlist() android.OptionalPath } var _ androidApp = (*java.AndroidApp)(nil) @@ -1848,7 +1849,7 @@ func sanitizedBuildIdForPath(ctx android.BaseModuleContext) string { return buildId } -func apexFileForAndroidApp(ctx android.BaseModuleContext, aapp androidApp) apexFile { +func apexFilesForAndroidApp(ctx android.BaseModuleContext, aapp androidApp) []apexFile { appDir := "app" if aapp.Privileged() { appDir = "priv-app" @@ -1870,7 +1871,15 @@ func apexFileForAndroidApp(ctx android.BaseModuleContext, aapp androidApp) apexF }); ok { af.overriddenPackageName = app.OverriddenManifestPackageName() } - return af + apexFiles := []apexFile{af} + + if allowlist := aapp.PrivAppAllowlist(); allowlist.Valid() { + dirInApex := filepath.Join("etc", "permissions") + privAppAllowlist := newApexFile(ctx, allowlist.Path(), aapp.BaseModuleName()+"privapp", dirInApex, etc, aapp) + apexFiles = append(apexFiles, privAppAllowlist) + } + + return apexFiles } func apexFileForRuntimeResourceOverlay(ctx android.BaseModuleContext, rro java.RuntimeResourceOverlayModule) apexFile { @@ -1964,9 +1973,6 @@ func (a *apexBundle) QueueBazelCall(ctx android.BaseModuleContext) { // overridden by different override_apex modules (e.g. Google or Go variants), // which is handled by the overrides mutators. func (a *apexBundle) GetBazelLabel(ctx android.BazelConversionPathContext, module blueprint.Module) string { - if _, ok := ctx.Module().(android.OverridableModule); ok { - return android.MaybeBp2buildLabelOfOverridingModule(ctx) - } return a.BazelModuleBase.GetBazelLabel(ctx, a) } @@ -2318,12 +2324,12 @@ func (a *apexBundle) depVisitor(vctx *visitorContext, ctx android.ModuleContext, case androidAppTag: switch ap := child.(type) { case *java.AndroidApp: - vctx.filesInfo = append(vctx.filesInfo, apexFileForAndroidApp(ctx, ap)) + vctx.filesInfo = append(vctx.filesInfo, apexFilesForAndroidApp(ctx, ap)...) return true // track transitive dependencies case *java.AndroidAppImport: - vctx.filesInfo = append(vctx.filesInfo, apexFileForAndroidApp(ctx, ap)) + vctx.filesInfo = append(vctx.filesInfo, apexFilesForAndroidApp(ctx, ap)...) case *java.AndroidTestHelperApp: - vctx.filesInfo = append(vctx.filesInfo, apexFileForAndroidApp(ctx, ap)) + vctx.filesInfo = append(vctx.filesInfo, apexFilesForAndroidApp(ctx, ap)...) case *java.AndroidAppSet: appDir := "app" if ap.Privileged() { @@ -2675,7 +2681,7 @@ func apexBootclasspathFragmentFiles(ctx android.ModuleContext, module blueprint. } pathInApex := bootclasspathFragmentInfo.ProfileInstallPathInApex() - if pathInApex != "" && !java.SkipDexpreoptBootJars(ctx) { + if pathInApex != "" { pathOnHost := bootclasspathFragmentInfo.ProfilePathOnHost() tempPath := android.PathForModuleOut(ctx, "boot_image_profile", pathInApex) @@ -3426,15 +3432,6 @@ func makeApexAvailableBaseline() map[string][]string { // Module separator // m[android.AvailableToAnyApex] = []string{ - // TODO(b/156996905) Set apex_available/min_sdk_version for androidx/extras support libraries - "androidx", - "androidx-constraintlayout_constraintlayout", - "androidx-constraintlayout_constraintlayout-nodeps", - "androidx-constraintlayout_constraintlayout-solver", - "androidx-constraintlayout_constraintlayout-solver-nodeps", - "com.google.android.material_material", - "com.google.android.material_material-nodeps", - "libclang_rt", "libprofile-clang-extras", "libprofile-clang-extras_ndk", |