Native libraries on SD

* Add native library tests during package move

* Fix omission that let PackageSettings and ApplicationInfo get out of
  sync.

Change-Id: Ic4958f971cb2c9cfd270522fdc120b4031c1124a
This commit is contained in:
Kenny Root
2010-08-30 15:12:24 -07:00
parent 858bb4f66e
commit 0ac83f5a7c
2 changed files with 3 additions and 0 deletions

View File

@@ -1392,8 +1392,10 @@ public class PackageManagerTests extends AndroidTestCase {
assertNotNull(info);
if ((moveFlags & PackageManager.MOVE_INTERNAL) != 0) {
assertTrue((info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) == 0);
assertTrue(info.nativeLibraryDir.startsWith(info.dataDir));
} else if ((moveFlags & PackageManager.MOVE_EXTERNAL_MEDIA) != 0){
assertTrue((info.flags & ApplicationInfo.FLAG_EXTERNAL_STORAGE) != 0);
assertTrue(info.nativeLibraryDir.startsWith(SECURE_CONTAINERS_PREFIX));
}
}
} catch (NameNotFoundException e) {

View File

@@ -9833,6 +9833,7 @@ class PackageManagerService extends IPackageManager.Stub {
ps.codePathString = ps.codePath.getPath();
ps.resourcePath = new File(pkg.applicationInfo.publicSourceDir);
ps.resourcePathString = ps.resourcePath.getPath();
ps.nativeLibraryPathString = newNativePath;
// Set the application info flag correctly.
if ((mp.flags & PackageManager.INSTALL_EXTERNAL) != 0) {
pkg.applicationInfo.flags |= ApplicationInfo.FLAG_EXTERNAL_STORAGE;