Sort annotations by weights. resolveRecursiveAnnotations() looks to be sorting the resolved annotations at each step after expansion, but the starting list of annotations does not look sorted. Due to that, it occasionally happened that @RequireSdkVersion check is preceded by version dependent annotations such as @EnsureHasPermission. Bug: 283562550 Test: GtsAudioTestCases, GtsDevicePolicyTestCases Change-Id: Ic4de0bfde81d98aa9b1f387ce62094498c056d93