Class Intent
- All Implemented Interfaces:
ContextItem
,Comparable<Intent>
- Direct Known Subclasses:
AndroidSettingFactory.ExternalIntent
,AndroidSettingFactory.IgnoreIntent
,AndroidSettingFactory.InternalIntent
,AndroidSettingFactory.StandardIntent
,AndroidSettingFactory.UnknownIntent
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
- Author:
- Tobias Blaschke <code@tobiasblaschke.de>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
ContextItem.Value<T>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ContextKey
Key into the Context that represents the Intent.static final Atom
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
int
boolean
equalAction
(Intent other) Does not consider the associated URI.boolean
Intents are equal to Intents with other type.Return the type of Component associated with this Intent.getType()
int
hashCode()
CLASHES: Does not consider intent-type.boolean
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.resolve()
void
Set the target of the intent.void
setActionExplicit
(Atom action) Set the explicit target of the intent.void
void
toString()
void
unbind()
-
Field Details
-
INTENT_KEY
Key into the Context that represents the Intent. -
UNBOUND
-
uri
-
-
Constructor Details
-
Intent
public Intent() -
Intent
-
Intent
-
Intent
-
Intent
-
Intent
-
-
Method Details
-
setExplicit
public void setExplicit() -
isExplicit
public boolean isExplicit() -
setImmutable
public void setImmutable() -
clone
-
setActionExplicit
Set the explicit target of the intent.If setAction is called multible times on an Intent it becomes UNBOUND.
-
unbind
public void unbind() -
setAction
Set the target of the intent.If setAction is called multible times on an Intent it becomes UNBOUND.
-
getAction
-
getType
-
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.
TODO: Set the Component somewhere
-
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
-
toString
-
hashCode
-
equalAction
Does not consider the associated URI. -
equals
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
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Intent>
-