aboutsummaryrefslogtreecommitdiff
path: root/tests/DefaultStorageMonitoringCompanionApp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@google.com>2017-11-28 14:18:37 -0800
committerEnrico Granata <egranata@google.com>2017-11-30 11:32:44 -0800
commitafe7f304a0425509086acbd964aea575832a53f6 (patch)
tree6494cef69deb68ef46afa43ee35dbca82d7e0cd8 /tests/DefaultStorageMonitoringCompanionApp
parent465eb83ff7bbe1d7afa858b573ff7b56578c5320 (diff)
downloadCar-afe7f304a0425509086acbd964aea575832a53f6.tar.gz
Default setup for excessive I/O notification
- Set sample default values for the thresholds that trigger the I/O notification; - Centralize tracking of the service's configuration; - Implement a default broadcast agent. Test: bit CarServiceTest:com.android.car.CarStorageMonitoringTest Change-Id: I9eb0259eedd34a27532cb621383b87075c6460a3
Diffstat (limited to 'tests/DefaultStorageMonitoringCompanionApp')
-rw-r--r--tests/DefaultStorageMonitoringCompanionApp/AndroidManifest.xml10
-rw-r--r--tests/DefaultStorageMonitoringCompanionApp/src/com/google/android/car/defaultstoragemonitoringcompanionapp/ExcessiveIoIntentReceiver.java20
2 files changed, 30 insertions, 0 deletions
diff --git a/tests/DefaultStorageMonitoringCompanionApp/AndroidManifest.xml b/tests/DefaultStorageMonitoringCompanionApp/AndroidManifest.xml
index 45380ceab5..a676e1855e 100644
--- a/tests/DefaultStorageMonitoringCompanionApp/AndroidManifest.xml
+++ b/tests/DefaultStorageMonitoringCompanionApp/AndroidManifest.xml
@@ -31,6 +31,16 @@
android:exported="true"
android:permission="android.car.permission.STORAGE_MONITORING">
</activity>
+
+ <receiver
+ android:name=".ExcessiveIoIntentReceiver"
+ android:exported="true"
+ android:permission="android.car.permission.STORAGE_MONITORING">
+ <intent-filter>
+ <action android:name="android.car.storagemonitoring.EXCESSIVE_IO"/>
+ </intent-filter>
+ </receiver>
+
</application>
</manifest>
diff --git a/tests/DefaultStorageMonitoringCompanionApp/src/com/google/android/car/defaultstoragemonitoringcompanionapp/ExcessiveIoIntentReceiver.java b/tests/DefaultStorageMonitoringCompanionApp/src/com/google/android/car/defaultstoragemonitoringcompanionapp/ExcessiveIoIntentReceiver.java
new file mode 100644
index 0000000000..2190bbda75
--- /dev/null
+++ b/tests/DefaultStorageMonitoringCompanionApp/src/com/google/android/car/defaultstoragemonitoringcompanionapp/ExcessiveIoIntentReceiver.java
@@ -0,0 +1,20 @@
+package com.google.android.car.defaultstoragemonitoringcompanionapp;
+
+import android.car.storagemonitoring.CarStorageMonitoringManager;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.util.Log;
+
+public class ExcessiveIoIntentReceiver extends BroadcastReceiver {
+ private final static String TAG = ExcessiveIoIntentReceiver.class.getSimpleName();
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ if (CarStorageMonitoringManager.INTENT_EXCESSIVE_IO.equals(intent.getAction())) {
+ Log.d(TAG, "excessive I/O activity detected.");
+ } else {
+ Log.w(TAG, "unexpected intent received: " + intent);
+ }
+ }
+}