| 1 |
/* |
| 2 |
* Copyright (C) 2019 The Android Open Source Project |
| 3 |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
* you may not use this file except in compliance with the License. |
| 6 |
* You may obtain a copy of the License at |
| 7 |
* |
| 8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 9 |
* |
| 10 |
* Unless required by applicable law or agreed to in writing, software |
| 11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
| 12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 |
* See the License for the specific language governing permissions and |
| 14 |
* limitations under the License. |
| 15 |
*/ |
| 16 |
|
| 17 |
syntax = "proto2"; |
| 18 |
package com.android.server.content; |
| 19 |
import "frameworks/base/core/proto/android/privacy.proto"; |
| 20 |
|
| 21 |
option java_multiple_files = true; |
| 22 |
|
| 23 |
/** |
| 24 |
* Stores relevant information from a DayStats object in SyncStorageEngine. |
| 25 |
*/ |
| 26 |
message SyncStatisticsProto { |
| 27 |
|
| 28 |
message DayStats { |
| 29 |
optional int32 day = 1; // day of the year - defined by SyncStorageEngine#getCurrentDayLocked() |
| 30 |
optional int32 success_count = 2; |
| 31 |
optional int64 success_time = 3; // time since epoch |
| 32 |
optional int32 failure_count = 4; |
| 33 |
optional int64 failure_time = 5; // time since epoch |
| 34 |
} |
| 35 |
|
| 36 |
repeated DayStats stats = 1; |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* Stores relevant information from a SyncStatusInfo object. |
| 41 |
*/ |
| 42 |
message SyncStatusProto { |
| 43 |
|
| 44 |
message StatusInfo { |
| 45 |
|
| 46 |
message Stats { |
| 47 |
optional int64 total_elapsed_time = 1; // time since epoch |
| 48 |
optional int32 num_syncs = 2; |
| 49 |
optional int32 num_failures = 3; |
| 50 |
optional int32 num_cancels = 4; |
| 51 |
optional int32 num_source_other = 5; |
| 52 |
optional int32 num_source_local = 6; |
| 53 |
optional int32 num_source_poll = 7; |
| 54 |
optional int32 num_source_user = 8; |
| 55 |
optional int32 num_source_periodic = 9; |
| 56 |
optional int32 num_source_feed = 10; |
| 57 |
} |
| 58 |
|
| 59 |
message LastEventInfo { |
| 60 |
optional int64 last_event_time = 1; // time since epoch |
| 61 |
optional string last_event = 2 [(.android.privacy).dest = DEST_EXPLICIT]; |
| 62 |
} |
| 63 |
|
| 64 |
// Note: version doesn't need to be stored in proto because of how protos store information but |
| 65 |
// leaving field number 1 open in case we find a usage for it in the future. |
| 66 |
optional int32 authority_id = 2; |
| 67 |
optional int64 last_success_time = 3; // time since epoch |
| 68 |
optional int32 last_success_source = 4; |
| 69 |
optional int64 last_failure_time = 5; // time since epoch |
| 70 |
optional int32 last_failure_source = 6; |
| 71 |
optional string last_failure_message = 7 [(.android.privacy).dest = DEST_EXPLICIT]; |
| 72 |
optional int64 initial_failure_time = 8; // time since epoch |
| 73 |
optional bool pending = 9; |
| 74 |
optional bool initialize = 10; |
| 75 |
repeated int64 periodic_sync_times = 11; // times since epoch |
| 76 |
repeated LastEventInfo last_event_info = 12; |
| 77 |
optional int64 last_today_reset_time = 13; // time since epoch |
| 78 |
optional Stats total_stats = 14; |
| 79 |
optional Stats today_stats = 15; |
| 80 |
optional Stats yesterday_stats = 16; |
| 81 |
repeated int64 per_source_last_success_times = 17; // times since epoch |
| 82 |
repeated int64 per_source_last_failure_times = 18; // times since epoch |
| 83 |
} |
| 84 |
|
| 85 |
repeated StatusInfo status = 1; |
| 86 |
} |