com.ardic.android.managers.appcontrol.IAppControlManager |
Provides a set of APIs for controlling application states and behavior. Each application state
and behavior are defined as system level controls. Initially none of those controls are defined
and they are defined by individual API calls such as; addAppControlItem(AppControlItem)
setPackageBlocked(String, boolean)
setClearDataBlocked(String, boolean)
setForceStopBlocked(String, boolean)
setUninstallBlocked(String, boolean)
setNetworkBlocked(String, boolean)
addAppControlItem(AppControlItem)
It deals with several controls of applications:
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds or updates a given
AppControlItem . | |||||||||||
Adds the permission to black permission list.
| |||||||||||
Adds the new blocked permission to given application blocked permission list.
| |||||||||||
Clears all
AppControlItem s. | |||||||||||
Clears the all black permissions.
| |||||||||||
Clears the all blocked permissions from given application blocked permission list.
| |||||||||||
Returns a given packageName's
AppControlItem . | |||||||||||
Returns all
AppControlItem list. | |||||||||||
Returns the black permission list.
| |||||||||||
Returns the given application's blocked permissions list.
| |||||||||||
Returns the controllable builtin app list.
| |||||||||||
Returns the controllable external app list.
| |||||||||||
Checks if the given
AppControlItem has been added or not. | |||||||||||
Returns the given
AppControlItem clear data blocked state. | |||||||||||
Returns the given
AppControlItem force stop blocked state. | |||||||||||
Returns the given
AppControlItem network blocked state. | |||||||||||
Returns the given
AppControlItem package blocked state. | |||||||||||
Returns built-in android settings application state.
| |||||||||||
Returns the given
AppControlItem uninstall blocked state. | |||||||||||
Removes a given
AppControlItem . | |||||||||||
Removes the permission from black permission list.
| |||||||||||
Removes the blocked permission from given application blocked permission list.
| |||||||||||
Sets the given
AppControlItem clear data blocked state. | |||||||||||
Sets the given
AppControlItem force stop control. | |||||||||||
Sets the given
AppControlItem network blocked state. | |||||||||||
Sets the given
AppControlItem package blocked state. | |||||||||||
Blocks built-in android settings application completely.
| |||||||||||
Sets the given
AppControlItem uninstall blocked state. |
Adds or updates a given AppControlItem
. Each created AppControlItem has default
values so passing this item resets all configuration already set by other function calls for
target package. If you don't want to reset these configurations, try to use
getAppControlItem(String)
function first and then make all your changes on returned
item with recalling addAppControlItem(AppControlItem)
by this updated item. To set
each configuration one by one you could use following functions; setPackageBlocked(String, boolean)
setForceStopBlocked(String, boolean)
setNetworkBlocked(String, boolean)
setClearDataBlocked(String, boolean)
setUninstallBlocked(String, boolean)
Parameters | |
---|---|
item |
AppControlItem :
AppControlItem |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Adds the permission to black permission list.
A black permission rules out same blocked/unblocked permission added for applications.
Parameters | |
---|---|
blackPermission |
String :
Black Manifest.permission |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Adds the new blocked permission to given application blocked permission list.
Parameters | |
---|---|
packageName |
String :
Application package name |
blockedPermission |
String :
Blocked Manifest.permission |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Clears all AppControlItem
s. Warning: This operation could take too much time, to
avoid ANR exception you should call this function in new thread.
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Clears the all black permissions.
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Clears the all blocked permissions from given application blocked permission list.
Parameters | |
---|---|
packageName |
String
|
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Returns a given packageName's AppControlItem
.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
AppControlItem |
AppControlItem if exists else null |
Throws | |
---|---|
AfexException |
Returns all AppControlItem
list.
Returns | |
---|---|
List<AppControlItem> |
Populated or empty AppControlItem list |
Throws | |
---|---|
AfexException |
Returns the black permission list.
Returns | |
---|---|
List<String> |
Black Manifest.permission list |
Throws | |
---|---|
AfexException |
Returns the given application's blocked permissions list.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
List<String> |
Blocked Manifest.permission list |
Throws | |
---|---|
AfexException |
Returns the controllable builtin app list.
Returns | |
---|---|
List<String> |
Controllable builtin app list |
Throws | |
---|---|
AfexException |
Returns the controllable external app list.
Returns | |
---|---|
List<String> |
Controllable external app list |
Throws | |
---|---|
AfexException |
Checks if the given AppControlItem
has been added or not. All AppControlItem
items are added explicitly by user. There is not any pre added AppControlItem
by
system.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if AppControlItem exists else false |
Throws | |
---|---|
AfexException |
Returns the given AppControlItem
clear data blocked state.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if clear data state is blocked else false |
Throws | |
---|---|
|
AfexException} |
AfexException |
Returns the given AppControlItem
force stop blocked state.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if force stop blocked else false |
Throws | |
---|---|
AfexException |
Returns the given AppControlItem
network blocked state.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if network is blocked else false |
Throws | |
---|---|
AfexException |
Returns the given AppControlItem
package blocked state.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if package is blocked else false |
Throws | |
---|---|
AfexException |
Returns built-in android settings application state.
Returns | |
---|---|
boolean |
true if settings is blocked else false |
Throws | |
---|---|
AfexException |
Returns the given AppControlItem
uninstall blocked state.
Parameters | |
---|---|
packageName |
String :
Application package name |
Returns | |
---|---|
boolean |
true if uninstall state is blocked else false |
Throws | |
---|---|
AfexException |
Removes a given AppControlItem
.
Parameters | |
---|---|
item |
AppControlItem :
AppControlItem |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Removes the permission from black permission list.
Parameters | |
---|---|
blackPermission |
String :
Black Manifest.permission |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Removes the blocked permission from given application blocked permission list.
Parameters | |
---|---|
packageName |
String :
Application package name |
blockedPermission |
String :
Blocked Manifest.permission |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets the given AppControlItem
clear data blocked state. Setting cleardata blocked as
true
disables clearing data to application for setting application activity.
Parameters | |
---|---|
packageName |
String :
Application package name |
state |
boolean :
true to block clear data state else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets the given AppControlItem
force stop control. Setting force stop blocked as
true
disables force stopping to application for setting application activity.
Parameters | |
---|---|
packageName |
String :
Application package name |
state |
boolean :
true to block force stop state else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets the given AppControlItem
network blocked state. Setting network blocked as
true
disables the application network connection and false
reenables the
network.
Warning: Network state can not effect immediately after changes. User must force close the target application after network state changed. Updated network state can be active for freshly started application.
Parameters | |
---|---|
packageName |
String :
Application package name |
state |
boolean :
true to block network connection state else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets the given AppControlItem
package blocked state. Setting package blocked as
true
disables the application on the system and false
reenables the
application.
Parameters | |
---|---|
packageName |
String :
Application package name |
state |
boolean :
true to block package completely else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Blocks built-in android settings application completely.
Parameters | |
---|---|
state |
boolean :
true to block settings, false to unblock |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |
Sets the given AppControlItem
uninstall blocked state. Setting the uninstall blocked
as true
interfere to uninstalling operations and doesn't lets the uninstalled the
application.
Parameters | |
---|---|
packageName |
String :
Application package name |
state |
boolean :
true to block uninstall state else false |
Returns | |
---|---|
boolean |
true if the operation succeeds else false |
Throws | |
---|---|
AfexException |