use of com.morgoo.droidplugin.pm.parser.PluginPackageParser in project DroidPlugin by DroidPluginTeam.
the class IPluginManagerImpl method deleteApplicationCacheFiles.
@Override
public void deleteApplicationCacheFiles(String packageName, IPackageDataObserver observer) throws RemoteException {
boolean success = false;
try {
if (TextUtils.isEmpty(packageName)) {
return;
}
PluginPackageParser parser = mPluginCache.get(packageName);
if (parser == null) {
return;
}
ApplicationInfo applicationInfo = parser.getApplicationInfo(0);
Utils.deleteDir(new File(applicationInfo.dataDir, "caches").getName());
success = true;
} catch (Exception e) {
handleException(e);
} finally {
if (observer != null) {
observer.onRemoveCompleted(packageName, success);
}
}
}
use of com.morgoo.droidplugin.pm.parser.PluginPackageParser in project DroidPlugin by DroidPluginTeam.
the class IPluginManagerImpl method getInstalledApplications.
@Override
public List<ApplicationInfo> getInstalledApplications(int flags) throws RemoteException {
waitForReadyInner();
try {
enforcePluginFileExists();
List<ApplicationInfo> infos = new ArrayList<ApplicationInfo>(mPluginCache.size());
if (shouldNotBlockOtherInfo()) {
for (PluginPackageParser pluginPackageParser : mPluginCache.values()) {
infos.add(pluginPackageParser.getApplicationInfo(flags));
}
} else {
List<String> pkgs = mActivityManagerService.getPackageNamesByPid(Binder.getCallingPid());
for (PluginPackageParser pluginPackageParser : mPluginCache.values()) {
if (pkgs.contains(pluginPackageParser.getPackageName())) {
infos.add(pluginPackageParser.getApplicationInfo(flags));
}
}
}
return infos;
} catch (Exception e) {
handleException(e);
}
return null;
}
use of com.morgoo.droidplugin.pm.parser.PluginPackageParser in project DroidPlugin by DroidPluginTeam.
the class IPluginManagerImpl method getProviderInfo.
@Override
public ProviderInfo getProviderInfo(ComponentName className, int flags) throws RemoteException {
waitForReadyInner();
try {
String pkg = getAndCheckCallingPkg(className.getPackageName());
if (pkg != null) {
enforcePluginFileExists();
PluginPackageParser parser = mPluginCache.get(className.getPackageName());
if (parser != null) {
return parser.getProviderInfo(className, flags);
}
}
} catch (Exception e) {
handleException(e);
}
return null;
}
use of com.morgoo.droidplugin.pm.parser.PluginPackageParser in project DroidPlugin by DroidPluginTeam.
the class IPluginManagerImpl method getPackageInfo.
@Override
public PackageInfo getPackageInfo(String packageName, int flags) throws RemoteException {
waitForReadyInner();
try {
String pkg = getAndCheckCallingPkg(packageName);
if (pkg != null && !TextUtils.equals(packageName, mContext.getPackageName())) {
enforcePluginFileExists();
PluginPackageParser parser = mPluginCache.get(pkg);
if (parser != null) {
PackageInfo packageInfo = parser.getPackageInfo(flags);
if (packageInfo != null && (flags & PackageManager.GET_SIGNATURES) != 0 && packageInfo.signatures == null) {
packageInfo.signatures = mSignatureCache.get(packageName);
}
return packageInfo;
}
}
} catch (Exception e) {
handleException(e);
}
return null;
}
use of com.morgoo.droidplugin.pm.parser.PluginPackageParser in project DroidPlugin by DroidPluginTeam.
the class IPluginManagerImpl method queryPermissionsByGroup.
@Override
public List<PermissionInfo> queryPermissionsByGroup(String group, int flags) throws RemoteException {
waitForReadyInner();
try {
enforcePluginFileExists();
List<PermissionInfo> list = new ArrayList<PermissionInfo>();
if (shouldNotBlockOtherInfo()) {
for (PluginPackageParser pluginPackageParser : mPluginCache.values()) {
List<PermissionInfo> permissionInfos = pluginPackageParser.getPermissions();
for (PermissionInfo permissionInfo : permissionInfos) {
if (TextUtils.equals(permissionInfo.group, group) && !list.contains(permissionInfo)) {
list.add(permissionInfo);
}
}
}
} else {
List<String> pkgs = mActivityManagerService.getPackageNamesByPid(Binder.getCallingPid());
for (PluginPackageParser pluginPackageParser : mPluginCache.values()) {
List<PermissionInfo> permissionInfos = pluginPackageParser.getPermissions();
for (PermissionInfo permissionInfo : permissionInfos) {
if (pkgs.contains(permissionInfo.packageName) && TextUtils.equals(permissionInfo.group, group) && !list.contains(permissionInfo)) {
list.add(permissionInfo);
}
}
}
}
return list;
} catch (Exception e) {
handleException(e);
}
return null;
}
Aggregations