1/*
2 * Copyright (C) 2017 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
17syntax = "proto2";
18package android.service.diskstats;
19
20import "frameworks/base/core/proto/android/privacy.proto";
21
22option java_multiple_files = true;
23option java_outer_classname = "DiskStatsServiceProto";
24
25message DiskStatsServiceDumpProto {
26    option (android.msg_privacy).dest = DEST_AUTOMATIC;
27
28    enum EncryptionType {
29        // Unknown encryption type
30        ENCRYPTION_UNKNOWN = 0;
31        // No encryption
32        ENCRYPTION_NONE = 1;
33        // Full disk encryption
34        ENCRYPTION_FULL_DISK = 2;
35        // File-based encryption
36        ENCRYPTION_FILE_BASED = 3;
37    }
38    // Whether the latency test resulted in an error
39    optional bool has_test_error = 1;
40    // If the test encountered an IOException, the error message is logged here.
41    optional string error_message = 2;
42    // 512B write latency in milliseconds, if the test was successful
43    optional int32 write_512b_latency_millis = 3;
44    // Free Space in the major partitions
45    repeated DiskStatsFreeSpaceProto partitions_free_space = 4;
46    // Is the device using file-based encryption, full disk encryption or other
47    optional EncryptionType encryption = 5;
48    // Cached values of folder sizes, etc.
49    optional DiskStatsCachedValuesProto cached_folder_sizes = 6;
50    // Average write speed of storaged benchmark for last 24 hours
51    optional int32 benchmarked_write_speed_kbps = 7;
52}
53
54message DiskStatsCachedValuesProto {
55    option (android.msg_privacy).dest = DEST_AUTOMATIC;
56
57    // Total app code size, in kilobytes
58    optional int64 agg_apps_size_kb = 1;
59    // Total app cache size, in kilobytes
60    optional int64 agg_apps_cache_size_kb = 2;
61    // Size of image files, in kilobytes
62    optional int64 photos_size_kb = 3;
63    // Size of video files, in kilobytes
64    optional int64 videos_size_kb = 4;
65    // Size of audio files, in kilobytes
66    optional int64 audio_size_kb = 5;
67    // Size of downloads, in kilobytes
68    optional int64 downloads_size_kb = 6;
69    // Size of system directory, in kilobytes
70    optional int64 system_size_kb = 7;
71    // Size of other files, in kilobytes
72    optional int64 other_size_kb = 8;
73    // Sizes of individual packages
74    repeated DiskStatsAppSizesProto app_sizes = 9;
75    // Total app data size, in kilobytes
76    optional int64 agg_apps_data_size_kb = 10;
77}
78
79message DiskStatsAppSizesProto {
80    option (android.msg_privacy).dest = DEST_AUTOMATIC;
81
82    // Name of the package
83    optional string package_name = 1;
84    // App's code size in kilobytes
85    optional int64 app_size_kb = 2;
86    // App's cache size in kilobytes
87    optional int64 cache_size_kb = 3;
88    // App's data size in kilobytes
89    optional int64 app_data_size_kb = 4;
90}
91
92message DiskStatsFreeSpaceProto {
93    option (android.msg_privacy).dest = DEST_AUTOMATIC;
94
95    enum Folder {
96        // Data folder
97        FOLDER_DATA = 0;
98        // Cache folder
99        FOLDER_CACHE = 1;
100        // System folder
101        FOLDER_SYSTEM = 2;
102    }
103    // Which folder?
104    optional Folder folder = 1;
105    // Available space, in kilobytes
106    optional int64 available_space_kb = 2;
107    // Total space, in kilobytes
108    optional int64 total_space_kb = 3;
109}
110