Move unsolicited vold events to Binder.
Create IVoldListener and move most unsolicited vold events over to
this new interface. The remaining events will be routed through
method-specific listeners instead of a global one.
Move to upstream DISALLOW_COPY_AND_ASSIGN macro.
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.DirectBootHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsOsTestCases -t android.os.storage.cts.StorageManagerTest
Bug: 13758960
Change-Id: Ib9293487db2d525a76b9b9c2e9ac18d98601c6cf
diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp
index 374cb4c..f5f0838 100644
--- a/VoldNativeService.cpp
+++ b/VoldNativeService.cpp
@@ -201,6 +201,15 @@
return NO_ERROR;
}
+binder::Status VoldNativeService::setListener(
+ const android::sp<android::os::IVoldListener>& listener) {
+ ENFORCE_UID(AID_SYSTEM);
+ ACQUIRE_LOCK;
+
+ VolumeManager::Instance()->setListener(listener);
+ return ok();
+}
+
binder::Status VoldNativeService::reset() {
ENFORCE_UID(AID_SYSTEM);
ACQUIRE_LOCK;