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

Commit f1bf96dc authored by Jorge Ruesga's avatar Jorge Ruesga Committed by Gerrit Code Review
Browse files

settings: fix fc for system apps with null applicationInfo



Change-Id: I357eb4b2b4e4cc03a88eaa1041603b7b26599f89
JIRA: CYAN-6844
Signed-off-by: default avatarJorge Ruesga <jorge@ruesga.com>
parent e99decb9
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -279,7 +279,7 @@ public class InstalledAppDetails extends Fragment

        // This is a protected app component.
        // You cannot clear data for a protected component
        if (mPackageInfo.applicationInfo.protect) {
        if (isProtectedApp()) {
            enabled = false;
        }

@@ -435,7 +435,7 @@ public class InstalledAppDetails extends Fragment

        // This is a protected app component.
        // You cannot a uninstall a protected component
        if (mPackageInfo.applicationInfo.protect) {
        if (isProtectedApp()) {
            enabled = false;
        }

@@ -595,7 +595,7 @@ public class InstalledAppDetails extends Fragment
        }
        menu.findItem(UNINSTALL_ALL_USERS_MENU).setVisible(showIt);

        menu.findItem(OPEN_PROTECTED_APPS).setVisible(mPackageInfo.applicationInfo.protect);
        menu.findItem(OPEN_PROTECTED_APPS).setVisible(isProtectedApp());
    }

    @Override
@@ -1564,5 +1564,11 @@ public class InstalledAppDetails extends Fragment
            }
        }
    }

    private boolean isProtectedApp() {
        // Some system apps doesn't have applicationInfo. Ensure we don't access to a null
        // reference. In that case we assume the app isn't protected
        return mPackageInfo.applicationInfo != null && mPackageInfo.applicationInfo.protect;
    }
}