rename mediaanalytics->mediametrics, wider access

reflect the change from "mediaanalytics" to "mediametrics"

Also incorporates a broader access to the service -- e.g. anyone.
This reflects that a number of metrics submissions come from application
space and not only from our controlled, trusted media related processes.
The metrics service (in another commit) checks on the source of any
incoming metrics data and limits what is allowed from unprivileged
clients.

Bug: 34615027
Test: clean build, service running and accessible
Change-Id: I657c343ea1faed536c3ee1940f1e7a178e813a42
diff --git a/private/file_contexts b/private/file_contexts
index 22a3669..05b6731 100644
--- a/private/file_contexts
+++ b/private/file_contexts
@@ -183,7 +183,7 @@
 /system/bin/audioserver	u:object_r:audioserver_exec:s0
 /system/bin/mediadrmserver	u:object_r:mediadrmserver_exec:s0
 /system/bin/mediaserver	u:object_r:mediaserver_exec:s0
-/system/bin/mediaanalytics	u:object_r:mediaanalytics_exec:s0
+/system/bin/mediametrics	u:object_r:mediametrics_exec:s0
 /system/bin/cameraserver	u:object_r:cameraserver_exec:s0
 /system/bin/mediaextractor	u:object_r:mediaextractor_exec:s0
 /system/bin/mediacodec	u:object_r:mediacodec_exec:s0
diff --git a/private/mediaanalytics.te b/private/mediametrics.te
similarity index 77%
rename from private/mediaanalytics.te
rename to private/mediametrics.te
index 0092fbe..11f17d2 100644
--- a/private/mediaanalytics.te
+++ b/private/mediametrics.te
@@ -1,3 +1,3 @@
 # type_transition must be private policy the domain_trans rules could stay
 # public, but conceptually should go with this
-init_daemon_domain(mediaanalytics)
+init_daemon_domain(mediametrics)
diff --git a/private/platform_app.te b/private/platform_app.te
index ee1c9d3..8d03251 100644
--- a/private/platform_app.te
+++ b/private/platform_app.te
@@ -41,6 +41,7 @@
 allow platform_app cameraserver_service:service_manager find;
 allow platform_app drmserver_service:service_manager find;
 allow platform_app mediaserver_service:service_manager find;
+allow platform_app mediametrics_service:service_manager find;
 allow platform_app mediaextractor_service:service_manager find;
 allow platform_app mediacodec_service:service_manager find;
 allow platform_app mediadrmserver_service:service_manager find;
diff --git a/private/priv_app.te b/private/priv_app.te
index 95ef3e8..568afe6 100644
--- a/private/priv_app.te
+++ b/private/priv_app.te
@@ -24,6 +24,7 @@
 allow priv_app cameraserver_service:service_manager find;
 allow priv_app drmserver_service:service_manager find;
 allow priv_app mediacodec_service:service_manager find;
+allow priv_app mediametrics_service:service_manager find;
 allow priv_app mediadrmserver_service:service_manager find;
 allow priv_app mediaextractor_service:service_manager find;
 allow priv_app mediaserver_service:service_manager find;
diff --git a/private/service_contexts b/private/service_contexts
index de0caa9..ebb3265 100644
--- a/private/service_contexts
+++ b/private/service_contexts
@@ -78,7 +78,7 @@
 media.camera.proxy                        u:object_r:cameraproxy_service:s0
 media.log                                 u:object_r:audioserver_service:s0
 media.player                              u:object_r:mediaserver_service:s0
-media.analytics                           u:object_r:mediaanalytics_service:s0
+media.metrics                             u:object_r:mediametrics_service:s0
 media.extractor                           u:object_r:mediaextractor_service:s0
 media.codec                               u:object_r:mediacodec_service:s0
 media.resource_manager                    u:object_r:mediaserver_service:s0
diff --git a/private/untrusted_app.te b/private/untrusted_app.te
index 57c82de..643f952 100644
--- a/private/untrusted_app.te
+++ b/private/untrusted_app.te
@@ -72,6 +72,7 @@
 allow untrusted_app mediaserver_service:service_manager find;
 allow untrusted_app mediaextractor_service:service_manager find;
 allow untrusted_app mediacodec_service:service_manager find;
+allow untrusted_app mediametrics_service:service_manager find;
 allow untrusted_app mediadrmserver_service:service_manager find;
 allow untrusted_app nfc_service:service_manager find;
 allow untrusted_app radio_service:service_manager find;