diff options
| author | 2012-05-07 16:44:48 +0900 | |
|---|---|---|
| committer | 2012-05-07 16:44:48 +0900 | |
| commit | 2d91007e051f8fe90238c26a3509c76ea56a992b (patch) | |
| tree | 5351076282518029c580df88fab53694a87b799e | |
| parent | a10cc893f7e1f21783ea60c50a49401181611027 (diff) | |
Avoid adding FORWARD_LOCK flag to an updated system app
Consider the following case:
1. An app exists in /system/app or /vendor/app. (i.e, it's a system app)
2. If the app would be updated as a forward-lock app by downloading from
market(google play), then it would be installed in /data/app-private.
3. Moreover, if it would be updated by the whole system image (i.e, FOTA
or something like that), then the app would be applied a FORWARD_LOCK
flag.
The app SHOULD NOT have a FORWARD_LCOK flag. Because the resource path
of such app does not refer to the proper resources to access.
Change-Id: I0750f69a93a3115f4201029796b598507de3555f
| -rwxr-xr-x[-rw-r--r--] | services/java/com/android/server/pm/PackageManagerService.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/services/java/com/android/server/pm/PackageManagerService.java b/services/java/com/android/server/pm/PackageManagerService.java index 938d93a74df9..f010f87dee6c 100644..100755 --- a/services/java/com/android/server/pm/PackageManagerService.java +++ b/services/java/com/android/server/pm/PackageManagerService.java @@ -2918,10 +2918,13 @@ public class PackageManagerService extends IPackageManager.Stub { return null; } // The apk is forward locked (not public) if its code and resources - // are kept in different files. + // are kept in different files. (except for app in either system or + // vendor path). // TODO grab this value from PackageSettings - if (ps != null && !ps.codePath.equals(ps.resourcePath)) { - parseFlags |= PackageParser.PARSE_FORWARD_LOCK; + if ((parseFlags & PackageParser.PARSE_IS_SYSTEM_DIR) == 0) { + if (ps != null && !ps.codePath.equals(ps.resourcePath)) { + parseFlags |= PackageParser.PARSE_FORWARD_LOCK; + } } String codePath = null; |