system_api: Add D-Bus constants and protos for Private Computing

This CL adds the D-Bus constants and the requests/responses protos that
are communicating between Ash Chrome and the D-Bus service of the
Private Computing daemon.

BUG=chromium:1367021
TEST=USE=test emerge-hatch chromeos-base/system_api

Change-Id: I6586be6cedd168d7741af7b4a14fa6978877ab6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/3946799
Reviewed-by: Hirthanan Subenderan <hirthanan@google.com>
Commit-Queue: Eric Wang <qianwan@google.com>
Tested-by: Eric Wang <qianwan@google.com>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>
NOKEYCHECK=True
GitOrigin-RevId: b2ba2cac32bbbeac0e2c783793ec91543956294b
diff --git a/BUILD.gn b/BUILD.gn
index b9b2176..a69fb16 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -49,6 +49,7 @@
     ":system_api-power_manager-goprotos",
     ":system_api-power_manager-protos",
     ":system_api-privacy_screen-protos",
+    ":system_api-private_computing-protos",
     ":system_api-protos",
     ":system_api-rmad-protos",
     ":system_api-runtime_probe-goprotos",
@@ -660,3 +661,10 @@
   proto_out_dir = "go/src/"
   sources = [ "${proto_in_dir}/arc.proto" ]
 }
+
+proto_library("system_api-private_computing-protos") {
+  proto_in_dir = "dbus/private_computing"
+  proto_out_dir = "include/private_computing/proto_bindings"
+  sources = [ "${proto_in_dir}/private_computing_service.proto" ]
+  standalone = true
+}
diff --git a/dbus/private_computing/OWNERS b/dbus/private_computing/OWNERS
new file mode 100644
index 0000000..e772bf5
--- /dev/null
+++ b/dbus/private_computing/OWNERS
@@ -0,0 +1,3 @@
+nsinghal@google.com
+qianwan@google.com
+hirthanan@google.com
diff --git a/dbus/private_computing/dbus-constants.h b/dbus/private_computing/dbus-constants.h
new file mode 100644
index 0000000..ac534db
--- /dev/null
+++ b/dbus/private_computing/dbus-constants.h
@@ -0,0 +1,20 @@
+// Copyright 2022 The ChromiumOS Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYSTEM_API_DBUS_PRIVATE_COMPUTING_DBUS_CONSTANTS_H_
+#define SYSTEM_API_DBUS_PRIVATE_COMPUTING_DBUS_CONSTANTS_H_
+
+namespace private_computing {
+// Private Computing Device Active Daemon:
+constexpr char kPrivateComputingInterface[] = "org.chromium.PrivateComputing";
+constexpr char kPrivateComputingServicePath[] =
+    "/org/chromium/PrivateComputing";
+constexpr char kPrivateComputingServiceName[] = "org.chromium.PrivateComputing";
+
+// Private Computing Device Active methods:
+constexpr char kSaveStatusToPreservedFile[] = "SaveStatusToPreservedFile";
+constexpr char kGetStatusFromPreservedFile[] = "GetStatusFromPreservedFile";
+}  // namespace private_computing
+
+#endif  // SYSTEM_API_DBUS_PRIVATE_COMPUTING_DBUS_CONSTANTS_H_
diff --git a/dbus/private_computing/private_computing_service.proto b/dbus/private_computing/private_computing_service.proto
new file mode 100644
index 0000000..20ee0aa
--- /dev/null
+++ b/dbus/private_computing/private_computing_service.proto
@@ -0,0 +1,46 @@
+// Copyright 2022 The Chromium Authors
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+syntax = "proto2";
+option optimize_for = LITE_RUNTIME;
+
+package private_computing;
+
+// Use-cases for ChromeOS Private Computing Device Active.
+enum PrivateComputingUseCase {
+  // Should not be used.
+  USE_CASE_UNSPECIFIED = 0;
+  CROS_FRESNEL_DAILY = 1;
+  CROS_FRESNEL_FIRST_ACTIVE = 2;
+  CROS_FRESNEL_28DAY_ACTIVE = 3;
+}
+
+// The preserved file will include the Daily, FirstActive, 28-Day
+message ActiveStatus {
+  // The use case of ChromeOS device active Private Computing device active.
+  optional PrivateComputingUseCase use_case = 1;
+
+  // The last ping date for current use case.
+  // UTC date: YYYYMMDD
+  optional string last_ping_utc_date = 2;
+}
+
+message SaveStatusToPreservedFileRequest {
+  // The list of use case with last ping date.
+  repeated ActiveStatus active_status = 1;
+}
+
+message SaveStatusToPreservedFileResponse {
+  // Error message, empty if no error occurred.
+  optional string error_message = 1;
+}
+
+message GetStatusFromPreservedFileResponse {
+  // This field only has error message, the success value will be
+  // in active_status.
+  optional string error_message = 1;
+
+  // The list of use case with last ping date.
+  repeated ActiveStatus active_status = 2;
+}
diff --git a/system_api.pc b/system_api.pc
index dc3a4bc..3f03c68 100644
--- a/system_api.pc
+++ b/system_api.pc
@@ -1,4 +1,4 @@
 Name: system_api
 Description: Protobuffers and headers shared by Chromium OS and Chromium.
 Version: 0.1
