com.ardic.android.managers.appgeneral.IAppGeneralManager |
Provides a set of APIs to manage application related information and operations.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DISPLAY_ORDER_APP_NAME | In app name alphabetical order | |||||||||
int | DISPLAY_ORDER_LAUNCH_COUNT | In launch count decreasing order | |||||||||
int | DISPLAY_ORDER_USAGE_TIME | In usage time decreasing order | |||||||||
int | REMOVE_TASK_KILL_PROCESS |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds the given application shortcut to the default workspace.
| |||||||||||
Clears the given application cache.
| |||||||||||
Clears the given application data.
| |||||||||||
Clears the given application all preferred assignments to launch by default application.
| |||||||||||
Clears all tasks that the user has recently launched from task history.
| |||||||||||
Returns application name of the given application.
| |||||||||||
Returns the all application shortcut from the all workspace.
| |||||||||||
Returns user id of the given application.
| |||||||||||
This method was deprecated
in API level 5.
in Android Lollipop
| |||||||||||
Returns version code of the given application.
| |||||||||||
Returns version name of the given application.
| |||||||||||
Returns package's public certificate.
| |||||||||||
Returns
PackageStatsItem of the given application. | |||||||||||
Returns process stats of the given application.
| |||||||||||
This method was deprecated
in API level 5.
in Android Lollipop
| |||||||||||
Checks if the given application is running or not.
| |||||||||||
Gets caller application's "Usage of Apps" access state.
| |||||||||||
Gets caller application's "Usage of Apps" access locking state.The access can not be
deactivated by any application or user instead of itself.
| |||||||||||
Ask that the task associated with a given task ID be moved to the front of the stack, so it
is now visible to the user.
| |||||||||||
Removes the given application shortcut from the default workspace.
| |||||||||||
Removes the given task that the user has recently launched from task history.
| |||||||||||
Sets caller application's "Usage of Apps" access state.
| |||||||||||
Sets caller application's "Usage of Apps" access locking state if it is enabled.
| |||||||||||
Sets the given application stopped state, mostly for the ability to receive broadcast
messages.
| |||||||||||
Starts the given application if it includes MAIN activity.
| |||||||||||
Stops the given application if it has already started.
|
In app name alphabetical order
In launch count decreasing order
In usage time decreasing order
Adds the given application shortcut to the default workspace. Warning: This api is asynchronous so returning true means this api called successfully. This doesn't mean shortcut will be added.
Parameters | |
---|---|
packageName |
String :
Application package name |
className |
String :
Application activity name |
Returns | |
---|---|
boolean |
true if the operation started successfully else false |
Throws | |
---|---|
AfexException |
Clears the given application cache.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Clears the given application data.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Clears the given application all preferred assignments to launch by default application.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Clears all tasks that the user has recently launched from task history.
Parameters | |
---|---|
getFlags |
int :
Information about what to return. May be any combination of
RECENT_WITH_EXCLUDED and
RECENT_IGNORE_UNAVAILABLE . |
removeFlags |
int :
Additional operational flags. May be 0 or
REMOVE_TASK_KILL_PROCESS . |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Returns application name of the given application.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
String |
application label if application exists else given package name |
Throws | |
---|---|
AfexException |
Returns the all application shortcut from the all workspace.
Returns | |
---|---|
List<String> |
All shortcut's package name list |
Throws | |
---|---|
AfexException |
Returns user id of the given application.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
int |
Application user id |
Throws | |
---|---|
AfexException |
This method was deprecated
in API level 5.
in Android Lollipop
Returns UsageStatsItem
list in the given display order. In Android Lollipop; After
API level 21, This API throws ERROR(/AfexExceptionType.NA)
After Lollipop, use
UsageStatsManager
Parameters | |
---|---|
displayOrder |
int :
Orders displays as follows; DISPLAY_ORDER_USAGE_TIME -
In usage time decreasing orderDISPLAY_ORDER_LAUNCH_COUNT - In
launch count decreasing orderDISPLAY_ORDER_APP_NAME - In app
name alphabetical order |
Returns | |
---|---|
List<UsageStatsItem> |
UsageStatsItem list which is ordered by displayOrder else null |
Throws | |
---|---|
AfexException |
Returns version code of the given application.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
int |
Application version code |
Throws | |
---|---|
AfexException |
Returns version name of the given application.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
String |
Application version name |
Throws | |
---|---|
AfexException |
Returns package's public certificate.
Parameters | |
---|---|
packageName |
String :
Target package name |
Returns | |
---|---|
String |
String if certificate is found else null |
Throws | |
---|---|
AfexException |
Returns PackageStatsItem
of the given application. PackageStatsItem
can be
obsolete if user clears package related part. So after each package related operations user
could call this API to refresh package stats.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
PackageStatsItem |
PackageStatsItem or null if package does not exist |
Throws | |
---|---|
AfexException |
Returns process stats of the given application.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
ProcessStatsItem |
ProcessStatsItem |
Throws | |
---|---|
AfexException |
This method was deprecated
in API level 5.
in Android Lollipop
Returns a list of the tasks that the user has recently launched, with the most recent being first and older ones after in order.
Note: this method is only intended for debugging and presenting task management user interfaces. This should never be used for core logic in an application, such as deciding between different behaviors based on the information found here. Such uses are not supported, and will likely break in the future. For example, if multiple applications can be actively running at the same time, assumptions made about the meaning of the data here for purposes of control flow will be incorrect.
Parameters | |
---|---|
maxNum |
int :
The maximum number of entries to return in the list. The actual number returned
may be smaller, depending on how many tasks the user has started and the maximum
number the system can remember. |
getFlags |
int :
Information about what to return. May be any combination of
RECENT_WITH_EXCLUDED and
RECENT_IGNORE_UNAVAILABLE . |
Returns | |
---|---|
List<String> |
List of RecentTaskInfo's package name records describing each of the recent tasks. |
Throws | |
---|---|
AfexException |
Checks if the given application is running or not.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if application is running else false |
Throws | |
---|---|
AfexException |
Gets caller application's "Usage of Apps" access state. In Android Lollipop; After API level
21, This API throws ERROR(/AfexExceptionType.NA)
Returns | |
---|---|
boolean |
true if it is enabled else false |
Throws | |
---|---|
AfexException |
Gets caller application's "Usage of Apps" access locking state.The access can not be
deactivated by any application or user instead of itself. In Android Lollipop; After API
level 21, This API throws ERROR(/AfexExceptionType.NA)
Returns | |
---|---|
boolean |
true if it is locked else false |
Throws | |
---|---|
AfexException |
Ask that the task associated with a given task ID be moved to the front of the stack, so it is now visible to the user.
Parameters | |
---|---|
taskId |
int :
The identifier of the task to be moved, as found in RunningTaskInfo or
RecentTaskInfo. |
flags |
int :
Additional operational flags, 0 or more of
MOVE_TASK_WITH_HOME and
MOVE_TASK_NO_USER_ACTION . |
Throws | |
---|---|
AfexException |
Removes the given application shortcut from the default workspace. Warning: This api is asynchronous so returning true means this api called successfully. This doesn't mean shortcut will be removed.
Parameters | |
---|---|
packageName |
String :
Application package name |
className |
String :
Application activity name |
Returns | |
---|---|
boolean |
true if the operation started successfully else false |
Throws | |
---|---|
AfexException |
Removes the given task that the user has recently launched from task history.
Parameters | |
---|---|
packageName |
String :
Target removing task's package name. |
getFlags |
int :
Information about what to return. May be any combination of
RECENT_WITH_EXCLUDED and
RECENT_IGNORE_UNAVAILABLE . |
removeFlags |
int :
Additional operational flags. May be 0 or
REMOVE_TASK_KILL_PROCESS . |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets caller application's "Usage of Apps" access state. In Android Lollipop; After API level
21, This API throws ERROR(/AfexExceptionType.NA)
Parameters | |
---|---|
state |
boolean :
true provides App Usage access to caller app access instead of itself,
false not access. |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets caller application's "Usage of Apps" access locking state if it is enabled. In Android
Lollipop; After API level 21, This API throws ERROR(/AfexExceptionType.NA)
Firstly, you can
enable the acces by ERROR(/setAppUsageAccessEnabled)
The access can not be deactivated by any
application or user instead of itself.
Parameters | |
---|---|
state |
boolean :
true locks App Usage access to caller app and nothing can remove it's
access instead of itself, false unlocks. |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
See also:
Sets the given application stopped state, mostly for the ability to receive broadcast
messages. When a new application is installed, it's stop state is true
until the user
explicitly starts it. Only force stop sets stop state back to true
again.
Parameters | |
---|---|
packageName |
String :
Application package name, |
state |
boolean :
Application stop state. If state is false the application will exit
stopped state. Therefore, the application can handle most of the prohibited
broadcasts such as ACTION_BOOT_COMPLETED |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Starts the given application if it includes MAIN activity.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if application has MAIN activity and start activity intent broadcasted
successfully else false |
Throws | |
---|---|
AfexException |
Stops the given application if it has already started.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if application force stopping called (the end result depends on
application's killable attribute) else false |
Throws | |
---|---|
AfexException |