Loading core/tests/coretests/apks/install_uses_feature/Android.mk 0 → 100644 +11 −0 Original line number Diff line number Diff line LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-subdir-java-files) LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_uses_feature include $(BUILD_PACKAGE) core/tests/coretests/apks/install_uses_feature/AndroidManifest.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2010 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.frameworks.coretests.install_uses_feature"> <uses-feature android:name="com.android.frameworks.coretests.nonexistent" /> <application android:hasCode="false"> </application> </manifest> core/tests/coretests/apks/install_uses_feature/res/values/strings.xml 0 → 100644 +6 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Just need this dummy file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="dummy">dummy</string> </resources> core/tests/coretests/res/raw/install_uses_feature 0 → 100644 +3.08 KiB File added.No diff preview for this file type. View file core/tests/coretests/src/android/content/pm/PackageManagerTests.java +17 −0 Original line number Diff line number Diff line Loading @@ -2838,6 +2838,23 @@ public class PackageManagerTests extends AndroidTestCase { installFromRawResource("install.apk", rapk2, PackageManager.INSTALL_REPLACE_EXISTING, true, 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 testUsesFeatureUnknownFeature() { int retCode = PackageManager.INSTALL_SUCCEEDED; installFromRawResource("install.apk", R.raw.install_uses_feature, 0, true, false, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED); } /*---------- Recommended install location tests ----*/ /* * TODO's Loading Loading
core/tests/coretests/apks/install_uses_feature/Android.mk 0 → 100644 +11 −0 Original line number Diff line number Diff line LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-subdir-java-files) LOCAL_PACKAGE_NAME := FrameworkCoreTests_install_uses_feature include $(BUILD_PACKAGE)
core/tests/coretests/apks/install_uses_feature/AndroidManifest.xml 0 → 100644 +23 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2010 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.frameworks.coretests.install_uses_feature"> <uses-feature android:name="com.android.frameworks.coretests.nonexistent" /> <application android:hasCode="false"> </application> </manifest>
core/tests/coretests/apks/install_uses_feature/res/values/strings.xml 0 → 100644 +6 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Just need this dummy file to have something to build. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="dummy">dummy</string> </resources>
core/tests/coretests/res/raw/install_uses_feature 0 → 100644 +3.08 KiB File added.No diff preview for this file type. View file
core/tests/coretests/src/android/content/pm/PackageManagerTests.java +17 −0 Original line number Diff line number Diff line Loading @@ -2838,6 +2838,23 @@ public class PackageManagerTests extends AndroidTestCase { installFromRawResource("install.apk", rapk2, PackageManager.INSTALL_REPLACE_EXISTING, true, 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 testUsesFeatureUnknownFeature() { int retCode = PackageManager.INSTALL_SUCCEEDED; installFromRawResource("install.apk", R.raw.install_uses_feature, 0, true, false, retCode, PackageInfo.INSTALL_LOCATION_UNSPECIFIED); } /*---------- Recommended install location tests ----*/ /* * TODO's Loading