diff options
author | Kenny Root <kroot@google.com> | 2012-10-18 10:58:36 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2012-10-18 15:12:09 -0700 |
commit | a3e90798b7ad3ed62e5b31842c699b2f98bd457b (patch) | |
tree | 01e322a27dfafaf0eb4938a095f3f7f32ed03d3e /core/tests/coretests | |
parent | 341aa8e0e8753ddb5eca22311e7d671e0518f326 (diff) | |
download | frameworks_base-a3e90798b7ad3ed62e5b31842c699b2f98bd457b.zip frameworks_base-a3e90798b7ad3ed62e5b31842c699b2f98bd457b.tar.gz frameworks_base-a3e90798b7ad3ed62e5b31842c699b2f98bd457b.tar.bz2 |
Robustly add symlink and add for non-primary users
Amazingly, some apps still don't use the nativeLibraryPath. So add a lib
symlink for non-primary users to fix that.
Also, there was an error when the symlink existed that it would give up.
This shouldn't really happen, but in that case, just remove it and
create a new one to be safe.
Also, move the downgrade code to the appropriate place. This downgrade
case triggered the above symlink existing bug.
Bug: 7318366
Bug: 7371571
Change-Id: Ia175b36d98f00bdc2f2433b909aafd524eb34d15
Diffstat (limited to 'core/tests/coretests')
-rw-r--r-- | core/tests/coretests/apks/install_bad_dex/AndroidManifest.xml | 2 | ||||
-rwxr-xr-x | core/tests/coretests/src/android/content/pm/PackageManagerTests.java | 27 |
2 files changed, 16 insertions, 13 deletions
diff --git a/core/tests/coretests/apks/install_bad_dex/AndroidManifest.xml b/core/tests/coretests/apks/install_bad_dex/AndroidManifest.xml index fe4dd8e..76f0fe5 100644 --- a/core/tests/coretests/apks/install_bad_dex/AndroidManifest.xml +++ b/core/tests/coretests/apks/install_bad_dex/AndroidManifest.xml @@ -14,7 +14,7 @@ limitations under the License. --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.frameworks.coretests.install_loc"> + package="com.android.frameworks.coretests.install_bad_dex"> <application android:hasCode="true"> <activity diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java index 56070ee..04f8009 100755 --- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java +++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java @@ -981,19 +981,22 @@ public class PackageManagerTests extends AndroidTestCase { try { DeleteObserver observer = new DeleteObserver(pkgName); - getPm().deletePackage(pkgName, observer, flags); + getPm().deletePackage(pkgName, observer, flags | PackageManager.DELETE_ALL_USERS); observer.waitForCompletion(MAX_WAIT_TIME); assertUninstalled(info); // Verify we received the broadcast - long waitTime = 0; - while ((!receiver.isDone()) && (waitTime < MAX_WAIT_TIME)) { - receiver.wait(WAIT_TIME_INCR); - waitTime += WAIT_TIME_INCR; - } - if (!receiver.isDone()) { - throw new Exception("Timed out waiting for PACKAGE_REMOVED notification"); + // TODO replace this with a CountDownLatch + synchronized (receiver) { + long waitTime = 0; + while ((!receiver.isDone()) && (waitTime < MAX_WAIT_TIME)) { + receiver.wait(WAIT_TIME_INCR); + waitTime += WAIT_TIME_INCR; + } + if (!receiver.isDone()) { + throw new Exception("Timed out waiting for PACKAGE_REMOVED notification"); + } } return receiver.received; } finally { @@ -1331,7 +1334,7 @@ public class PackageManagerTests extends AndroidTestCase { } DeleteObserver observer = new DeleteObserver(packageName); - getPm().deletePackage(packageName, observer, 0); + getPm().deletePackage(packageName, observer, PackageManager.DELETE_ALL_USERS); observer.waitForCompletion(MAX_WAIT_TIME); try { @@ -1357,7 +1360,7 @@ public class PackageManagerTests extends AndroidTestCase { if (info != null) { DeleteObserver observer = new DeleteObserver(pkgName); - getPm().deletePackage(pkgName, observer, 0); + getPm().deletePackage(pkgName, observer, PackageManager.DELETE_ALL_USERS); observer.waitForCompletion(MAX_WAIT_TIME); assertUninstalled(info); } @@ -3126,7 +3129,7 @@ public class PackageManagerTests extends AndroidTestCase { int rawResId = apk2; Uri packageURI = getInstallablePackage(rawResId, outFile); PackageParser.Package pkg = parsePackage(packageURI); - getPm().deletePackage(pkg.packageName, null, 0); + getPm().deletePackage(pkg.packageName, null, PackageManager.DELETE_ALL_USERS); // Check signatures now int match = mContext.getPackageManager().checkSignatures( ip1.pkg.packageName, pkg.packageName); @@ -3265,7 +3268,7 @@ public class PackageManagerTests extends AndroidTestCase { PackageManager pm = mContext.getPackageManager(); // Delete app2 PackageParser.Package pkg = getParsedPackage(apk2Name, apk2); - getPm().deletePackage(pkg.packageName, null, 0); + getPm().deletePackage(pkg.packageName, null, PackageManager.DELETE_ALL_USERS); // Check signatures now int match = mContext.getPackageManager().checkSignatures( ip1.pkg.packageName, pkg.packageName); |