Add android bp to proto_logging

Use atoms.proto in proto_logging as the source of truth
Create the necessary filegroups for the framework

Bug: 167962588
Test: m -j && m CtsStatsdAtomHostTestCases

Change-Id: I184cf8bf882f456fc0d52ebd7c7f19a2d2504a96
Merged-In: I184cf8bf882f456fc0d52ebd7c7f19a2d2504a96
diff --git a/stats/Android.bp b/stats/Android.bp
new file mode 100644
index 0000000..55ba26a
--- /dev/null
+++ b/stats/Android.bp
@@ -0,0 +1,58 @@
+//
+// Copyright (C) 2020 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+// ==========================================================
+// Build the library for use on the host
+// ==========================================================
+cc_library_host_shared {
+    name: "libstats_proto_host",
+    srcs: [
+        "atoms.proto",
+        "atom_field_options.proto",
+    ],
+
+    shared_libs: [
+        "libplatformprotos",
+    ],
+
+    proto: {
+        type: "full",
+        export_proto_headers: true,
+        include_dirs: [
+            "external/protobuf/src",
+        ],
+    },
+
+    export_shared_lib_headers: [
+        "libplatformprotos",
+    ]
+
+}
+
+filegroup {
+    name: "libstats_atoms_proto",
+    srcs: [
+        "atoms.proto",
+    ],
+}
+
+filegroup {
+    name: "libstats_internal_protos",
+    srcs: [
+        "atoms.proto",
+        "atom_field_options.proto",
+    ],
+}
diff --git a/stats/atoms.proto b/stats/atoms.proto
index cca6299..d93fabd 100644
--- a/stats/atoms.proto
+++ b/stats/atoms.proto
@@ -20,7 +20,7 @@
 option java_package = "com.android.os";
 option java_outer_classname = "AtomsProto";
 
-import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
+import "frameworks/proto_logging/stats/atom_field_options.proto";
 import "frameworks/base/core/proto/android/app/enums.proto";
 import "frameworks/base/core/proto/android/app/job/enums.proto";
 import "frameworks/base/core/proto/android/app/settings_enums.proto";