Skip to content

Commit

Permalink
Add FIELD annotation target to @ActivityContext qualifier.
Browse files Browse the repository at this point in the history
If the qualifiers does not have the target field then it can't
be used with in members that are injected either by entry points
or @androidentrypoint.

This change also removes the @target(TYPE) the annotation contained,
this was a mistake and there is no reason for this qualifier to be
added to a class definition.

Fixes #1980

RELNOTES=Added missing FIELD target to @ActivityContext qualifier.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=320698031
  • Loading branch information
danysantiago authored and netdpb committed Jul 13, 2020
1 parent c8a737f commit 29e080f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions java/dagger/hilt/android/qualifiers/ActivityContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@
import java.lang.annotation.Target;
import javax.inject.Qualifier;

/**
* Annotation for a {@code Context} that corresponds to the activity.
*/
/** Annotation for a {@code Context} that corresponds to the activity. */
@Qualifier
@Retention(RetentionPolicy.CLASS)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER})
@Target({ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
public @interface ActivityContext {}

0 comments on commit 29e080f

Please sign in to comment.