Merge "Fix NPE in isForegroundAllowedLocked()"