[stats] add metrics for package installer v2

// Successful installation:
$ out/host/linux-x86/bin/statsd_testdrive -s 98141FFBA005QD 263
...
event_metrics {
  data {
    elapsed_timestamp_nanos: 147291968369
    atom {
      package_installer_v2_reported {
        is_incremental: true
        package_name: "com.unity.megacity"
        duration_millis: 1379
        return_code: 1
      }
    }
  }
}
...

// Failed installation:
$ out/host/linux-x86/bin/statsd_testdrive -s 98141FFBA005QD 263
...
event_metrics {
  data {
    elapsed_timestamp_nanos: 94418812060
    atom {
      package_installer_v2_reported {
        is_incremental: true
        package_name: ""
        duration_millis: 37
        return_code: -20
      }
    }
  }
}
...

Test: manual
BUG: 152913040
Change-Id: Ibb02122e7007f8e3afd65cbb98236bc37c0d24db
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 2a1716e..38b421f 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -420,6 +420,7 @@
         RankingSelected ranking_selected = 260 [(module) = "framework"];
         TvSettingsUIInteracted tvsettings_ui_interacted = 261 [(module) = "tv_settings"];
         LauncherStaticLayout launcher_snapshot = 262 [(module) = "sysui"];
+        PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
         SdkExtensionStatus sdk_extension_status = 354;
     }
 
@@ -9308,6 +9309,25 @@
 }
 
 /**
+ * Logs information about a package installation using package installer V2 APIs.
+ *
+ * Logged from:
+ *      frameworks/base/services/core/java/com/android/server/pm/PackageInstallerSession.java
+ */
+message PackageInstallerV2Reported {
+    // Whether this installation uses Incremental File System
+    optional bool is_incremental = 1;
+    // Name of the package that is intended to be installed
+    optional string package_name = 2;
+    // The duration between when the install was requested to when the install has completed
+    optional int64 duration_millis = 3;
+    // Installation result in final integer, which are SystemApi's.
+    // Return_code 1 indicates success.
+    // For full list, see frameworks/base/core/java/android/content/pm/PackageManager.java
+    optional int32 return_code  = 4;
+}
+
+/**
  * Logs settings provider values.
  *
  * Use DeviceConfig.getProperties to get a list Setting key, query the data from content provider,