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

Commit bd288446 authored by Stanislav Zholnin's avatar Stanislav Zholnin Committed by android-build-merger
Browse files

Fix issue with AppPermissionsFragment crashing when no allowed or no denied permissions presented.

am: f60f249d

Change-Id: I7de4c57e11a067878f45acd2f40d207b97b39a81
parents 5e6ea791 f60f249d
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -348,6 +348,11 @@ public final class AppPermissionsFragment extends SettingsWithLargeHeader {
        for (int i = 0; i < numAllowed; i++) {
            Preference preference = allowed.getPreference(i);

            if (preference.getSummary() == null) {
                // R.string.no_permission_allowed was added to PreferenceCategory
                continue;
            }

            int category = APP_PERMISSIONS_FRAGMENT_VIEWED__CATEGORY__ALLOWED;
            if (permissionSubtitleOnlyInForeground.contentEquals(preference.getSummary())) {
                category = APP_PERMISSIONS_FRAGMENT_VIEWED__CATEGORY__ALLOWED_FOREGROUND;
@@ -361,6 +366,10 @@ public final class AppPermissionsFragment extends SettingsWithLargeHeader {
        int numDenied = denied.getPreferenceCount();
        for (int i = 0; i < numDenied; i++) {
            Preference preference = denied.getPreference(i);
            if (preference.getSummary() == null) {
                // R.string.no_permission_denied was added to PreferenceCategory
                continue;
            }
            logAppPermissionsFragmentViewEntry(sessionId, viewId, preference.getKey(),
                    APP_PERMISSIONS_FRAGMENT_VIEWED__CATEGORY__DENIED);
        }