summaryrefslogtreecommitdiffstats
path: root/core/java/android/content
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-06-07 16:53:59 -0700
committerDianne Hackborn <hackbod@google.com>2012-06-07 16:57:57 -0700
commitd0c5f515c05d05c9d24971695337daf9d6ce409c (patch)
treebce8b771249be92852eb2914c0d8927ee4ab18ab /core/java/android/content
parent0646411cbd91039e843c0f3067ea0a379176978a (diff)
downloadframeworks_base-d0c5f515c05d05c9d24971695337daf9d6ce409c.zip
frameworks_base-d0c5f515c05d05c9d24971695337daf9d6ce409c.tar.gz
frameworks_base-d0c5f515c05d05c9d24971695337daf9d6ce409c.tar.bz2
Fix issue #6295373: "Package com.google.android.apps.authenticator2 has...
...mismatched uid: X on disk, Y in settings" errors on Froyo and Gingerbread Deal more gracefully with the uid changing in three ways: 1. If the uid on disk has become root, then have installd change it to the application's uid. This is to correct a potential case where installd was interrupted while linking or unlinking the libs dir, during which it temporarily changes the owner of the dir to root so that a malicious app can not get in its way. So if the uid on disk has become root, we assume we can safely just change it back to the correct uid. 2. When scaning packages at boot, use the same "delete and rebuild data directory" code for third party applications as we have for system applications. This allows us to at least end up in a state where the app will run, even if its data is lost. 3. But we really don't want to get in to case 2, so if an application update is being installed and we find that the uid we now have for the app is different than the one on disk, fail the update. This will protect against for example a developer changing the sharedUserId of their app and getting into this bad state. Bug: 6295373 Change-Id: Ic802fdd818ac62449ff3c61d1fff1aa4d4942f39
Diffstat (limited to 'core/java/android/content')
-rw-r--r--core/java/android/content/pm/PackageManager.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java
index bcdd012..6de69b0 100644
--- a/core/java/android/content/pm/PackageManager.java
+++ b/core/java/android/content/pm/PackageManager.java
@@ -520,6 +520,14 @@ public abstract class PackageManager {
public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23;
/**
+ * Installation return code: this is passed to the {@link IPackageInstallObserver} by
+ * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
+ * the new package is assigned a different UID than it previously held.
+ * @hide
+ */
+ public static final int INSTALL_FAILED_UID_CHANGED = -24;
+
+ /**
* Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
* {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
* if the parser was given a path that is not a file, or does not end with the expected