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

Commit 46e7560b authored by Takamasa Kuramitsu's avatar Takamasa Kuramitsu Committed by Felipe Leme
Browse files

Exclude non-permission entries from getAllPermissions()

ScopedAccessLocalPreferences#getAllPermissions() could return null
entries if there's rootViewMode entry in the preference file -
com.android.documentsui_preferences.xml.

This CL excludes the non-permission entries from the result of
getAllPermissions().

Test: Manual
Bug: 77658075
Change-Id: Ife059da4956f76bd1af28b8dff9630470c3ba353
(cherry picked from commit a30ab91bd2f8a2ec121deb62b5ac18d810371a6c)
parent 163eaee6
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -173,7 +173,10 @@ public class ScopedAccessLocalPreferences {
                Log.w(TAG, "error gettting value for key '" + key + "': " + value);
                continue;
            }
            permissions.add(getPermission(key, status));
            final Permission permission = getPermission(key, status);
            if (permission != null) {
                permissions.add(permission);
            }
        }

        return permissions;