Add APIs for pushing package info to vold.

Bug: 111890351
Test: n/a
Change-Id: I3194a88a9ce612a2e4f2c7ea9e3392e0f8020fc1
diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp
index 81523c6..6e3317b 100644
--- a/VoldNativeService.cpp
+++ b/VoldNativeService.cpp
@@ -247,6 +247,7 @@
     return translate(VolumeManager::Instance()->shutdown());
 }
 
+// TODO: sanity-check these string arguments
 binder::Status VoldNativeService::onUserAdded(int32_t userId, int32_t userSerial) {
     ENFORCE_UID(AID_SYSTEM);
     ACQUIRE_LOCK;
@@ -275,6 +276,24 @@
     return translate(VolumeManager::Instance()->onUserStopped(userId));
 }
 
+// TODO: sanity-check these string arguments
+binder::Status VoldNativeService::addAppIds(const std::vector<std::string>& packageNames,
+        const std::vector<int32_t>& appIds) {
+    ENFORCE_UID(AID_SYSTEM);
+    ACQUIRE_LOCK;
+
+    return translate(VolumeManager::Instance()->addAppIds(packageNames, appIds));
+}
+
+// TODO: sanity-check these string arguments
+binder::Status VoldNativeService::addSandboxIds(const std::vector<int32_t>& appIds,
+        const std::vector<std::string>& sandboxIds) {
+    ENFORCE_UID(AID_SYSTEM);
+    ACQUIRE_LOCK;
+
+    return translate(VolumeManager::Instance()->addSandboxIds(appIds, sandboxIds));
+}
+
 binder::Status VoldNativeService::onSecureKeyguardStateChanged(bool isShowing) {
     ENFORCE_UID(AID_SYSTEM);
     ACQUIRE_LOCK;
diff --git a/VoldNativeService.h b/VoldNativeService.h
index 2e90101..613c08e 100644
--- a/VoldNativeService.h
+++ b/VoldNativeService.h
@@ -42,6 +42,11 @@
     binder::Status onUserStarted(int32_t userId);
     binder::Status onUserStopped(int32_t userId);
 
+    binder::Status addAppIds(const std::vector<std::string>& packageNames,
+            const std::vector<int32_t>& appIds);
+    binder::Status addSandboxIds(const std::vector<int32_t>& appIds,
+            const std::vector<std::string>& sandboxIds);
+
     binder::Status onSecureKeyguardStateChanged(bool isShowing);
 
     binder::Status partition(const std::string& diskId, int32_t partitionType, int32_t ratio);
diff --git a/VolumeManager.cpp b/VolumeManager.cpp
index 21e132a..a37def4 100644
--- a/VolumeManager.cpp
+++ b/VolumeManager.cpp
@@ -391,6 +391,16 @@
     return 0;
 }
 
+int VolumeManager::addAppIds(const std::vector<std::string>& packageNames,
+        const std::vector<int32_t>& appIds) {
+    return 0;
+}
+
+int VolumeManager::addSandboxIds(const std::vector<int32_t>& appIds,
+        const std::vector<std::string>& sandboxIds) {
+    return 0;
+}
+
 int VolumeManager::onSecureKeyguardStateChanged(bool isShowing) {
     mSecureKeyguardShowing = isShowing;
     if (!mSecureKeyguardShowing) {
diff --git a/VolumeManager.h b/VolumeManager.h
index fb455d8..75385e9 100644
--- a/VolumeManager.h
+++ b/VolumeManager.h
@@ -94,6 +94,10 @@
     int onUserStarted(userid_t userId);
     int onUserStopped(userid_t userId);
 
+    int addAppIds(const std::vector<std::string>& packageNames, const std::vector<int32_t>& appIds);
+    int addSandboxIds(const std::vector<int32_t>& appIds,
+            const std::vector<std::string>& sandboxIds);
+
     int onSecureKeyguardStateChanged(bool isShowing);
 
     int setPrimary(const std::shared_ptr<android::vold::VolumeBase>& vol);
diff --git a/binder/android/os/IVold.aidl b/binder/android/os/IVold.aidl
index 8300a8e..43a1c04 100644
--- a/binder/android/os/IVold.aidl
+++ b/binder/android/os/IVold.aidl
@@ -32,6 +32,9 @@
     void onUserStarted(int userId);
     void onUserStopped(int userId);
 
+    void addAppIds(in @utf8InCpp String[] packageNames, in int[] appIds);
+    void addSandboxIds(in int[] appIds, in @utf8InCpp String[] sandboxIds);
+
     void onSecureKeyguardStateChanged(boolean isShowing);
 
     void partition(@utf8InCpp String diskId, int partitionType, int ratio);