Merge "Fix the case where restricted mode allowed reasons are ignored" into sc-v2-dev