From ebaad1c848d6363b2a8a837f7b4256ab3c750688 Mon Sep 17 00:00:00 2001 From: Sudheer Shanka Date: Tue, 31 Jul 2018 16:39:59 -0700 Subject: [PATCH] Update IVold interface to take packageNames when a user starts. Bug: 111890351 Test: n/a Change-Id: Ia24f15112f9a4ee4994688ff8fedf786cbf479b7 Exempt-From-Owner-Approval: This was approved as part of http://ag/4494673 --- VoldNativeService.cpp | 5 +++-- VoldNativeService.h | 2 +- VolumeManager.cpp | 2 +- VolumeManager.h | 2 +- binder/android/os/IVold.aidl | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/VoldNativeService.cpp b/VoldNativeService.cpp index 6e3317b..b034707 100644 --- a/VoldNativeService.cpp +++ b/VoldNativeService.cpp @@ -262,11 +262,12 @@ binder::Status VoldNativeService::onUserRemoved(int32_t userId) { return translate(VolumeManager::Instance()->onUserRemoved(userId)); } -binder::Status VoldNativeService::onUserStarted(int32_t userId) { +binder::Status VoldNativeService::onUserStarted(int32_t userId, + const std::vector& packageNames) { ENFORCE_UID(AID_SYSTEM); ACQUIRE_LOCK; - return translate(VolumeManager::Instance()->onUserStarted(userId)); + return translate(VolumeManager::Instance()->onUserStarted(userId, packageNames)); } binder::Status VoldNativeService::onUserStopped(int32_t userId) { diff --git a/VoldNativeService.h b/VoldNativeService.h index 613c08e..e446185 100644 --- a/VoldNativeService.h +++ b/VoldNativeService.h @@ -39,7 +39,7 @@ public: binder::Status onUserAdded(int32_t userId, int32_t userSerial); binder::Status onUserRemoved(int32_t userId); - binder::Status onUserStarted(int32_t userId); + binder::Status onUserStarted(int32_t userId, const std::vector& packageNames); binder::Status onUserStopped(int32_t userId); binder::Status addAppIds(const std::vector& packageNames, diff --git a/VolumeManager.cpp b/VolumeManager.cpp index a37def4..b3cf9bf 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -372,7 +372,7 @@ int VolumeManager::onUserRemoved(userid_t userId) { return 0; } -int VolumeManager::onUserStarted(userid_t userId) { +int VolumeManager::onUserStarted(userid_t userId, const std::vector& packageNames) { // Note that sometimes the system will spin up processes from Zygote // before actually starting the user, so we're okay if Zygote // already created this directory. diff --git a/VolumeManager.h b/VolumeManager.h index 75385e9..bd70653 100644 --- a/VolumeManager.h +++ b/VolumeManager.h @@ -91,7 +91,7 @@ public: int onUserAdded(userid_t userId, int userSerialNumber); int onUserRemoved(userid_t userId); - int onUserStarted(userid_t userId); + int onUserStarted(userid_t userId, const std::vector& packageNames); int onUserStopped(userid_t userId); int addAppIds(const std::vector& packageNames, const std::vector& appIds); diff --git a/binder/android/os/IVold.aidl b/binder/android/os/IVold.aidl index 43a1c04..f29e37e 100644 --- a/binder/android/os/IVold.aidl +++ b/binder/android/os/IVold.aidl @@ -29,7 +29,7 @@ interface IVold { void onUserAdded(int userId, int userSerial); void onUserRemoved(int userId); - void onUserStarted(int userId); + void onUserStarted(int userId, in @utf8InCpp String[] packageNames); void onUserStopped(int userId); void addAppIds(in @utf8InCpp String[] packageNames, in int[] appIds);