diff options
author | Suchi Amalapurapu <asuchitra@google.com> | 2009-10-29 19:26:46 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-10-29 19:26:46 -0700 |
commit | a7bbedca97498e75b32c6f6ca4afe56d4cf481f7 (patch) | |
tree | 649e0928caf63ead3fa846935f2d76d7e55c0d98 /core/java/android/content | |
parent | 56725939b117f7ee71e7fdaf1c8bf865d9e377ab (diff) | |
parent | 22dad5928d1d1f2c791616d9d6ab3a3172cec62e (diff) | |
download | frameworks_base-a7bbedca97498e75b32c6f6ca4afe56d4cf481f7.zip frameworks_base-a7bbedca97498e75b32c6f6ca4afe56d4cf481f7.tar.gz frameworks_base-a7bbedca97498e75b32c6f6ca4afe56d4cf481f7.tar.bz2 |
am 22dad592: Merge change I6cae32c7 into eclair
Merge commit '22dad5928d1d1f2c791616d9d6ab3a3172cec62e' into eclair-mr2
* commit '22dad5928d1d1f2c791616d9d6ab3a3172cec62e':
When upgrading packages with shared user ids make sure we are eliminating
Diffstat (limited to 'core/java/android/content')
-rw-r--r-- | core/java/android/content/pm/PackageParser.java | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/core/java/android/content/pm/PackageParser.java b/core/java/android/content/pm/PackageParser.java index 54015c9..b798bde 100644 --- a/core/java/android/content/pm/PackageParser.java +++ b/core/java/android/content/pm/PackageParser.java @@ -201,11 +201,11 @@ public class PackageParser { } pi.activities = new ActivityInfo[num]; } - for (int i=0; i<N; i++) { + for (int i=0, j=0; i<N; i++) { final Activity activity = p.activities.get(i); if (activity.info.enabled || (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) { - pi.activities[i] = generateActivityInfo(p.activities.get(i), flags); + pi.activities[j++] = generateActivityInfo(p.activities.get(i), flags); } } } @@ -222,11 +222,11 @@ public class PackageParser { } pi.receivers = new ActivityInfo[num]; } - for (int i=0; i<N; i++) { + for (int i=0, j=0; i<N; i++) { final Activity activity = p.receivers.get(i); if (activity.info.enabled || (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) { - pi.receivers[i] = generateActivityInfo(p.receivers.get(i), flags); + pi.receivers[j++] = generateActivityInfo(p.receivers.get(i), flags); } } } @@ -243,11 +243,11 @@ public class PackageParser { } pi.services = new ServiceInfo[num]; } - for (int i=0; i<N; i++) { + for (int i=0, j=0; i<N; i++) { final Service service = p.services.get(i); if (service.info.enabled || (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) { - pi.services[i] = generateServiceInfo(p.services.get(i), flags); + pi.services[j++] = generateServiceInfo(p.services.get(i), flags); } } } @@ -264,11 +264,11 @@ public class PackageParser { } pi.providers = new ProviderInfo[num]; } - for (int i=0; i<N; i++) { + for (int i=0, j=0; i<N; i++) { final Provider provider = p.providers.get(i); if (provider.info.enabled || (flags&PackageManager.GET_DISABLED_COMPONENTS) != 0) { - pi.providers[i] = generateProviderInfo(p.providers.get(i), flags); + pi.providers[j++] = generateProviderInfo(p.providers.get(i), flags); } } } @@ -300,12 +300,10 @@ public class PackageParser { } } if ((flags&PackageManager.GET_SIGNATURES) != 0) { - if (p.mSignatures != null) { - int N = p.mSignatures.length; - if (N > 0) { - pi.signatures = new Signature[N]; - System.arraycopy(p.mSignatures, 0, pi.signatures, 0, N); - } + int N = (p.mSignatures != null) ? p.mSignatures.length : 0; + if (N > 0) { + pi.signatures = new Signature[N]; + System.arraycopy(p.mSignatures, 0, pi.signatures, 0, N); } } return pi; |