Merge "Add total build time to metrics" am: 5fdf5d4b3e am: 5170ca4d2d am: 318629d635

Change-Id: I0d371f4de6720da84979caf6f8de6936c49b2fcc
diff --git a/android/neverallow.go b/android/neverallow.go
index cef73fb..39184b5 100644
--- a/android/neverallow.go
+++ b/android/neverallow.go
@@ -52,6 +52,7 @@
 	AddNeverAllowRules(createTrebleRules()...)
 	AddNeverAllowRules(createLibcoreRules()...)
 	AddNeverAllowRules(createMediaRules()...)
+	AddNeverAllowRules(createMediaProviderRules()...)
 	AddNeverAllowRules(createJavaDeviceForHostRules()...)
 }
 
@@ -157,6 +158,14 @@
 	}
 }
 
+func createMediaProviderRules() []Rule {
+	return []Rule{
+		NeverAllow().
+			With("libs", "framework-mediaprovider").
+			Because("framework-mediaprovider includes private APIs. Use framework_mediaprovider_stubs instead."),
+	}
+}
+
 func createJavaDeviceForHostRules() []Rule {
 	javaDeviceForHostProjectsWhitelist := []string{
 		"external/guava",
diff --git a/android/neverallow_test.go b/android/neverallow_test.go
index 6f07a4a..b57bb3f 100644
--- a/android/neverallow_test.go
+++ b/android/neverallow_test.go
@@ -203,6 +203,19 @@
 		},
 	},
 	{
+		name: "dependency on framework-mediaprovider",
+		fs: map[string][]byte{
+			"Android.bp": []byte(`
+				java_library {
+					name: "needs_framework_mediaprovider",
+					libs: ["framework-mediaprovider"],
+				}`),
+		},
+		expectedErrors: []string{
+			"framework-mediaprovider includes private APIs. Use framework_mediaprovider_stubs instead.",
+		},
+	},
+	{
 		name: "java_device_for_host",
 		fs: map[string][]byte{
 			"Android.bp": []byte(`
diff --git a/apex/apex.go b/apex/apex.go
index 33b1be3..3d1b20e 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -126,6 +126,10 @@
 	//
 	// Module separator
 	//
+	m["com.android.cellbroadcast"] = []string{"CellBroadcastApp", "CellBroadcastServiceModule"}
+	//
+	// Module separator
+	//
 	m["com.android.conscrypt"] = []string{"boringssl_self_test", "libc++", "libcrypto", "libssl"}
 	//
 	// Module separator
@@ -134,6 +138,10 @@
 	//
 	// Module separator
 	//
+	m["com.android.incremental"] = []string{"libc++", "libdataloader", "libincfs"}
+	//
+	// Module separator
+	//
 	m["com.android.media"] = []string{
 		"android.hardware.cas@1.0",
 		"android.hardware.cas.native@1.0",
@@ -144,6 +152,7 @@
 		"android.hidl.token@1.0-utils",
 		"libaacextractor",
 		"libamrextractor",
+		"libaudioutils",
 		"libbase",
 		"libbinderthreadstate",
 		"libc++",
@@ -159,6 +168,8 @@
 		"libmpeg2extractor",
 		"liboggextractor",
 		"libprocessgroup",
+		"libspeexresampler",
+		"libstagefright_flacdec",
 		"libutils",
 		"libwavextractor",
 		"updatable-media",
@@ -168,36 +179,39 @@
 	//
 	m["com.android.media.swcodec"] = []string{
 		"android.frameworks.bufferhub@1.0",
-		"android.hardware.configstore@1.0",
-		"android.hardware.configstore@1.1",
-		"android.hardware.configstore-utils",
+		"android.hardware.common-ndk_platform",
 		"android.hardware.graphics.allocator@2.0",
 		"android.hardware.graphics.allocator@3.0",
+		"android.hardware.graphics.allocator@4.0",
 		"android.hardware.graphics.bufferqueue@1.0",
 		"android.hardware.graphics.bufferqueue@2.0",
 		"android.hardware.graphics.common@1.0",
 		"android.hardware.graphics.common@1.1",
 		"android.hardware.graphics.common@1.2",
+		"android.hardware.graphics.common-ndk_platform",
 		"android.hardware.graphics.mapper@2.0",
 		"android.hardware.graphics.mapper@2.1",
 		"android.hardware.graphics.mapper@3.0",
+		"android.hardware.graphics.mapper@4.0",
 		"android.hardware.media@1.0",
 		"android.hardware.media.bufferpool@2.0",
 		"android.hardware.media.c2@1.0",
+		"android.hardware.media.c2@1.1",
 		"android.hardware.media.omx@1.0",
 		"android.hidl.memory@1.0",
 		"android.hidl.memory.token@1.0",
 		"android.hidl.safe_union@1.0",
 		"android.hidl.token@1.0",
 		"android.hidl.token@1.0-utils",
+		"libaudioutils",
 		"libavservices_minijail",
-		"libbacktrace",
 		"libbase",
 		"libbinderthreadstate",
 		"libc++",
 		"libcap",
 		"libcodec2",
 		"libcodec2_hidl@1.0",
+		"libcodec2_hidl@1.1",
 		"libcodec2_soft_aacdec",
 		"libcodec2_soft_aacenc",
 		"libcodec2_soft_amrnbdec",
@@ -232,23 +246,19 @@
 		"libcodec2_vndk",
 		"libc_scudo",
 		"libcutils",
-		"libdexfile_support",
-		"libEGL",
 		"libfmq",
-		"libgraphicsenv",
+		"libgralloctypes",
 		"libhardware",
 		"libhidlbase",
 		"libhidlmemory",
 		"libion",
-		"liblzma",
 		"libmedia_codecserviceregistrant",
 		"libminijail",
-		"libnativebridge_lazy",
-		"libnativeloader_lazy",
 		"libopus",
 		"libprocessgroup",
 		"libscudo_wrapper",
 		"libsfplugin_ccodec_utils",
+		"libspeexresampler",
 		"libstagefright_amrnb_common",
 		"libstagefright_bufferpool@2.0.1",
 		"libstagefright_bufferqueue_helper",
@@ -257,7 +267,6 @@
 		"libstagefright_foundation",
 		"libsync",
 		"libui",
-		"libunwindstack",
 		"libutils",
 		"libvorbisidec",
 		"libvpx",
@@ -267,6 +276,14 @@
 	//
 	// Module separator
 	//
+	m["com.android.mediaprovider"] = []string{"libfuse", "MediaProvider", "MediaProviderGoogle"}
+	//
+	// Module separator
+	//
+	m["com.android.permission"] = []string{"GooglePermissionController", "PermissionController"}
+	//
+	// Module separator
+	//
 	m["com.android.runtime"] = []string{
 		"libbase",
 		"libc++",
@@ -286,13 +303,14 @@
 	//
 	// Module separator
 	//
-	m["com.android.vndk"] = []string{
-		"libbacktrace",
-		"libbinderthreadstate",
-		"libblas",
-		"libcompiler_rt",
-		"libgui",
-		"libunwind",
+	m["com.android.wifi"] = []string{
+		"libbase",
+		"libc++",
+		"libcutils",
+		"libprocessgroup",
+		"libutils",
+		"libwifi-jni",
+		"wifi-service-resources",
 	}
 	//
 	// Module separator
diff --git a/cc/config/vndk.go b/cc/config/vndk.go
index 3b16c78..b5aa7de 100644
--- a/cc/config/vndk.go
+++ b/cc/config/vndk.go
@@ -28,6 +28,7 @@
 	"android.hardware.audio@4.0",
 	"android.hardware.audio@5.0",
 	"android.hardware.automotive.evs@1.0",
+	"android.hardware.automotive.occupant_awareness-ndk_platform",
 	"android.hardware.automotive.vehicle@2.0",
 	"android.hardware.bluetooth.audio@2.0",
 	"android.hardware.boot@1.0",
@@ -75,6 +76,7 @@
 	"android.hardware.power@1.0",
 	"android.hardware.power@1.1",
 	"android.hardware.radio@1.4",
+	"android.hardware.rebootescrow-ndk_platform",
 	"android.hardware.secure_element@1.0",
 	"android.hardware.sensors@1.0",
 	"android.hardware.soundtrigger@2.0",
@@ -109,6 +111,8 @@
 	"libaudioutils",
 	"libbinder",
 	"libcamera_metadata",
+	"libcodec2_hidl@1.0",
+	"libcodec2_vndk",
 	"libcrypto",
 	"libdiskconfig",
 	"libdumpstateutil",
@@ -160,6 +164,7 @@
 	"libstagefright_soft_vorbisdec",
 	"libstagefright_soft_vpxdec",
 	"libstagefright_soft_vpxenc",
+	"libstagefright_softomx",
 	"libstagefright_xmlparser",
 	"libsysutils",
 	"libtinyxml2",
diff --git a/java/config/config.go b/java/config/config.go
index 6da7279..7a86916 100644
--- a/java/config/config.go
+++ b/java/config/config.go
@@ -37,6 +37,7 @@
 
 	InstrumentFrameworkModules = []string{
 		"framework",
+		"framework-minus-apex",
 		"telephony-common",
 		"services",
 		"android.car",
@@ -47,6 +48,7 @@
 		"core-libart",
 		// TODO: Could this be all updatable bootclasspath jars?
 		"updatable-media",
+		"framework-mediaprovider",
 		"framework-sdkextensions",
 		"ike",
 	}