Use StatsLog to log packages denied access to device identifiers

Bug: 123646983
Test: statsd_testdrive 146
Change-Id: I33836a4bad338316e092ebe4a4fce2a49f839696
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 63f9b59..fc3aa91 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -238,6 +238,7 @@
         ProcessStartTime process_start_time = 169;
         PermissionGrantRequestResultReported permission_grant_request_result_reported = 170;
         BluetoothSocketConnectionStateChanged bluetooth_socket_connection_state_changed = 171;
+        DeviceIdentifierAccessDenied device_identifier_access_denied = 172;
     }
 
     // Pulled events will start at field 10000.
@@ -5447,3 +5448,22 @@
     optional bool is_granted = 4;
 }
 
+/**
+ * Logs when a package is denied access to a device identifier based on the new access requirements.
+ *
+ * Logged from:
+ *     frameworks/base/telephony/java/com/android/internal/telephony/TelephonyPermissions.java
+ */
+message DeviceIdentifierAccessDenied {
+    // The name of the package denied access to the requested device identifier.
+    optional string package_name = 1;
+
+    // The name of the device identifier method the package attempted to invoke.
+    optional string method_name = 2;
+
+    // True if the package is preinstalled.
+    optional bool is_preinstalled = 3;
+
+    // True if the package is privileged.
+    optional bool is_priv_app = 4;
+}