Add atoms for accessibility shortcut
* AccessibilityShortcutReported: Logs when accessibility shortcut clicked.
* AccessibilityServiceReported: Logs when accessibility service status changed.
Metrics council review bug: 153342192
Bug: 151285965
Test: build pass
Change-Id: Idf853c5dab190404380c3564f40bfb7677fe1473
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 13e7ac1..88824f0 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -46,6 +46,7 @@
import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto";
import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto";
import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
+import "frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto";
import "frameworks/base/core/proto/android/stats/enums.proto";
import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
@@ -423,6 +424,9 @@
PackageInstallerV2Reported package_installer_v2_reported = 263 [(module) = "framework"];
UserLifecycleJourneyReported user_lifecycle_journey_reported = 264 [(module) = "framework"];
UserLifecycleEventOccurred user_lifecycle_event_occurred = 265 [(module) = "framework"];
+ AccessibilityShortcutReported accessibility_shortcut_reported =
+ 266 [(module) = "framework"];
+ AccessibilityServiceReported accessibility_service_reported = 267 [(module) = "framework"];
SdkExtensionStatus sdk_extension_status = 354;
// StatsdStats tracks platform atoms with ids upto 500.
@@ -9441,3 +9445,38 @@
}
optional State state = 4; // Represents the state of an event (beginning/ending)
}
+
+/**
+ * Logs when accessibility shortcut clicked.
+ *
+ * Logged from:
+ * frameworks/base/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+ */
+message AccessibilityShortcutReported {
+ // The accessibility feature(including installed a11y service, framework a11y feature,
+ // and installed a11y activity) package name that is assigned to the accessibility shortcut.
+ optional string package_name = 1;
+
+ // The definition of the accessibility shortcut.
+ // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
+ optional android.stats.accessibility.ShortcutType shortcut_type = 2;
+
+ // The definition of the service status.
+ // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
+ optional android.stats.accessibility.ServiceStatus service_status = 3;
+}
+
+/**
+ * Logs when accessibility service status changed.
+ *
+ * Logged from:
+ * frameworks/base/services/accessibility/java/com/android/server/accessibility/AccessibilityManagerService.java
+ */
+message AccessibilityServiceReported {
+ // The accessibility service package name.
+ optional string package_name = 1;
+
+ // The definition of the service status.
+ // From frameworks/base/core/proto/android/stats/accessibility/accessibility_enums.proto.
+ optional android.stats.accessibility.ServiceStatus service_status = 2;
+}
diff --git a/core/proto/android/stats/accessibility/accessibility_enums.proto b/core/proto/android/stats/accessibility/accessibility_enums.proto
new file mode 100644
index 0000000..5118ad5
--- /dev/null
+++ b/core/proto/android/stats/accessibility/accessibility_enums.proto
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+syntax = "proto2";
+package android.stats.accessibility;
+option java_multiple_files = true;
+
+// The entry point of the accessibility shortcut.
+enum ShortcutType {
+ UNKNOWN_TYPE = 0;
+ A11Y_BUTTON = 1;
+ VOLUME_KEY = 2;
+ TRIPLE_TAP = 3;
+ A11Y_BUTTON_LONG_PRESS = 4;
+}
+
+// The service status code.
+enum ServiceStatus {
+ UNKNOWN = 0;
+ ENABLED = 1;
+ DISABLED = 2;
+}
\ No newline at end of file