Merge "Check calling package before checking permission protection" into sc-dev