diff options
author | Adam Lesinski <adamlesinski@google.com> | 2017-11-07 17:08:07 -0800 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2017-11-09 14:57:49 -0800 |
commit | 490595a5fc1c3618dbbc2da5d421d10c025fabac (patch) | |
tree | 95b9f4a854da15241e2acc4b379693a9320c63f5 /tests/FeatureSplit | |
parent | 2dd3953ae00068a71da9f0a0d4e2fb9d8517424c (diff) |
AAPT2: Workaround for feature splits without namespacing
Android Instant Apps in its current iteration does not use namespaces,
but due to limitations on the Android resource runtime, needs to make
it look like it does.
This is due to a bug that treats any package ID that's not 0x01 or 0x7F
as a shared library. Shared libraries require unique package names.
As a workaround, and since Android Instant Apps can not have a feature
depend on another feature, we can alter the resource package name of a
feature split just before writing it out to disk. This avoids using a
unique package name while linking, thereby avoiding namespace issues.
Bug: 68820737
Test: manual
Change-Id: Ic553ed42656436bbb949393d0248ee7bb9d37860
Diffstat (limited to 'tests/FeatureSplit')
-rw-r--r-- | tests/FeatureSplit/feature1/Android.mk | 2 | ||||
-rw-r--r-- | tests/FeatureSplit/feature1/AndroidManifest.xml | 4 | ||||
-rw-r--r-- | tests/FeatureSplit/feature1/res/values/values.xml | 2 | ||||
-rw-r--r-- | tests/FeatureSplit/feature2/Android.mk | 2 | ||||
-rw-r--r-- | tests/FeatureSplit/feature2/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | tests/FeatureSplit/feature2/res/values/values.xml | 2 |
6 files changed, 7 insertions, 7 deletions
diff --git a/tests/FeatureSplit/feature1/Android.mk b/tests/FeatureSplit/feature1/Android.mk index b3ea97b03d5d..e6ba5c2d04c9 100644 --- a/tests/FeatureSplit/feature1/Android.mk +++ b/tests/FeatureSplit/feature1/Android.mk @@ -26,6 +26,6 @@ LOCAL_APK_LIBRARIES := FeatureSplitBase LOCAL_RES_LIBRARIES := FeatureSplitBase LOCAL_AAPT_FLAGS += --package-id 0x80 -LOCAL_AAPT_FLAGS += --rename-manifest-package com.android.test.split.feature +LOCAL_AAPT_FLAGS += --custom-package com.android.test.split.feature.one include $(BUILD_PACKAGE) diff --git a/tests/FeatureSplit/feature1/AndroidManifest.xml b/tests/FeatureSplit/feature1/AndroidManifest.xml index 4e7d15102a6e..b87361faac62 100644 --- a/tests/FeatureSplit/feature1/AndroidManifest.xml +++ b/tests/FeatureSplit/feature1/AndroidManifest.xml @@ -15,13 +15,13 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.test.split.feature.one" + package="com.android.test.split.feature" featureSplit="feature1"> <uses-sdk android:minSdkVersion="21" /> <application> - <activity android:name=".One" android:label="Feature One"> + <activity android:name=".one.One" android:label="Feature One"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/tests/FeatureSplit/feature1/res/values/values.xml b/tests/FeatureSplit/feature1/res/values/values.xml index 0e3e73c32480..7d58865b546e 100644 --- a/tests/FeatureSplit/feature1/res/values/values.xml +++ b/tests/FeatureSplit/feature1/res/values/values.xml @@ -20,7 +20,7 @@ <integer name="test_integer2">200</integer> <color name="test_color2">#00ff00</color> <string-array name="string_array2"> - <item>@*com.android.test.split.feature:string/app_title</item> + <item>@string/app_title</item> </string-array> </resources> diff --git a/tests/FeatureSplit/feature2/Android.mk b/tests/FeatureSplit/feature2/Android.mk index e2fd90384538..c8e860942fa3 100644 --- a/tests/FeatureSplit/feature2/Android.mk +++ b/tests/FeatureSplit/feature2/Android.mk @@ -26,6 +26,6 @@ LOCAL_APK_LIBRARIES := FeatureSplitBase LOCAL_RES_LIBRARIES := FeatureSplitBase LOCAL_AAPT_FLAGS += --package-id 0x81 -LOCAL_AAPT_FLAGS += --rename-manifest-package com.android.test.split.feature +LOCAL_AAPT_FLAGS += --custom-package com.android.test.split.feature.two include $(BUILD_PACKAGE) diff --git a/tests/FeatureSplit/feature2/AndroidManifest.xml b/tests/FeatureSplit/feature2/AndroidManifest.xml index bfe6f38201bd..abd0b5eb6933 100644 --- a/tests/FeatureSplit/feature2/AndroidManifest.xml +++ b/tests/FeatureSplit/feature2/AndroidManifest.xml @@ -15,7 +15,7 @@ --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.test.split.feature.two" + package="com.android.test.split.feature" featureSplit="feature2"> <uses-sdk android:minSdkVersion="21" /> diff --git a/tests/FeatureSplit/feature2/res/values/values.xml b/tests/FeatureSplit/feature2/res/values/values.xml index 2fa6f907b8ab..af5ed1b79b26 100644 --- a/tests/FeatureSplit/feature2/res/values/values.xml +++ b/tests/FeatureSplit/feature2/res/values/values.xml @@ -18,7 +18,7 @@ <integer name="test_integer3">300</integer> <color name="test_color3">#0000ff</color> <string-array name="string_array3"> - <item>@*com.android.test.split.feature:string/app_title</item> + <item>@string/app_title</item> </string-array> </resources> |