Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b341d85 authored by Saumya Pathak's avatar Saumya Pathak
Browse files

Fix bug in getStorageVolumesIncludingSharedProfiles

The API currently doesn't return clone profile volumes correctly because
it only looks for volumes visible to the clone for read. Changed it to
include writable volumes as well

Test: atest
AppCloningHostTest#testGetStorageVolumesIncludingSharedProfiles
Bug: 230828743

Change-Id: I4db128027e622ab807c1fbee664dfa7d9a3a26aa
parent 7ee5bcf8
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3880,9 +3880,12 @@ class StorageManagerService extends IStorageManager.Stub
                    match = vol.isVisibleForWrite(userId)
                            || (includeSharedProfile && vol.isVisibleForWrite(userIdSharingMedia));
                } else {
                    // Return both read only and write only volumes. When includeSharedProfile is
                    // true, all the volumes of userIdSharingMedia should be returned when queried
                    // from the user it shares media with
                    match = vol.isVisibleForUser(userId)
                            || (!vol.isVisible() && includeInvisible && vol.getPath() != null)
                            || (includeSharedProfile && vol.isVisibleForRead(userIdSharingMedia));
                            || (includeSharedProfile && vol.isVisibleForUser(userIdSharingMedia));
                }
                if (!match) continue;