Merge "Add a debug flag to trace origins of permission grants"