Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90aa0d9b authored by Xin Li's avatar Xin Li
Browse files

DO NOT MERGE - Merge Android 10 into master

Bug: 139893257
Change-Id: I7c1b81ded862765968ef14d10ae76359e2972f27
parents 2be86f20 fc4d6ab3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ func getApiLevelsMap(config Config) map[string]int {
			"O":     26,
			"O-MR1": 27,
			"P":     28,
			"Q":     29,
		}
		for i, codename := range config.PlatformVersionCombinedCodenames() {
			apiLevelsMap[codename] = baseApiLevel + i
+10 −1
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ func init() {
	AddNeverAllowRules(createIncludeDirsRules()...)
	AddNeverAllowRules(createTrebleRules()...)
	AddNeverAllowRules(createLibcoreRules()...)
	AddNeverAllowRules(createMediaRules()...)
	AddNeverAllowRules(createJavaDeviceForHostRules()...)
}

@@ -110,7 +111,7 @@ func createTrebleRules() []Rule {

		// TODO(b/67974785): always enforce the manifest
		NeverAllow().
			Without("name", "libhidltransport").
			Without("name", "libhidltransport-impl-internal").
			With("product_variables.enforce_vintf_manifest.cflags", "*").
			Because("manifest enforcement should be independent of ."),

@@ -151,6 +152,14 @@ func createLibcoreRules() []Rule {
	return rules
}

func createMediaRules() []Rule {
	return []Rule{
		NeverAllow().
			With("libs", "updatable-media").
			Because("updatable-media includes private APIs. Use updatable_media_stubs instead."),
	}
}

func createJavaDeviceForHostRules() []Rule {
	javaDeviceForHostProjectsWhitelist := []string{
		"external/guava",
+13 −14
Original line number Diff line number Diff line
@@ -157,20 +157,6 @@ var neverallowTests = []struct {
			"manifest enforcement should be independent",
		},
	},
	{
		name: "libhidltransport enforce_vintf_manifest.cflags",
		fs: map[string][]byte{
			"Blueprints": []byte(`
				cc_library {
					name: "libhidltransport",
					product_variables: {
						enforce_vintf_manifest: {
							cflags: ["-DSHOULD_NOT_EXIST"],
						},
					},
				}`),
		},
	},

	{
		name: "no treble_linker_namespaces.cflags",
@@ -203,6 +189,19 @@ var neverallowTests = []struct {
				}`),
		},
	},
	{
		name: "dependency on updatable-media",
		fs: map[string][]byte{
			"Blueprints": []byte(`
				java_library {
					name: "needs_updatable_media",
					libs: ["updatable-media"],
				}`),
		},
		expectedErrors: []string{
			"updatable-media includes private APIs. Use updatable_media_stubs instead.",
		},
	},
	{
		name: "java_device_for_host",
		fs: map[string][]byte{
+5 −9
Original line number Diff line number Diff line
@@ -101,9 +101,8 @@ func init() {
		// not emit the table by default on Android since NDK still uses GNU binutils.
		"-faddrsig",

		// Make implicit fallthrough an error in the future.
		// -Wimplicit-fallthrough is not enabled by -Wall.
		"-Wimplicit-fallthrough",
		"-Wno-error=implicit-fallthrough",

		// Help catch common 32/64-bit errors.
		"-Werror=int-conversion",
@@ -169,11 +168,6 @@ func init() {
		"-Wno-tautological-constant-compare",
		"-Wno-tautological-type-limit-compare",

		// http://b/72330874 Disable -Wenum-compare until the instances detected by this new
		// warning are fixed.
		"-Wno-enum-compare",
		"-Wno-enum-compare-switch",

		// Disable c++98-specific warning since Android is not concerned with C++98
		// compatibility.
		"-Wno-c++98-compat-extra-semi",
@@ -182,9 +176,11 @@ func init() {
		"-Wno-return-std-move-in-c++11",
	}, " "))

	// Extra cflags for projects under external/ directory
	// Extra cflags for projects under external/ directory to disable warnings that are infeasible
	// to fix in all the external projects and their upstream repos.
	pctx.StaticVariable("ClangExtraExternalCflags", strings.Join([]string{
		// TODO(yikong): Move -Wno flags here
		"-Wno-enum-compare",
		"-Wno-enum-compare-switch",

		// http://b/72331524 Allow null pointer arithmetic until the instances detected by
		// this new warning are fixed.
+2 −1
Original line number Diff line number Diff line
@@ -56,7 +56,8 @@ var (

	minimalRuntimeFlags = []string{"-fsanitize-minimal-runtime", "-fno-sanitize-trap=integer,undefined",
		"-fno-sanitize-recover=integer,undefined"}
	hwasanGlobalOptions = []string{"heap_history_size=1023,stack_history_size=512"}
	hwasanGlobalOptions = []string{"heap_history_size=1023", "stack_history_size=512",
		"export_memory_stats=0", "max_malloc_fill_size=0"}
)

type sanitizerType int
Loading