storaged: use AIDL to generate storaged binder calls.
Split binder calls into two separate services.
"storaged" service will be used by external clients, e.g. vold.
- Added stub onUserStarted/onUserStopped to prepare for moving
storaged.proto into ce area.
"storaged_pri" private service will be used by storaged cmdline,
e.g. adb shell storaged -u
- Added parcelable UidInfo for private service.
- Change format of perf history to one vector with first 3 elements
showing size of recent/daily/weekly perf history.
Test: adb shell storaged -u -p
Bug: 63740245
Change-Id: Ib0367282a95b6cb0a38f064f0456e849ecccc210
diff --git a/storaged/storaged_info.cpp b/storaged/storaged_info.cpp
index c5552f6..4243bd7 100644
--- a/storaged/storaged_info.cpp
+++ b/storaged/storaged_info.cpp
@@ -180,28 +180,32 @@
weekly_perf[nr_weeks++] = week_avg_bw;
}
-vector<vector<uint32_t>> storage_info_t::get_perf_history()
+vector<int> storage_info_t::get_perf_history()
{
unique_ptr<lock_t> lock(new lock_t(&si_lock));
- vector<vector<uint32_t>> ret(3);
+ vector<int> ret(3 + recent_perf.size() + daily_perf.size() + weekly_perf.size());
- ret[0].resize(recent_perf.size());
+ ret[0] = recent_perf.size();
+ ret[1] = daily_perf.size();
+ ret[2] = weekly_perf.size();
+
+ int start = 3;
for (size_t i = 0; i < recent_perf.size(); i++) {
int idx = (recent_perf.size() + nr_samples - 1 - i) % recent_perf.size();
- ret[0][i] = recent_perf[idx];
+ ret[start + i] = recent_perf[idx];
}
- ret[1].resize(daily_perf.size());
+ start += recent_perf.size();
for (size_t i = 0; i < daily_perf.size(); i++) {
int idx = (daily_perf.size() + nr_days - 1 - i) % daily_perf.size();
- ret[1][i] = daily_perf[idx];
+ ret[start + i] = daily_perf[idx];
}
- ret[2].resize(weekly_perf.size());
+ start += daily_perf.size();
for (size_t i = 0; i < weekly_perf.size(); i++) {
int idx = (weekly_perf.size() + nr_weeks - 1 - i) % weekly_perf.size();
- ret[2][i] = weekly_perf[idx];
+ ret[start + i] = weekly_perf[idx];
}
return ret;