protected boolean getAndLogTestStatus()

in niap-cc/Permissions/Tester/app/src/main/java/com/android/certifications/niap/permissions/PrivilegedPermissionTester.java [92:114]


    protected boolean getAndLogTestStatus(String permission) {
        boolean testPassed = true;
        boolean permissionGranted = isPermissionGranted(permission);
        // All privileged permissions are also signature permissions, so it is not a failure if a
        // platform signed app holds a signature|privileged permission. Development permissions can
        // also be granted with the -g flag, so allow those as well since the test app is typically
        // installed with this flag.
        if (!mPlatformSignatureMatch && !mIsPrivApp && permissionGranted
                && !mDevelopmentPermissions.contains(permission)) {
            testPassed = false;
        }
        if (mIsPrivApp && !permissionGranted) {
            testPassed = false;
        }
        if (mPlatformSignatureMatch && !permissionGranted) {
            testPassed = false;
        }
        StatusLogger.logInfo(
                permission + ": " + (testPassed ? "PASSED" : "FAILED") + " (granted = "
                        + permissionGranted + ", signature match = " + mPlatformSignatureMatch
                        + ", priv-app = " + mIsPrivApp + ")");
        return testPassed;
    }