-Libs: -lsystem_api-hps-protos -lsystem_api-power_manager-protos -lsystem_api-authpolicy-protos -lsystem_api-biod-protos -lsystem_api-protos -lsystem_api-kerberos-protos -lsystem_api-login_manager-protos -lsystem_api-lorgnette-protos -lsystem_api-smbprovider-protos -lsystem_api-vm_concierge-protos -lsystem_api-vm_applications-protos -lsystem_api-vm_disk_management-protos -lsystem_api-vm_launch-protos -lsystem_api-vm_sk_forwarding-protos -lsystem_api-vm_cicerone-protos -lsystem_api-seneschal-protos -lsystem_api-oobe_config-protos -lsystem_api-runtime_probe-protos -lsystem_api-dlcservice-protos -lsystem_api-update_engine-protos -lsystem_api-vm_plugin_dispatcher-protos -lsystem_api-u2f-protos -lsystem_api-chunneld-protos -lsystem_api-system_proxy-protos -lsystem_api-vm_permission_service-protos -lsystem_api-anomaly_detector-protos -lsystem_api-minios-protos -lsystem_api-dlp-protos -lsystem_api-rmad-protos -lsystem_api-fusebox-protos -lsystem_api-privacy_screen-protos -lsystem_api-cdm_oemcrypto-protos -lsystem_api-ml-protos -lsystem_api-lvmd-protos -lsystem_api-shadercached-protos -lsystem_api-spaced-protos -lsystem_api-imageloader-protos -lsystem_api -lsystem_api-arc-protos
+Libs: -lsystem_api-hps-protos -lsystem_api-power_manager-protos -lsystem_api-authpolicy-protos -lsystem_api-biod-protos -lsystem_api-protos -lsystem_api-kerberos-protos -lsystem_api-login_manager-protos -lsystem_api-lorgnette-protos -lsystem_api-smbprovider-protos -lsystem_api-vm_concierge-protos -lsystem_api-vm_applications-protos -lsystem_api-vm_disk_management-protos -lsystem_api-vm_launch-protos -lsystem_api-vm_sk_forwarding-protos -lsystem_api-vm_cicerone-protos -lsystem_api-seneschal-protos -lsystem_api-oobe_config-protos -lsystem_api-runtime_probe-protos -lsystem_api-dlcservice-protos -lsystem_api-update_engine-protos -lsystem_api-vm_plugin_dispatcher-protos -lsystem_api-u2f-protos -lsystem_api-chunneld-protos -lsystem_api-system_proxy-protos -lsystem_api-vm_permission_service-protos -lsystem_api-anomaly_detector-protos -lsystem_api-minios-protos -lsystem_api-dlp-protos -lsystem_api-rmad-protos -lsystem_api-fusebox-protos -lsystem_api-privacy_screen-protos -lsystem_api-cdm_oemcrypto-protos -lsystem_api-ml-protos -lsystem_api-lvmd-protos -lsystem_api-shadercached-protos -lsystem_api-spaced-protos -lsystem_api-imageloader-protos -lsystem_api -lsystem_api-arc-protos -lsystem_api-private_computing-protos