Class Intent
- java.lang.Object
-
- com.ibm.wala.dalvik.ipa.callgraph.propagation.cfa.Intent
-
- All Implemented Interfaces:
ContextItem
,Comparable<Intent>
- Direct Known Subclasses:
AndroidSettingFactory.ExternalIntent
,AndroidSettingFactory.IgnoreIntent
,AndroidSettingFactory.InternalIntent
,AndroidSettingFactory.StandardIntent
,AndroidSettingFactory.UnknownIntent
public class Intent extends Object implements ContextItem, Comparable<Intent>
Determines the target of an Android-Intent. An Intent is generated at each Constructor-Call of an Android-Intent. Information to that Constructor is added as target. If you want to change the target don't change this Object! Instead place an override using the AndroidEntryPointManager so no information is lost. Upon the creation of an Intent it's target-type almost always points to UNKNOWN. Again change this using an override. This class contains functions that determine the target-type on the Intent itself. They are intended as fallback only. CAUTION: If you inherit from this class - keep hashCodes and equals clashing!- Since:
- 2013-10-12
- See Also:
AndroidEntryPointManager
,IntentContextSelector
,IntentContextInterpreter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Intent.IntentType
-
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
ContextItem.Value<T>
-
-
Field Summary
Fields Modifier and Type Field Description static ContextKey
INTENT_KEY
Key into the Context that represents the Intent.static Atom
UNBOUND
Atom
uri
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Intent
clone()
int
compareTo(Intent other)
boolean
equalAction(Intent other)
Does not consider the associated URI.boolean
equals(Object o)
Intents are equal to Intents with other type.Atom
getAction()
AndroidComponent
getComponent()
Return the type of Component associated with this Intent.Intent.IntentType
getType()
int
hashCode()
CLASHES: Does not consider intent-type.boolean
isExplicit()
boolean
isExternal(boolean strict)
Has the target to be resolved by an external App.boolean
isInternal(boolean strict)
Is the Intents target internally resolvable.boolean
isStandard(boolean strict)
Is the Intent one of the System-Defined ones.Intent
resolve()
void
setAction(Atom action)
Set the target of the intent.void
setActionExplicit(Atom action)
Set the explicit target of the intent.void
setExplicit()
void
setImmutable()
String
toString()
void
unbind()
-
-
-
Field Detail
-
INTENT_KEY
public static final ContextKey INTENT_KEY
Key into the Context that represents the Intent.
-
UNBOUND
public static final Atom UNBOUND
-
uri
public Atom uri
-
-
Method Detail
-
setExplicit
public void setExplicit()
-
isExplicit
public boolean isExplicit()
-
setImmutable
public void setImmutable()
-
setActionExplicit
public void setActionExplicit(Atom action)
Set the explicit target of the intent. If setAction is called multible times on an Intent it becomes UNBOUND.
-
unbind
public void unbind()
-
setAction
public void setAction(Atom action)
Set the target of the intent. If setAction is called multible times on an Intent it becomes UNBOUND.
-
getAction
public Atom getAction()
-
getType
public Intent.IntentType getType()
-
getComponent
public AndroidComponent getComponent()
Return the type of Component associated with this Intent. May return null (especially on an UNKNOWN target). The IntentContextInterpreter uses the IntentStarters.StartInfo to determine the Target. However it is nicer to set the Component here.
-
isInternal
public boolean isInternal(boolean strict)
Is the Intents target internally resolvable.- Parameters:
strict
- if false return unknown target as internal- Returns:
- if the Intent is associated to a class in the analyzed application.
-
isExternal
public boolean isExternal(boolean strict)
Has the target to be resolved by an external App. The Intent is not associated to a class in this application or it's a Standard action defined in the Android Reference Manual.- Parameters:
strict
- if false return unknown target as external
-
isStandard
public boolean isStandard(boolean strict)
Is the Intent one of the System-Defined ones. It's a Standard action defined in the Android Reference Manual. Implies isExternal.- Parameters:
strict
- if false return unknown target as standard
-
hashCode
public int hashCode()
CLASHES: Does not consider intent-type. This clash is however intended: This aids in resolving the override of an Intent. The AndroidEntryPointManager generates new Intent Objects. Instead of searching all overrides we get it for free.
-
equalAction
public boolean equalAction(Intent other)
Does not consider the associated URI.
-
equals
public boolean equals(Object o)
Intents are equal to Intents with other type. This clash is however intended: This aids in resolving the override of an Intent. The AndroidEntryPointManager generates new Intent Objects. Instead of searching all overrides we get it for free.
-
resolve
public Intent resolve()
-
compareTo
public int compareTo(Intent other)
- Specified by:
compareTo
in interfaceComparable<Intent>
-
-