summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2011-01-31 18:51:56 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-31 18:51:56 -0800
commitdb569b49180621c01fa55db88ed92071aae9b3bb (patch)
tree55349e607eec987e0e51c915199d2068166f8b26
parent05437aad8e250f508e73d4ddcce9ef99393d9414 (diff)
parent6cf32312aaee6716ffd1df7098838b08d80054e4 (diff)
downloadframeworks_base-db569b49180621c01fa55db88ed92071aae9b3bb.zip
frameworks_base-db569b49180621c01fa55db88ed92071aae9b3bb.tar.gz
frameworks_base-db569b49180621c01fa55db88ed92071aae9b3bb.tar.bz2
am 6cf32312: Merge "Do not check features in PackageManagerService" into honeycomb
* commit '6cf32312aaee6716ffd1df7098838b08d80054e4': Do not check features in PackageManagerService
-rw-r--r--core/tests/coretests/res/raw/install_uses_featurebin3198 -> 3178 bytes
-rwxr-xr-xcore/tests/coretests/src/android/content/pm/PackageManagerTests.java15
-rw-r--r--services/java/com/android/server/PackageManagerService.java20
3 files changed, 12 insertions, 23 deletions
diff --git a/core/tests/coretests/res/raw/install_uses_feature b/core/tests/coretests/res/raw/install_uses_feature
index 769a246..eeeb309 100644
--- a/core/tests/coretests/res/raw/install_uses_feature
+++ b/core/tests/coretests/res/raw/install_uses_feature
Binary files differ
diff --git a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
index 0e65df5..7af64e4 100755
--- a/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
+++ b/core/tests/coretests/src/android/content/pm/PackageManagerTests.java
@@ -3098,10 +3098,19 @@ public class PackageManagerTests extends AndroidTestCase {
fail, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
}
+ /**
+ * Unknown features should be allowed to install. This prevents older phones
+ * from rejecting new packages that specify features that didn't exist when
+ * an older phone existed. All older phones are assumed to have those
+ * features.
+ * <p>
+ * Right now we allow all packages to be installed regardless of their
+ * features.
+ */
@LargeTest
- public void testUsesFeatureMissingFeature() {
- int retCode = PackageManager.INSTALL_FAILED_MISSING_FEATURE;
- installFromRawResource("install.apk", R.raw.install_uses_feature, 0, true, true, retCode,
+ public void testUsesFeatureUnknownFeature() {
+ int retCode = PackageManager.INSTALL_SUCCEEDED;
+ installFromRawResource("install.apk", R.raw.install_uses_feature, 0, true, false, retCode,
PackageInfo.INSTALL_LOCATION_UNSPECIFIED);
}
diff --git a/services/java/com/android/server/PackageManagerService.java b/services/java/com/android/server/PackageManagerService.java
index 5806de2..9ee71e8 100644
--- a/services/java/com/android/server/PackageManagerService.java
+++ b/services/java/com/android/server/PackageManagerService.java
@@ -2924,26 +2924,6 @@ class PackageManagerService extends IPackageManager.Stub {
}
}
- if (pkg.reqFeatures != null) {
- int N = pkg.reqFeatures.size();
- for (int i = 0; i < N; i++) {
- FeatureInfo fi = pkg.reqFeatures.get(i);
- if ((fi.flags & FeatureInfo.FLAG_REQUIRED) == 0) {
- // Don't care.
- continue;
- }
-
- if (fi.name != null) {
- if (mAvailableFeatures.get(fi.name) == null) {
- Slog.e(TAG, "Package " + pkg.packageName
- + " requires unavailable feature " + fi.name + "; failing!");
- mLastScanError = PackageManager.INSTALL_FAILED_MISSING_FEATURE;
- return null;
- }
- }
- }
- }
-
if (pkg.mSharedUserId != null) {
suid = mSettings.getSharedUserLP(pkg.mSharedUserId,
pkg.applicationInfo.flags, true);