public class SapaAppInfo
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Field and Description |
---|---|
static int |
CATEGORY_EFFECT
Category of application effect.
|
static int |
CATEGORY_INSTRUMENT
Category of application instrument.
|
static int |
CATEGORY_UTILITY
Category of application utility.
|
static android.os.Parcelable.Creator<SapaAppInfo> |
CREATOR |
static int |
STATE_ACTIVATING
Process value indicating that the instance of application shall be
activated.
|
static int |
STATE_DEACTIVATING
Process value indicating that the instance of application shall be
deactivated.
|
Constructor and Description |
---|
SapaAppInfo()
Creates undefined SapaAppInfo.
|
SapaAppInfo(android.os.Parcel in)
Creates SapaAppInfo according to in parcel.
|
SapaAppInfo(android.content.pm.ResolveInfo resInfo)
Created SapaAppInfo based on resolve info of application.
|
Modifier and Type | Method and Description |
---|---|
void |
addPort(SapaPort port)
Adds port to port list.
|
int |
describeContents() |
boolean |
equals(java.lang.Object obj) |
SapaActionInfo |
getActionInfo(java.lang.String actionId)
Returns information about action with given identifier.
|
android.util.SparseArray<SapaActionInfo> |
getActions()
Returns an array of declared actions.
|
SapaApp |
getApp()
Returns SapaApp object that identifies instance of application.
|
static SapaApp |
getApp(android.content.Intent intent)
This method reads instance id from intent received in onStartCommand
method.
|
static SapaAppInfo |
getAppInfo(android.content.Intent intent)
This method reads application info from intent received in onStartCommand
method.
|
int |
getAudioInputPortCount()
Returns information whether instance has at least one audio input port.
|
int |
getAudioOutputPortCount()
Returns information whether instance has at least one audio output port.
|
int |
getCategory()
Returns category of application.
|
android.os.Bundle |
getConfiguration()
Returns configuration of instance of application.
|
java.lang.String |
getDescription()
This method returns description of the application.
|
android.graphics.drawable.Drawable |
getIcon(android.content.Context context)
This method returns drawable object of icon of the application.
|
android.graphics.drawable.Drawable |
getLogo(android.content.Context context)
This method returns drawable object of logo of the application.
|
android.os.Bundle |
getMetaData()
This method returns metadata from AndroidManifest of represented
application.
|
int |
getMidiInputPortCount()
Returns information whether instance has at least one midi input port.
|
int |
getMidiOutputPortCount()
Returns information whether instance has at least one midi output port.
|
java.lang.String |
getName()
Returns name of the application shown to user.
|
java.lang.String |
getPackageName()
Returns package name of the application.
|
SapaPort |
getPortByName(java.lang.String name)
This method returns port from the instance of application.
|
android.util.SparseArray<SapaPort> |
getPorts()
Gets list of ports.
|
java.lang.String |
getProductGroupName()
This method returns name of group of products.
|
static int |
getState(android.content.Intent intent)
This method returns information whether the instance is activated or
deactivated.When the application declares that it can have more than one
instance, onStartCommand() is called on it when it is activated or
deactivated.
|
java.lang.String |
getVendorName()
This method returns vendor name.
|
static int |
getVersionCode(android.content.Context context)
Returns version code.
|
java.lang.String |
getVersionName()
This method return version of application.
|
int |
hashCode() |
boolean |
isMultiInstanceEnabled()
Returns information whether application can have more than one instance.
|
void |
removePort(SapaPort port)
Removes port from port list.
|
void |
setActions(android.util.SparseArray<SapaActionInfo> actions)
This method set declarations of actions available for this instance of
application.
|
void |
setConfiguration(android.os.Bundle configuration)
Sets configuration of instance of application.
|
void |
setPortFromSapaProcessor(SapaProcessor sapaProcessor)
Sets ports registered on sapaProcessor to ports.
|
void |
setPorts(java.util.ArrayList<SapaPort> ports)
Sets ports of instance of application.
|
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final int STATE_ACTIVATING
public static final int STATE_DEACTIVATING
public static final int CATEGORY_INSTRUMENT
public static final int CATEGORY_EFFECT
public static final int CATEGORY_UTILITY
public static final android.os.Parcelable.Creator<SapaAppInfo> CREATOR
public SapaAppInfo()
public SapaAppInfo(android.content.pm.ResolveInfo resInfo) throws java.lang.RuntimeException
resInfo
- ResolveInfo of the application.java.lang.RuntimeException
- Thrown when not enough data is placedpublic SapaAppInfo(android.os.Parcel in)
in
- a parcel to recoverpublic static int getVersionCode(android.content.Context context)
context
- an contextpublic final SapaPort getPortByName(java.lang.String name)
name
- Name of the port.public final java.lang.String getDescription()
public final void setPorts(java.util.ArrayList<SapaPort> ports)
ports
- Ports to be set.public final android.os.Bundle getMetaData()
public final void setPortFromSapaProcessor(SapaProcessor sapaProcessor)
sapaProcessor
- SapaProcessor from which ports are obtained.public final void addPort(SapaPort port)
port
- Port to be added.public final void removePort(SapaPort port)
port
- Port to be removed.public final android.util.SparseArray<SapaPort> getPorts()
public final java.lang.String getPackageName()
public final java.lang.String getName()
public final android.graphics.drawable.Drawable getIcon(android.content.Context context) throws android.content.pm.PackageManager.NameNotFoundException
context
- Context of your application.android.content.pm.PackageManager.NameNotFoundException
- Thrown if the resources for the given application could not
be loaded.public final java.lang.String getVendorName()
public final java.lang.String getVersionName()
public final java.lang.String getProductGroupName()
public final android.graphics.drawable.Drawable getLogo(android.content.Context context) throws android.content.pm.PackageManager.NameNotFoundException
context
- Context of your application.android.content.pm.PackageManager.NameNotFoundException
- Thrown if the resources for the given application could not
be loaded.public final SapaActionInfo getActionInfo(java.lang.String actionId)
actionId
- Id of requested action.public final android.util.SparseArray<SapaActionInfo> getActions()
public final void setActions(android.util.SparseArray<SapaActionInfo> actions)
actions
- Array of declared actions.public final SapaApp getApp()
public final boolean isMultiInstanceEnabled()
public final void setConfiguration(android.os.Bundle configuration)
configuration
- Configuration to be set.public final android.os.Bundle getConfiguration()
public final int getCategory()
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
public static final SapaAppInfo getAppInfo(android.content.Intent intent)
intent
- Intent received in onStartCommand method.public static final SapaApp getApp(android.content.Intent intent)
intent
- Intent received in onStartCommand method.public static final int getState(android.content.Intent intent)
intent
- Intent received in onStartCommand of the declared background
service.STATE_ACTIVATING
or STATE_DEACTIVATING
otherwise it returns empty string.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int getMidiInputPortCount()
public int getMidiOutputPortCount()
public int getAudioInputPortCount()
public int getAudioOutputPortCount()