Implement CarStorageMonitoringManager::getIoStatsDeltas
This API gives access to the periodic snapshot deltas of I/O activity calculated by CarStorageMonitoringService
Bug: 32512551
Bug: 65846699
Test: bit CarServiceTest:com.android.car.CarStorageMonitoringTest
bit CarServiceUnitTest:com.android.car.storagemonitoring.CarStorageMonitoringTest
Change-Id: I833d4b4d0e63d6356b34584dbde3ba563e4aa899
diff --git a/car-lib/api/system-current.txt b/car-lib/api/system-current.txt
index 9a3fe1d..5695cc7 100644
--- a/car-lib/api/system-current.txt
+++ b/car-lib/api/system-current.txt
@@ -1006,6 +1006,7 @@
public final class CarStorageMonitoringManager {
method public java.util.List<android.car.storagemonitoring.UidIoStats> getAggregateIoStats() throws android.car.CarNotConnectedException;
method public java.util.List<android.car.storagemonitoring.UidIoStats> getBootIoStats() throws android.car.CarNotConnectedException;
+ method public java.util.List<android.car.storagemonitoring.UidIoStatsDelta> getIoStatsDeltas() throws android.car.CarNotConnectedException;
method public int getPreEolIndicatorStatus() throws android.car.CarNotConnectedException;
method public android.car.storagemonitoring.WearEstimate getWearEstimate() throws android.car.CarNotConnectedException;
method public java.util.List<android.car.storagemonitoring.WearEstimateChange> getWearEstimateHistory() throws android.car.CarNotConnectedException;
@@ -1015,38 +1016,8 @@
field public static final int PRE_EOL_INFO_WARNING = 2; // 0x2
}
- public final class UidIoStats implements android.os.Parcelable {
- ctor public UidIoStats(int, long, android.car.storagemonitoring.UidIoStats.PerStateMetrics, android.car.storagemonitoring.UidIoStats.PerStateMetrics);
- ctor public UidIoStats(android.os.Parcel);
- ctor public UidIoStats(android.car.storagemonitoring.UidIoStatsRecord, long);
- ctor public UidIoStats(org.json.JSONObject) throws org.json.JSONException;
- method public int describeContents();
- method public void writeToJson(android.util.JsonWriter) throws java.io.IOException;
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.car.storagemonitoring.UidIoStats> CREATOR;
- field public final android.car.storagemonitoring.UidIoStats.PerStateMetrics background;
- field public final android.car.storagemonitoring.UidIoStats.PerStateMetrics foreground;
- field public final long runtimeMillis;
- field public final int uid;
- }
-
- public static final class UidIoStats.PerStateMetrics implements android.os.Parcelable {
- ctor public UidIoStats.PerStateMetrics(long, long, long, long, long);
- ctor public UidIoStats.PerStateMetrics(android.os.Parcel);
- ctor public UidIoStats.PerStateMetrics(org.json.JSONObject) throws org.json.JSONException;
- method public int describeContents();
- method public void writeToJson(android.util.JsonWriter) throws java.io.IOException;
- method public void writeToParcel(android.os.Parcel, int);
- field public static final android.os.Parcelable.Creator<android.car.storagemonitoring.UidIoStats.PerStateMetrics> CREATOR;
- field public final long bytesRead;
- field public final long bytesReadFromStorage;
- field public final long bytesWritten;
- field public final long bytesWrittenToStorage;
- field public final long fsyncCalls;
- }
-
- public final class UidIoStatsRecord {
- ctor public UidIoStatsRecord(int, long, long, long, long, long, long, long, long, long, long);
+ public final class UidIoRecord {
+ ctor public UidIoRecord(int, long, long, long, long, long, long, long, long, long, long);
field public final long background_fsync;
field public final long background_rchar;
field public final long background_read_bytes;
@@ -1060,6 +1031,50 @@
field public final int uid;
}
+ public final class UidIoStats implements android.os.Parcelable {
+ ctor public UidIoStats(int, long, android.car.storagemonitoring.UidIoStats.Metrics, android.car.storagemonitoring.UidIoStats.Metrics);
+ ctor public UidIoStats(android.os.Parcel);
+ ctor public UidIoStats(android.car.storagemonitoring.UidIoRecord, long);
+ ctor public UidIoStats(org.json.JSONObject) throws org.json.JSONException;
+ method public int describeContents();
+ method public void writeToJson(android.util.JsonWriter) throws java.io.IOException;
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.car.storagemonitoring.UidIoStats> CREATOR;
+ field public final android.car.storagemonitoring.UidIoStats.Metrics background;
+ field public final android.car.storagemonitoring.UidIoStats.Metrics foreground;
+ field public final long runtimeMillis;
+ field public final int uid;
+ }
+
+ public static final class UidIoStats.Metrics implements android.os.Parcelable {
+ ctor public UidIoStats.Metrics(long, long, long, long, long);
+ ctor public UidIoStats.Metrics(android.os.Parcel);
+ ctor public UidIoStats.Metrics(org.json.JSONObject) throws org.json.JSONException;
+ method public int describeContents();
+ method public void writeToJson(android.util.JsonWriter) throws java.io.IOException;
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.car.storagemonitoring.UidIoStats.Metrics> CREATOR;
+ field public final long bytesRead;
+ field public final long bytesReadFromStorage;
+ field public final long bytesWritten;
+ field public final long bytesWrittenToStorage;
+ field public final long fsyncCalls;
+ }
+
+ public class UidIoStatsDelta implements android.os.Parcelable {
+ ctor public UidIoStatsDelta(java.util.List<android.car.storagemonitoring.UidIoStats>, long);
+ ctor public UidIoStatsDelta(android.os.Parcel);
+ method public int describeContents();
+ method public android.car.storagemonitoring.UidIoStats.Metrics getBackgroundTotals();
+ method public android.car.storagemonitoring.UidIoStats.Metrics getForegroundTotals();
+ method public java.util.List<android.car.storagemonitoring.UidIoStats> getStats();
+ method public long getTimestamp();
+ method public android.car.storagemonitoring.UidIoStats.Metrics getTotals();
+ method public android.car.storagemonitoring.UidIoStats getUserIdStats(int);
+ method public void writeToParcel(android.os.Parcel, int);
+ field public static final android.os.Parcelable.Creator<android.car.storagemonitoring.UidIoStatsDelta> CREATOR;
+ }
+
public class WearEstimate implements android.os.Parcelable {
ctor public WearEstimate(int, int);
ctor public WearEstimate(android.os.Parcel);