Organize intelligence counters together

Intelligence is a mainline module with several counter usecases.
Rather than create a very similar atom for each we'll use an event enum
for these simple counters.

Test: compile proto
Bug: 129491708

Change-Id: Ic30c0d6e15f6afbef90d89d1b53a20f8af38902e
This commit is contained in:
Ben Blount
2019-04-10 11:48:58 -07:00
parent 509b97b973
commit 763a5d5d52
2 changed files with 58 additions and 3 deletions

View File

@@ -22,8 +22,8 @@ option java_outer_classname = "AtomsProto";
import "frameworks/base/cmds/statsd/src/atom_field_options.proto";
import "frameworks/base/core/proto/android/app/enums.proto";
import "frameworks/base/core/proto/android/app/settings_enums.proto";
import "frameworks/base/core/proto/android/app/job/enums.proto";
import "frameworks/base/core/proto/android/app/settings_enums.proto";
import "frameworks/base/core/proto/android/bluetooth/a2dp/enums.proto";
import "frameworks/base/core/proto/android/bluetooth/enums.proto";
import "frameworks/base/core/proto/android/bluetooth/hci/enums.proto";
@@ -42,10 +42,11 @@ import "frameworks/base/core/proto/android/service/procstats_enum.proto";
import "frameworks/base/core/proto/android/service/usb.proto";
import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto";
import "frameworks/base/core/proto/android/stats/connectivity/resolv_stats.proto";
import "frameworks/base/core/proto/android/stats/enums.proto";
import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto";
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/enums.proto";
import "frameworks/base/core/proto/android/stats/intelligence/enums.proto";
import "frameworks/base/core/proto/android/stats/launcher/launcher.proto";
import "frameworks/base/core/proto/android/stats/storage/storage_enums.proto";
import "frameworks/base/core/proto/android/stats/style/style_enums.proto";
@@ -276,6 +277,8 @@ message Atom {
SystemServerWatchdogOccurred system_server_watchdog_occurred = 185;
TombStoneOccurred tomb_stone_occurred = 186;
BluetoothClassOfDeviceReported bluetooth_class_of_device_reported = 187;
IntelligenceEventReported intelligence_event_reported =
188 [(log_from_module) = "intelligence"];
}
// Pulled events will start at field 10000.
@@ -5974,3 +5977,15 @@ message CoolingDevice {
// not in throttling, higher value means deeper throttling.
optional int32 state = 3;
}
/**
* Intelligence has several counter-type events that don't warrant a
* full separate atom. These are primarily API call counters but also include
* counters for feature usage and specific failure modes.
*
* Logged from the Intelligence mainline module.
*/
message IntelligenceEventReported {
optional android.stats.intelligence.EventType event_id = 1;
optional android.stats.intelligence.Status status = 2;
}

View File

@@ -0,0 +1,40 @@
/*
* Copyright (C) 2019 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.intelligence;
option java_outer_classname = "IntelligenceStatsEnums";
enum Status {
// The value wasn't set.
// protoc requires enum values to be unique by package rather than enum type.
// This forces us to prefix the enum values.
STATUS_UNKNOWN = 0;
// The event succeeded.
STATUS_SUCCEEDED = 1;
// The event had an error.
STATUS_FAILED = 2;
}
enum EventType {
// The value wasn't set.
EVENT_UNKNOWN = 0;
// ContentSuggestionsService classifyContentSelections call.
EVENT_CONTENT_SUGGESTIONS_CLASSIFY_CONTENT_CALL = 1;
// ContentSuggestionsService suggestContentSelections call.
EVENT_CONTENT_SUGGESTIONS_SUGGEST_CONTENT_CALL = 2;
}