diff options
Diffstat (limited to 'java/com/android/dialer/rootcomponentgenerator/RootComponentGeneratingStep.java')
-rw-r--r-- | java/com/android/dialer/rootcomponentgenerator/RootComponentGeneratingStep.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/java/com/android/dialer/rootcomponentgenerator/RootComponentGeneratingStep.java b/java/com/android/dialer/rootcomponentgenerator/RootComponentGeneratingStep.java index 4c4e6ee8d..cb312083f 100644 --- a/java/com/android/dialer/rootcomponentgenerator/RootComponentGeneratingStep.java +++ b/java/com/android/dialer/rootcomponentgenerator/RootComponentGeneratingStep.java @@ -72,8 +72,7 @@ final class RootComponentGeneratingStep implements ProcessingStep { // defer root components to the next round in case where the current build target contains // elements annotated with @InstallIn. Annotation processor cannot detect metadata files // generated in the same round and the metadata is accessible in the next round. - if (elementsByAnnotation.containsKey(InstallIn.class) - || elementsByAnnotation.containsKey(IncludeInDialerRoot.class)) { + if (shouldDeferRootComponent(elementsByAnnotation)) { return elementsByAnnotation.get(DialerRootComponent.class); } else { generateRootComponent(MoreElements.asType(element)); @@ -82,6 +81,12 @@ final class RootComponentGeneratingStep implements ProcessingStep { return Collections.emptySet(); } + private boolean shouldDeferRootComponent( + SetMultimap<Class<? extends Annotation>, Element> elementsByAnnotation) { + return elementsByAnnotation.containsKey(InstallIn.class) + || elementsByAnnotation.containsKey(IncludeInDialerRoot.class); + } + /** * Generates a root component. * |