Loading cmds/installd/InstalldNativeService.cpp +35 −9 Original line number Diff line number Diff line Loading @@ -2684,7 +2684,7 @@ binder::Status InstalldNativeService::invalidateMounts() { } // Mount volume's CE and DE storage to mirror binder::Status InstalldNativeService::onPrivateVolumeMounted( binder::Status InstalldNativeService::tryMountDataMirror( const std::unique_ptr<std::string>& uuid) { ENFORCE_UID(AID_SYSTEM); CHECK_ARGUMENT_UUID(uuid); Loading @@ -2696,24 +2696,50 @@ binder::Status InstalldNativeService::onPrivateVolumeMounted( } const char* uuid_ = uuid->c_str(); // Mount CE mirror std::string mirrorVolCePath(StringPrintf("%s/%s", kDataMirrorCePath, uuid_)); std::lock_guard<std::recursive_mutex> lock(mLock); if (fs_prepare_dir(mirrorVolCePath.c_str(), 0700, AID_ROOT, AID_ROOT) != 0) { if (fs_prepare_dir(mirrorVolCePath.c_str(), 0711, AID_SYSTEM, AID_SYSTEM) != 0) { return error("Failed to create CE mirror"); } auto cePath = StringPrintf("%s/user_ce", create_data_path(uuid_).c_str()); std::string mirrorVolDePath(StringPrintf("%s/%s", kDataMirrorDePath, uuid_)); if (fs_prepare_dir(mirrorVolDePath.c_str(), 0711, AID_SYSTEM, AID_SYSTEM) != 0) { return error("Failed to create DE mirror"); } auto cePath = StringPrintf("%s/user", create_data_path(uuid_).c_str()); auto dePath = StringPrintf("%s/user_de", create_data_path(uuid_).c_str()); if (access(cePath.c_str(), F_OK) != 0) { return error("Cannot access CE path: " + cePath); } if (access(dePath.c_str(), F_OK) != 0) { return error("Cannot access DE path: " + dePath); } struct stat ceStat, mirrorCeStat; if (stat(cePath.c_str(), &ceStat) != 0) { return error("Failed to stat " + cePath); } if (stat(mirrorVolCePath.c_str(), &mirrorCeStat) != 0) { return error("Failed to stat " + mirrorVolCePath); } if (mirrorCeStat.st_ino == ceStat.st_ino) { // As it's being called by prepareUserStorage, it can be called multiple times. // Hence, we if we mount it already, we should skip it. LOG(WARNING) << "CE dir is mounted already: " + cePath; return ok(); } // Mount CE mirror if (TEMP_FAILURE_RETRY(mount(cePath.c_str(), mirrorVolCePath.c_str(), NULL, MS_NOSUID | MS_NODEV | MS_NOATIME | MS_BIND | MS_NOEXEC, nullptr)) == -1) { return error("Failed to mount " + mirrorVolCePath); } // Mount DE mirror std::string mirrorVolDePath(StringPrintf("%s/%s", kDataMirrorDePath, uuid_)); if (fs_prepare_dir(mirrorVolDePath.c_str(), 0700, AID_ROOT, AID_ROOT) != 0) { return error("Failed to create DE mirror"); } auto dePath = StringPrintf("%s/user_de", create_data_path(uuid_).c_str()); if (TEMP_FAILURE_RETRY(mount(dePath.c_str(), mirrorVolDePath.c_str(), NULL, MS_NOSUID | MS_NODEV | MS_NOATIME | MS_BIND | MS_NOEXEC, nullptr)) == -1) { return error("Failed to mount " + mirrorVolDePath); Loading cmds/installd/InstalldNativeService.h +1 −1 Original line number Diff line number Diff line Loading @@ -155,7 +155,7 @@ public: binder::Status invalidateMounts(); binder::Status isQuotaSupported(const std::unique_ptr<std::string>& volumeUuid, bool* _aidl_return); binder::Status onPrivateVolumeMounted(const std::unique_ptr<std::string>& volumeUuid); binder::Status tryMountDataMirror(const std::unique_ptr<std::string>& volumeUuid); binder::Status onPrivateVolumeRemoved(const std::unique_ptr<std::string>& volumeUuid); binder::Status prepareAppProfile(const std::string& packageName, Loading cmds/installd/binder/android/os/IInstalld.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ interface IInstalld { int appId, @utf8InCpp String seInfo, int user, int snapshotId, int storageflags); void destroyAppDataSnapshot(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName, int userId, long ceSnapshotInode, int snapshotId, int storageFlags); void onPrivateVolumeMounted(@nullable @utf8InCpp String volumeUuid); void tryMountDataMirror(@nullable @utf8InCpp String volumeUuid); void onPrivateVolumeRemoved(@nullable @utf8InCpp String volumeUuid); void migrateLegacyObbData(); Loading libs/gui/BLASTBufferQueue.cpp +9 −2 Original line number Diff line number Diff line Loading @@ -174,7 +174,9 @@ void BLASTBufferQueue::transactionCallback(nsecs_t /*latchTime*/, const sp<Fence } mPendingReleaseItem.item = std::move(mSubmitted.front()); mSubmitted.pop(); if (mNextTransaction == nullptr) { processNextBufferLocked(); } mCallbackCV.notify_all(); decStrong((void*)transactionCallbackThunk); } Loading Loading @@ -252,8 +254,13 @@ Rect BLASTBufferQueue::computeCrop(const BufferItem& item) { void BLASTBufferQueue::onFrameAvailable(const BufferItem& /*item*/) { ATRACE_CALL(); std::lock_guard _lock{mMutex}; std::unique_lock _lock{mMutex}; if (mNextTransaction != nullptr) { while (mNumFrameAvailable > 0 || mNumAcquired == MAX_ACQUIRED_BUFFERS) { mCallbackCV.wait(_lock); } } // add to shadow queue mNumFrameAvailable++; processNextBufferLocked(); Loading libs/gui/include/gui/ISurfaceComposerClient.h +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public: eCursorWindow = 0x00002000, eFXSurfaceBufferQueue = 0x00000000, eFXSurfaceColor = 0x00020000, eFXSurfaceEffect = 0x00020000, eFXSurfaceBufferState = 0x00040000, eFXSurfaceContainer = 0x00080000, eFXSurfaceMask = 0x000F0000, Loading Loading
cmds/installd/InstalldNativeService.cpp +35 −9 Original line number Diff line number Diff line Loading @@ -2684,7 +2684,7 @@ binder::Status InstalldNativeService::invalidateMounts() { } // Mount volume's CE and DE storage to mirror binder::Status InstalldNativeService::onPrivateVolumeMounted( binder::Status InstalldNativeService::tryMountDataMirror( const std::unique_ptr<std::string>& uuid) { ENFORCE_UID(AID_SYSTEM); CHECK_ARGUMENT_UUID(uuid); Loading @@ -2696,24 +2696,50 @@ binder::Status InstalldNativeService::onPrivateVolumeMounted( } const char* uuid_ = uuid->c_str(); // Mount CE mirror std::string mirrorVolCePath(StringPrintf("%s/%s", kDataMirrorCePath, uuid_)); std::lock_guard<std::recursive_mutex> lock(mLock); if (fs_prepare_dir(mirrorVolCePath.c_str(), 0700, AID_ROOT, AID_ROOT) != 0) { if (fs_prepare_dir(mirrorVolCePath.c_str(), 0711, AID_SYSTEM, AID_SYSTEM) != 0) { return error("Failed to create CE mirror"); } auto cePath = StringPrintf("%s/user_ce", create_data_path(uuid_).c_str()); std::string mirrorVolDePath(StringPrintf("%s/%s", kDataMirrorDePath, uuid_)); if (fs_prepare_dir(mirrorVolDePath.c_str(), 0711, AID_SYSTEM, AID_SYSTEM) != 0) { return error("Failed to create DE mirror"); } auto cePath = StringPrintf("%s/user", create_data_path(uuid_).c_str()); auto dePath = StringPrintf("%s/user_de", create_data_path(uuid_).c_str()); if (access(cePath.c_str(), F_OK) != 0) { return error("Cannot access CE path: " + cePath); } if (access(dePath.c_str(), F_OK) != 0) { return error("Cannot access DE path: " + dePath); } struct stat ceStat, mirrorCeStat; if (stat(cePath.c_str(), &ceStat) != 0) { return error("Failed to stat " + cePath); } if (stat(mirrorVolCePath.c_str(), &mirrorCeStat) != 0) { return error("Failed to stat " + mirrorVolCePath); } if (mirrorCeStat.st_ino == ceStat.st_ino) { // As it's being called by prepareUserStorage, it can be called multiple times. // Hence, we if we mount it already, we should skip it. LOG(WARNING) << "CE dir is mounted already: " + cePath; return ok(); } // Mount CE mirror if (TEMP_FAILURE_RETRY(mount(cePath.c_str(), mirrorVolCePath.c_str(), NULL, MS_NOSUID | MS_NODEV | MS_NOATIME | MS_BIND | MS_NOEXEC, nullptr)) == -1) { return error("Failed to mount " + mirrorVolCePath); } // Mount DE mirror std::string mirrorVolDePath(StringPrintf("%s/%s", kDataMirrorDePath, uuid_)); if (fs_prepare_dir(mirrorVolDePath.c_str(), 0700, AID_ROOT, AID_ROOT) != 0) { return error("Failed to create DE mirror"); } auto dePath = StringPrintf("%s/user_de", create_data_path(uuid_).c_str()); if (TEMP_FAILURE_RETRY(mount(dePath.c_str(), mirrorVolDePath.c_str(), NULL, MS_NOSUID | MS_NODEV | MS_NOATIME | MS_BIND | MS_NOEXEC, nullptr)) == -1) { return error("Failed to mount " + mirrorVolDePath); Loading
cmds/installd/InstalldNativeService.h +1 −1 Original line number Diff line number Diff line Loading @@ -155,7 +155,7 @@ public: binder::Status invalidateMounts(); binder::Status isQuotaSupported(const std::unique_ptr<std::string>& volumeUuid, bool* _aidl_return); binder::Status onPrivateVolumeMounted(const std::unique_ptr<std::string>& volumeUuid); binder::Status tryMountDataMirror(const std::unique_ptr<std::string>& volumeUuid); binder::Status onPrivateVolumeRemoved(const std::unique_ptr<std::string>& volumeUuid); binder::Status prepareAppProfile(const std::string& packageName, Loading
cmds/installd/binder/android/os/IInstalld.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -116,7 +116,7 @@ interface IInstalld { int appId, @utf8InCpp String seInfo, int user, int snapshotId, int storageflags); void destroyAppDataSnapshot(@nullable @utf8InCpp String uuid, @utf8InCpp String packageName, int userId, long ceSnapshotInode, int snapshotId, int storageFlags); void onPrivateVolumeMounted(@nullable @utf8InCpp String volumeUuid); void tryMountDataMirror(@nullable @utf8InCpp String volumeUuid); void onPrivateVolumeRemoved(@nullable @utf8InCpp String volumeUuid); void migrateLegacyObbData(); Loading
libs/gui/BLASTBufferQueue.cpp +9 −2 Original line number Diff line number Diff line Loading @@ -174,7 +174,9 @@ void BLASTBufferQueue::transactionCallback(nsecs_t /*latchTime*/, const sp<Fence } mPendingReleaseItem.item = std::move(mSubmitted.front()); mSubmitted.pop(); if (mNextTransaction == nullptr) { processNextBufferLocked(); } mCallbackCV.notify_all(); decStrong((void*)transactionCallbackThunk); } Loading Loading @@ -252,8 +254,13 @@ Rect BLASTBufferQueue::computeCrop(const BufferItem& item) { void BLASTBufferQueue::onFrameAvailable(const BufferItem& /*item*/) { ATRACE_CALL(); std::lock_guard _lock{mMutex}; std::unique_lock _lock{mMutex}; if (mNextTransaction != nullptr) { while (mNumFrameAvailable > 0 || mNumAcquired == MAX_ACQUIRED_BUFFERS) { mCallbackCV.wait(_lock); } } // add to shadow queue mNumFrameAvailable++; processNextBufferLocked(); Loading
libs/gui/include/gui/ISurfaceComposerClient.h +1 −1 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ public: eCursorWindow = 0x00002000, eFXSurfaceBufferQueue = 0x00000000, eFXSurfaceColor = 0x00020000, eFXSurfaceEffect = 0x00020000, eFXSurfaceBufferState = 0x00040000, eFXSurfaceContainer = 0x00080000, eFXSurfaceMask = 0x000F0000, Loading