public class AppManagementCtrl
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BUNDLE_ERROR_CODE |
static java.lang.String |
BUNDLE_ERROR_MSG |
static java.lang.String |
BUNDLE_RESULT_APP_INFO |
static java.lang.String |
BUNDLE_RESULT_APP_NAME_LIST |
static java.lang.String |
BUNDLE_RESULT_CMD |
static java.lang.String |
BUNDLE_RESULT_PKG_NAME_LIST |
static java.lang.String |
BUNDLE_RESULT_SERVICEINFO_NAME_LIST |
static int |
RESULT_CODE_ERROR |
static int |
RESULT_CODE_SUCCESS |
| Constructor and Description |
|---|
AppManagementCtrl(android.content.Context context)
Instantiates a new AppManagementCtrl.
|
| Modifier and Type | Method and Description |
|---|---|
android.os.Bundle |
activateApp(java.lang.String pkgName)
Activate an app on device.
|
android.os.Bundle |
activateAppWithClassName(java.lang.String pkgName,
java.lang.String className)
Activate an app on device.
|
android.os.Bundle |
clearAppData(java.lang.String pkgName)
Clear the storage data and the cache data of the app.
|
android.os.Bundle |
clearDefaultApps(java.lang.String[] packages)
Clear the settings of the preferred apps by giving the package name list
|
android.os.Bundle |
clearDefaultApps(java.lang.String action,
java.lang.String[] categories)
Clear the settings of the preferred apps by giving the filter (action and categories)
|
android.os.Bundle |
deactivateApp(java.lang.String pkgName)
Deactivate an app on device.
|
android.os.Bundle |
disableApp(java.lang.String pkgName)
Disable an app on device.
|
android.os.Bundle |
enableApp(java.lang.String pkgName)
Enable an app on device.
|
android.os.Bundle |
getAllAppNameList()
Get all apps list with their app name (Only return apps which have app label)
|
android.os.Bundle |
getAllPkgNameList()
Get all apps list with their package name
|
android.os.Bundle |
getAppInfoByAppName(java.lang.String appName)
Get the app version name and version code by the app name (App label)
|
android.os.Bundle |
getAppInfoByPkgName(java.lang.String pkgName)
Get the app version name and version code by the package name
|
java.lang.String |
getAppPackageName(java.lang.String apkPath) |
android.os.Bundle |
getBuiltinSystemAppNameList()
Get the built-in system apps list with their app name (Only return apps which have app label)
|
android.os.Bundle |
getBuiltinSystemPkgNameList()
Get the built-in system apps list with their package name
|
android.os.Bundle |
getDisabledAppNameList()
Get the disabled apps list with their app name (Only return apps which have app label)
|
android.os.Bundle |
getDisabledPkgNameList()
Get the disabled apps list with their package name
|
android.os.Bundle |
getInstallAppNameList()
Get the installed apps list with their app name (Only return apps which have app label)
|
android.os.Bundle |
getInstallPkgNameList()
Get the installed apps list with their package name
|
android.os.Bundle |
getRunningAppNameList()
Get the current running apps list with their app name (Only return apps which have app label)
|
android.os.Bundle |
getRunningPkgNameList()
Get the current running apps list with their package name
|
android.os.Bundle |
grantAppPermission(java.lang.String packageName,
java.lang.String[] permissions)
grant application permission (packageName)
|
android.os.Bundle |
installApp(java.lang.String apkFilePath,
java.lang.String pkgName)
Install an application by the apk that user mention tha apk file path.
|
android.os.Bundle |
installApp(java.lang.String apkFilePath,
java.lang.String pkgName,
java.lang.String[] permissions)
Install an application by the apk that user mention tha apk file path.
|
android.os.Bundle |
osUpdate(java.lang.String updateZipPath)
Update device's OS by the zip file
|
android.os.Bundle |
queryIntentService(java.lang.String action,
java.lang.String packageName)
query intent service with action and packageName
|
android.os.Bundle |
removeApp(java.lang.String pkgName)
Remove an app from device
|
android.os.Bundle |
resolveActivity(java.lang.String action,
java.lang.String[] categories,
java.lang.String packageName)
resolve the Activity Name with action, categories and packageName
|
android.os.Bundle |
runSysCmd(java.lang.String command)
Run shell command with system user
|
android.os.Bundle |
setDefaultApp(java.lang.String action,
java.lang.String[] categories,
java.lang.String packageName,
java.lang.String activityName)
Set the preferred app with the given filter (action and categories)
|
public static final java.lang.String BUNDLE_ERROR_CODE
public static final java.lang.String BUNDLE_ERROR_MSG
public static final java.lang.String BUNDLE_RESULT_APP_NAME_LIST
public static final java.lang.String BUNDLE_RESULT_PKG_NAME_LIST
public static final java.lang.String BUNDLE_RESULT_SERVICEINFO_NAME_LIST
public static final java.lang.String BUNDLE_RESULT_CMD
public static final java.lang.String BUNDLE_RESULT_APP_INFO
public static final int RESULT_CODE_ERROR
public static final int RESULT_CODE_SUCCESS
public AppManagementCtrl(android.content.Context context)
context - the contextpublic java.lang.String getAppPackageName(java.lang.String apkPath)
public android.os.Bundle installApp(java.lang.String apkFilePath,
java.lang.String pkgName)
apkFilePath - The path where is the apk file at.pkgName - The package name of the apkpublic android.os.Bundle installApp(java.lang.String apkFilePath,
java.lang.String pkgName,
java.lang.String[] permissions)
apkFilePath - The path where is the apk file at.pkgName - The package name of the apkpermissions - permissions to be granted, null for all permissionspublic android.os.Bundle removeApp(java.lang.String pkgName)
pkgName - The package name of the app that you want to remove.public android.os.Bundle activateApp(java.lang.String pkgName)
pkgName - The package name of the app that you want to activate.public android.os.Bundle activateAppWithClassName(java.lang.String pkgName,
java.lang.String className)
pkgName - The package name of the app that you want to activate.className - The Activity class name of the app that you want to activate.public android.os.Bundle deactivateApp(java.lang.String pkgName)
pkgName - The package name of the app that you want to deactivate.public android.os.Bundle enableApp(java.lang.String pkgName)
pkgName - The package name of the app that you want to enable.public android.os.Bundle disableApp(java.lang.String pkgName)
pkgName - The package name of the app that you want to disable.public android.os.Bundle clearAppData(java.lang.String pkgName)
pkgName - The package name of the app that you want to clear. PackageName Array, (split with , )
(example: com.ute.eu.ELauncher,com.unitech.unote)public android.os.Bundle getRunningAppNameList()
public android.os.Bundle getRunningPkgNameList()
public android.os.Bundle getInstallAppNameList()
public android.os.Bundle getInstallPkgNameList()
public android.os.Bundle getBuiltinSystemAppNameList()
public android.os.Bundle getBuiltinSystemPkgNameList()
public android.os.Bundle getDisabledAppNameList()
public android.os.Bundle getDisabledPkgNameList()
public android.os.Bundle getAllAppNameList()
public android.os.Bundle getAllPkgNameList()
public android.os.Bundle osUpdate(java.lang.String updateZipPath)
updateZipPath - The zip path of the OS OTA packpublic android.os.Bundle runSysCmd(java.lang.String command)
command - The shell commandpublic android.os.Bundle getAppInfoByAppName(java.lang.String appName)
appName - The app name that you want to get its informationpublic android.os.Bundle getAppInfoByPkgName(java.lang.String pkgName)
pkgName - The package name that you want to get its informationpublic android.os.Bundle setDefaultApp(java.lang.String action,
java.lang.String[] categories,
java.lang.String packageName,
java.lang.String activityName)
action - categories - packageName - The package name of the target appactivityName - The target activity in the packagepublic android.os.Bundle resolveActivity(java.lang.String action,
java.lang.String[] categories,
java.lang.String packageName)
action - categories - packageName - The package name of the target apppublic android.os.Bundle queryIntentService(java.lang.String action,
java.lang.String packageName)
action - packageName - The package name of the target apppublic android.os.Bundle clearDefaultApps(java.lang.String[] packages)
packages - All the package names that you want to clearpublic android.os.Bundle clearDefaultApps(java.lang.String action,
java.lang.String[] categories)
action - The action that the intent-filter needs to querycategories - The categories that the intent-filter needs to querypublic android.os.Bundle grantAppPermission(java.lang.String packageName,
java.lang.String[] permissions)
packageName - The package name of the target apppermissions - permissions to be granted, null for all permissions