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 
17 package android.car.storagemonitoring;
18 
19 import android.car.storagemonitoring.IIoStatsListener;
20 import android.car.storagemonitoring.IoStatsEntry;
21 import android.car.storagemonitoring.IoStats;
22 import android.car.storagemonitoring.WearEstimate;
23 import android.car.storagemonitoring.WearEstimateChange;
24 
25 /** @hide */
26 interface ICarStorageMonitoring {
27   /**
28    * Returns the value of the PRE_EOL register.
29    */
getPreEolIndicatorStatus()30   int getPreEolIndicatorStatus() = 1;
31 
32   /**
33    * Returns the current wear estimate indicators.
34    */
getWearEstimate()35   WearEstimate getWearEstimate() = 2;
36 
37   /**
38    * Returns the list of all observed wear estimate changes.
39    */
getWearEstimateHistory()40   List<WearEstimateChange> getWearEstimateHistory() = 3;
41 
42   /**
43    * Returns I/O stats as collected at service boot time.
44    */
getBootIoStats()45   List<IoStatsEntry> getBootIoStats() = 4;
46 
47   /**
48    * Returns total I/O stats as collected from kernel start until the last snapshot.
49    */
getAggregateIoStats()50   List<IoStatsEntry> getAggregateIoStats() = 5;
51 
52   /**
53    * Return the I/O stats deltas currently known to the service.
54    */
getIoStatsDeltas()55   List<IoStats> getIoStatsDeltas() = 6;
56 
57   /**
58    * Register a new listener to receive new I/O activity deltas as they are generated.
59    */
60   void registerListener(IIoStatsListener listener) = 7;
61 
62   /**
63    * Remove a listener registration, terminating delivery of I/O activity deltas to it.
64    */
65   void unregisterListener(IIoStatsListener listener) = 8;
66 
67   /**
68    * Returns the approximate amount of bytes written to disk during the previous shutdown.
69    */
getShutdownDiskWriteAmount()70   long getShutdownDiskWriteAmount() = 9;
71 }
72