public class Intent extends java.lang.Object implements com.ibm.wala.ipa.callgraph.ContextItem, java.lang.Comparable<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!
AndroidEntryPointManager,
IntentContextSelector,
IntentContextInterpreter| Modifier and Type | Class and Description |
|---|---|
static class |
Intent.IntentType |
| Modifier and Type | Field and Description |
|---|---|
static com.ibm.wala.ipa.callgraph.ContextKey |
INTENT_KEY
Key into the Context that represents the Intent.
|
static com.ibm.wala.util.strings.Atom |
UNBOUND |
com.ibm.wala.util.strings.Atom |
uri |
| Constructor and Description |
|---|
Intent() |
Intent(com.ibm.wala.util.strings.Atom action) |
Intent(com.ibm.wala.util.strings.Atom action,
com.ibm.wala.util.strings.Atom uri) |
Intent(java.lang.String action) |
Intent(com.ibm.wala.types.TypeName action) |
Intent(com.ibm.wala.types.TypeName action,
com.ibm.wala.util.strings.Atom uri) |
| Modifier and Type | Method and Description |
|---|---|
Intent |
clone() |
int |
compareTo(Intent other) |
boolean |
equalAction(Intent other)
Does not consider the associated URI.
|
boolean |
equals(java.lang.Object o)
Intents are equal to Intents with other type.
|
com.ibm.wala.util.strings.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(com.ibm.wala.util.strings.Atom action)
Set the target of the intent.
|
void |
setActionExplicit(com.ibm.wala.util.strings.Atom action)
Set the explicit target of the intent.
|
void |
setExplicit() |
void |
setImmutable() |
java.lang.String |
toString() |
void |
unbind() |
public static final com.ibm.wala.ipa.callgraph.ContextKey INTENT_KEY
public static final com.ibm.wala.util.strings.Atom UNBOUND
public com.ibm.wala.util.strings.Atom uri
public Intent()
public Intent(java.lang.String action)
public Intent(com.ibm.wala.util.strings.Atom action)
public Intent(com.ibm.wala.util.strings.Atom action,
com.ibm.wala.util.strings.Atom uri)
public Intent(com.ibm.wala.types.TypeName action,
com.ibm.wala.util.strings.Atom uri)
public Intent(com.ibm.wala.types.TypeName action)
public void setExplicit()
public boolean isExplicit()
public void setImmutable()
public Intent clone()
clone in class java.lang.Objectpublic void setActionExplicit(com.ibm.wala.util.strings.Atom action)
If setAction is called multible times on an Intent it becomes UNBOUND.
public void unbind()
public void setAction(com.ibm.wala.util.strings.Atom action)
If setAction is called multible times on an Intent it becomes UNBOUND.
public com.ibm.wala.util.strings.Atom getAction()
public Intent.IntentType getType()
public AndroidComponent getComponent()
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.
TODO: Set the Component somewhere
public boolean isInternal(boolean strict)
strict - if false return unknown target as internalpublic boolean isExternal(boolean strict)
The Intent is not associated to a class in this application or it's a Standard action defined in the Android Reference Manual.
strict - if false return unknown target as externalpublic boolean isStandard(boolean strict)
It's a Standard action defined in the Android Reference Manual. Implies isExternal.
strict - if false return unknown target as standardpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
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.
hashCode in class java.lang.Objectpublic boolean equalAction(Intent other)
public boolean equals(java.lang.Object o)
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.
equals in class java.lang.Objectpublic Intent resolve()