diff options
author | Suchi Amalapurapu <asuchitra@google.com> | 2010-03-03 09:45:24 -0800 |
---|---|---|
committer | Suchi Amalapurapu <asuchitra@google.com> | 2010-03-03 14:06:10 -0800 |
commit | 9b10ef5fe85e9d29721ff0cd15161f960d38a8db (patch) | |
tree | a6830aad34d62273b02f0e3dbaa054dd7ec7c270 /tests | |
parent | a034cd3e15b6626be03e60f2d6a0f929dcb950d9 (diff) | |
download | frameworks_base-9b10ef5fe85e9d29721ff0cd15161f960d38a8db.zip frameworks_base-9b10ef5fe85e9d29721ff0cd15161f960d38a8db.tar.gz frameworks_base-9b10ef5fe85e9d29721ff0cd15161f960d38a8db.tar.bz2 |
Rework the way PackageManager binds to default container service.
Clean up stale containers when enabling/disabling packages on sdcard.
Check the path of packages which are being enabled.
Make sure gc's are done prior to destroying containers when moving applicati
as well as enabling/disabling packages for sdcard mount status changes.
Some miscellaneous issues
Remove hack to avoid renaming containers.
Fix test with forward locked apps
Remove adding container id to asec list when renaming
Some cosmetic changes to DefaultContainerService
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java b/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java index 5e3895a..50eca02 100755 --- a/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java +++ b/tests/AndroidTests/src/com/android/unit_tests/PackageManagerTests.java @@ -263,6 +263,9 @@ public class PackageManagerTests extends AndroidTestCase { if (expInstallLocation == PackageInfo.INSTALL_LOCATION_PREFER_EXTERNAL) { return true; } + if (expInstallLocation == PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY) { + return false; + } // TODO Out of memory checks here. boolean checkSd = false; int setLoc = 0; @@ -403,7 +406,7 @@ public class PackageManagerTests extends AndroidTestCase { return ip; } finally { if (cleanUp) { - //cleanUpInstall(ip); + cleanUpInstall(ip); } } } @@ -931,9 +934,9 @@ public class PackageManagerTests extends AndroidTestCase { public void testManifestInstallLocationFwdLockedSdcard() { installFromRawResource("install.apk", R.raw.install_loc_sdcard, - PackageManager.INSTALL_FORWARD_LOCK, true, true, - PackageManager.INSTALL_FAILED_INVALID_INSTALL_LOCATION, - PackageInfo.INSTALL_LOCATION_AUTO); + PackageManager.INSTALL_FORWARD_LOCK, true, false, + -1, + PackageInfo.INSTALL_LOCATION_INTERNAL_ONLY); } public void xxxtestClearAllSecureContainers() { @@ -1050,6 +1053,21 @@ public class PackageManagerTests extends AndroidTestCase { } } + private int getInstallLoc() { + boolean userSetting = false; + int origDefaultLoc = PackageInfo.INSTALL_LOCATION_AUTO; + try { + userSetting = Settings.System.getInt(mContext.getContentResolver(), Settings.System.SET_INSTALL_LOCATION) != 0; + origDefaultLoc = Settings.System.getInt(mContext.getContentResolver(), Settings.System.DEFAULT_INSTALL_LOCATION); + } catch (SettingNotFoundException e1) { + } + return origDefaultLoc; + } + + private void setInstallLoc(int loc) { + Settings.System.putInt(mContext.getContentResolver(), + Settings.System.DEFAULT_INSTALL_LOCATION, loc); + } /* * Utility function that reads a apk bundled as a raw resource * copies it into own data directory and invokes @@ -1058,6 +1076,8 @@ public class PackageManagerTests extends AndroidTestCase { */ public void moveFromRawResource(int installFlags, int moveFlags, int expRetCode) { + int origDefaultLoc = getInstallLoc(); + setInstallLoc(PackageInfo.INSTALL_LOCATION_AUTO); // Install first InstallParams ip = sampleInstallFromRawResource(installFlags, false); ApplicationInfo oldAppInfo = null; @@ -1091,6 +1111,8 @@ public class PackageManagerTests extends AndroidTestCase { failStr("Failed with exception : " + e); } finally { cleanUpInstall(ip); + // Restore default install location + setInstallLoc(origDefaultLoc); } } |