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

Commit 31c82af3 authored by Nate Myren's avatar Nate Myren
Browse files

Fix NPE when setting App Permission links

Ensure the case of a null caller is handled when setting bottom link
states.

Test: Open the PermissionController from a notification
Fixes: 149885414
Change-Id: I01c1921857b4d748b4b9c08c32aa7f8fb115e45b
parent 0bf2d95d
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ import com.android.settingslib.RestrictedLockUtils.EnforcedAdmin;
import com.android.settingslib.widget.ActionBarShadowController;

import java.util.Map;
import java.util.Objects;

import kotlin.Pair;

@@ -254,10 +255,10 @@ public class AppPermissionFragment extends SettingsWithLargeHeader
    }

    private void setBottomLinkState(TextView view, String caller, String action) {
        if ((caller.equals(AppPermissionGroupsFragment.class.getName())
        if ((Objects.equals(caller, AppPermissionGroupsFragment.class.getName())
                && action.equals(Intent.ACTION_MANAGE_APP_PERMISSIONS))
                || (caller.equals(PermissionAppsFragment.class.getName()))
                && action.equals(Intent.ACTION_MANAGE_PERMISSION_APPS)) {
                || (Objects.equals(caller, PermissionAppsFragment.class.getName())
                && action.equals(Intent.ACTION_MANAGE_PERMISSION_APPS))) {
            view.setVisibility(View.GONE);
        } else {
            view.setOnClickListener((v) -> {