Merge "Fixing checkstyle/lint issues for CarStorageMonitoringManager" into rvc-dev
diff --git a/car-lib/src/android/car/storagemonitoring/CarStorageMonitoringManager.java b/car-lib/src/android/car/storagemonitoring/CarStorageMonitoringManager.java
index ac59bac..6f993e3 100644
--- a/car-lib/src/android/car/storagemonitoring/CarStorageMonitoringManager.java
+++ b/car-lib/src/android/car/storagemonitoring/CarStorageMonitoringManager.java
@@ -47,9 +47,17 @@
private final SingleMessageHandler<IoStats> mMessageHandler;
private final Set<IoStatsListener> mListeners = new HashSet<>();
+ /**
+ * Implementers will be notified on every new I/O activity calculated stats.
+ */
public interface IoStatsListener {
+
+ /**
+ * Invoked when a new periodic snapshot delta of I/O activities is calculated.
+ */
void onSnapshot(IoStats snapshot);
}
+
private static final class ListenerToService extends IIoStatsListener.Stub {
private final WeakReference<CarStorageMonitoringManager> mManager;
@@ -109,7 +117,7 @@
* It will return either PRE_EOL_INFO_UNKNOWN if the value can't be determined,
* or one of PRE_EOL_INFO_{NORMAL|WARNING|URGENT} depending on the device state.
*/
- @RequiresPermission(value=Car.PERMISSION_STORAGE_MONITORING)
+ @RequiresPermission(value = Car.PERMISSION_STORAGE_MONITORING)
public int getPreEolIndicatorStatus() {
try {
return mService.getPreEolIndicatorStatus();
@@ -127,7 +135,7 @@
*
* If either or both indicators are not available, they will be reported as UNKNOWN.
*/
- @RequiresPermission(value=Car.PERMISSION_STORAGE_MONITORING)
+ @RequiresPermission(value = Car.PERMISSION_STORAGE_MONITORING)
public WearEstimate getWearEstimate() {
try {
return mService.getWearEstimate();
@@ -147,7 +155,7 @@
*
* If no indicators are available, an empty list will be returned.
*/
- @RequiresPermission(value=Car.PERMISSION_STORAGE_MONITORING)
+ @RequiresPermission(value = Car.PERMISSION_STORAGE_MONITORING)
public List<WearEstimateChange> getWearEstimateHistory() {
try {
return mService.getWearEstimateHistory();
@@ -166,7 +174,7 @@
*
* If the information is not available, an empty list will be returned.
*/
- @RequiresPermission(value=Car.PERMISSION_STORAGE_MONITORING)
+ @RequiresPermission(value = Car.PERMISSION_STORAGE_MONITORING)
public List<IoStatsEntry> getBootIoStats() {
try {
return mService.getBootIoStats();
@@ -196,7 +204,7 @@
*
* <p>If the information is not available, SHUTDOWN_COST_INFO_MISSING will be returned.</p>s
*/
- @RequiresPermission(value=Car.PERMISSION_STORAGE_MONITORING)
+ @RequiresPermission(value = Car.PERMISSION_STORAGE_MONITORING)
public long getShutdownDiskWriteAmount() {
try {
return mService.getShutdownDiskWriteAmount();
@@ -213,7 +221,7 @@
*
* If the information is not available, an empty list will be returned.
*/
- @RequiresPermission(value=Car.PERMISSION_STORAGE_MONITORING)
+ @RequiresPermission(value = Car.PERMISSION_STORAGE_MONITORING)
public List<IoStatsEntry> getAggregateIoStats() {
try {
return mService.getAggregateIoStats();
@@ -233,7 +241,7 @@
*
* If the information is not available, an empty list will be returned.
*/
- @RequiresPermission(value=Car.PERMISSION_STORAGE_MONITORING)
+ @RequiresPermission(value = Car.PERMISSION_STORAGE_MONITORING)
public List<IoStats> getIoStatsDeltas() {
try {
return mService.getIoStatsDeltas();
@@ -250,7 +258,7 @@
*
* The timing of availability of the deltas is configurable by the OEM.
*/
- @RequiresPermission(value=Car.PERMISSION_STORAGE_MONITORING)
+ @RequiresPermission(value = Car.PERMISSION_STORAGE_MONITORING)
public void registerListener(IoStatsListener listener) {
try {
if (mListeners.isEmpty()) {
@@ -268,7 +276,7 @@
/**
* This method removes a registered listener of I/O stats deltas.
*/
- @RequiresPermission(value=Car.PERMISSION_STORAGE_MONITORING)
+ @RequiresPermission(value = Car.PERMISSION_STORAGE_MONITORING)
public void unregisterListener(IoStatsListener listener) {
try {
if (!mListeners.remove(listener)) {