Be sure to include shared lib path info when dealing with agents

In particular, this ensures that on the client side the full classpath is known
and used by the class loader during execution of the agent.
This commit is contained in:
Christopher Tate
2009-09-16 10:57:21 -07:00
parent cfc7f1aaef
commit b8eb1cb79b

View File

@@ -649,11 +649,21 @@ class BackupManagerService extends IBackupManager.Stub {
int N = packages.size();
for (int a = N-1; a >= 0; a--) {
PackageInfo pkg = packages.get(a);
ApplicationInfo app = pkg.applicationInfo;
if (((app.flags&ApplicationInfo.FLAG_ALLOW_BACKUP) == 0)
|| app.backupAgentName == null
|| (mPackageManager.checkPermission(android.Manifest.permission.BACKUP_DATA,
pkg.packageName) != PackageManager.PERMISSION_GRANTED)) {
try {
ApplicationInfo app = pkg.applicationInfo;
if (((app.flags&ApplicationInfo.FLAG_ALLOW_BACKUP) == 0)
|| app.backupAgentName == null
|| (mPackageManager.checkPermission(android.Manifest.permission.BACKUP_DATA,
pkg.packageName) != PackageManager.PERMISSION_GRANTED)) {
packages.remove(a);
}
else {
// we will need the shared library path, so look that up and store it here
app = mPackageManager.getApplicationInfo(pkg.packageName,
PackageManager.GET_SHARED_LIBRARY_FILES);
pkg.applicationInfo.sharedLibraryFiles = app.sharedLibraryFiles;
}
} catch (NameNotFoundException e) {
packages.remove(a);
}
}