Added in API level 1
public interface

IAppControlManager

com.ardic.android.managers.appcontrol.IAppControlManager

Class Overview

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:

    • Configures list of controls of an application for example: package, network, forceStop, uninstall, clearData blocked and unblocked and blockedPermission.
    • Sets application package's state (stop state) for receiving broadcast messages without any user interaction.
    -

    Summary

    Public Methods
    abstract boolean addAppControlItem(AppControlItem item)
    Adds or updates a given AppControlItem.
    abstract boolean addBlackPermission(String blackPermission)
    Adds the permission to black permission list.
    abstract boolean addBlockedPermission(String packageName, String blockedPermission)
    Adds the new blocked permission to given application blocked permission list.
    abstract boolean clearAppControlItems()
    Clears all AppControlItems.
    abstract boolean clearBlackPermissions()
    Clears the all black permissions.
    abstract boolean clearBlockedPermissions(String packageName)
    Clears the all blocked permissions from given application blocked permission list.
    abstract AppControlItem getAppControlItem(String packageName)
    Returns a given packageName's AppControlItem.
    abstract List<AppControlItem> getAppControlItemList()
    Returns all AppControlItem list.
    abstract List<String> getBlackPermissionList()
    Returns the black permission list.
    abstract List<String> getBlockedPermissionList(String packageName)
    Returns the given application's blocked permissions list.
    abstract List<String> getControllableBuiltinAppList()
    Returns the controllable builtin app list.
    abstract List<String> getControllableExternalAppList()
    Returns the controllable external app list.
    abstract boolean hasAppControlItem(String packageName)
    Checks if the given AppControlItem has been added or not.
    abstract boolean isClearDataBlocked(String packageName)
    Returns the given AppControlItem clear data blocked state.
    abstract boolean isForceStopBlocked(String packageName)
    Returns the given AppControlItem force stop blocked state.
    abstract boolean isNetworkBlocked(String packageName)
    Returns the given AppControlItem network blocked state.
    abstract boolean isPackageBlocked(String packageName)
    Returns the given AppControlItem package blocked state.
    abstract boolean isSettingsAppBlocked()
    Returns built-in android settings application state.
    abstract boolean isUninstallBlocked(String packageName)
    Returns the given AppControlItem uninstall blocked state.
    abstract boolean removeAppControlItem(AppControlItem item)
    Removes a given AppControlItem.
    abstract boolean removeBlackPermission(String blackPermission)
    Removes the permission from black permission list.
    abstract boolean removeBlockedPermission(String packageName, String blockedPermission)
    Removes the blocked permission from given application blocked permission list.
    abstract boolean setClearDataBlocked(String packageName, boolean state)
    Sets the given AppControlItem clear data blocked state.
    abstract boolean setForceStopBlocked(String packageName, boolean state)
    Sets the given AppControlItem force stop control.
    abstract boolean setNetworkBlocked(String packageName, boolean state)
    Sets the given AppControlItem network blocked state.
    abstract boolean setPackageBlocked(String packageName, boolean state)
    Sets the given AppControlItem package blocked state.
    abstract boolean setSettingsAppBlocked(boolean state)
    Blocks built-in android settings application completely.
    abstract boolean setUninstallBlocked(String packageName, boolean state)
    Sets the given AppControlItem uninstall blocked state.

    Public Methods

    public abstract boolean addAppControlItem (AppControlItem item)

    Added in API level 1

    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

    public abstract boolean addBlackPermission (String blackPermission)

    Added in API level 1

    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

    public abstract boolean addBlockedPermission (String packageName, String blockedPermission)

    Added in API level 1

    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

    public abstract boolean clearAppControlItems ()

    Added in API level 1

    Clears all AppControlItems. 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

    public abstract boolean clearBlackPermissions ()

    Added in API level 1

    Clears the all black permissions.

    Returns
    boolean true if the operation succeeds else false
    Throws
    AfexException

    public abstract boolean clearBlockedPermissions (String packageName)

    Added in API level 1

    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

    public abstract AppControlItem getAppControlItem (String packageName)

    Added in API level 1

    Returns a given packageName's AppControlItem.

    Parameters
    packageName String: Application package name
    Returns
    AppControlItem AppControlItem if exists else null
    Throws
    AfexException

    public abstract List<AppControlItem> getAppControlItemList ()

    Added in API level 1

    Returns all AppControlItem list.

    Returns
    List<AppControlItem> Populated or empty AppControlItem list
    Throws
    AfexException

    public abstract List<String> getBlackPermissionList ()

    Added in API level 1

    Returns the black permission list.

    Returns
    List<String> Black Manifest.permission list
    Throws
    AfexException

    public abstract List<String> getBlockedPermissionList (String packageName)

    Added in API level 1

    Returns the given application's blocked permissions list.

    Parameters
    packageName String: Application package name
    Returns
    List<String> Blocked Manifest.permission list
    Throws
    AfexException

    public abstract List<String> getControllableBuiltinAppList ()

    Added in API level 1

    Returns the controllable builtin app list.

    Returns
    List<String> Controllable builtin app list
    Throws
    AfexException

    public abstract List<String> getControllableExternalAppList ()

    Added in API level 1

    Returns the controllable external app list.

    Returns
    List<String> Controllable external app list
    Throws
    AfexException

    public abstract boolean hasAppControlItem (String packageName)

    Added in API level 1

    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

    public abstract boolean isClearDataBlocked (String packageName)

    Added in API level 1

    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

    public abstract boolean isForceStopBlocked (String packageName)

    Added in API level 1

    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

    public abstract boolean isNetworkBlocked (String packageName)

    Added in API level 1

    Returns the given AppControlItem network blocked state.

    Parameters
    packageName String: Application package name
    Returns
    boolean true if network is blocked else false
    Throws
    AfexException

    public abstract boolean isPackageBlocked (String packageName)

    Added in API level 1

    Returns the given AppControlItem package blocked state.

    Parameters
    packageName String: Application package name
    Returns
    boolean true if package is blocked else false
    Throws
    AfexException

    public abstract boolean isSettingsAppBlocked ()

    Added in API level 1

    Returns built-in android settings application state.

    Returns
    boolean true if settings is blocked else false
    Throws
    AfexException

    public abstract boolean isUninstallBlocked (String packageName)

    Added in API level 1

    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

    public abstract boolean removeAppControlItem (AppControlItem item)

    Added in API level 1

    Removes a given AppControlItem.

    Parameters
    item AppControlItem: AppControlItem
    Returns
    boolean true if the operation succeeds else false
    Throws
    AfexException

    public abstract boolean removeBlackPermission (String blackPermission)

    Added in API level 1

    Removes the permission from black permission list.

    Parameters
    blackPermission String: Black Manifest.permission
    Returns
    boolean true if the operation succeeds else false
    Throws
    AfexException

    public abstract boolean removeBlockedPermission (String packageName, String blockedPermission)

    Added in API level 1

    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

    public abstract boolean setClearDataBlocked (String packageName, boolean state)

    Added in API level 1

    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

    public abstract boolean setForceStopBlocked (String packageName, boolean state)

    Added in API level 1

    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

    public abstract boolean setNetworkBlocked (String packageName, boolean state)

    Added in API level 1

    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

    public abstract boolean setPackageBlocked (String packageName, boolean state)

    Added in API level 1

    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

    public abstract boolean setSettingsAppBlocked (boolean state)

    Added in API level 1

    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

    public abstract boolean setUninstallBlocked (String packageName, boolean state)

    Added in API level 1

    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