flesh out ABI non-isolate feature
Non-isolate feature means that a split can access the resources,
java calls, and native calls in the other splits. This patch
focuses on adding tests for the non-isolate feature.
This patch creates tests to verify how ABI splits can access each ABI
split.
There are four roles that are jni, number_provider_a,
number_provider_b, and number_proxy. Each role has its own
apk and so file. There are four functions in jni.
* get_number_a_via_proxy
using number_proxy
* get_number_b_via_proxy
using number_proxy
* get_number_a_from_provider
using number_provider_a
* get_number_b_from_provider
using number_provider_b
The relationships between four roles are the following:
.-> number_provider_a
| ^
| |
jni +-> number_proxy
| |
| V
.-> number_provider_b
Test: TID="CtsAppSecurityHostTestCases"; \
TC="android.appsecurity.cts.SplitTests"; \
METHODS="testNativeSingle_full,testNativeSingle_instant"; \
METHODS="${METHODS},testNativeSingleNatural_full"; \
METHODS="${METHODS},testNativeSingleNatural_instant"; \
METHODS="${METHODS},testNativeAll_full"; \
METHODS="${METHODS},testNativeAll_instant"; \
METHODS="${METHODS},testNativeAllNatural_full"; \
METHODS="${METHODS},testNativeAllNatural_instant"; \
METHODS="${METHODS},testNativeSplitForEachSupportedAbi_full"; \
METHODS="${METHODS},testNativeSplitForEachSupportedAbi_instant"; \
atest "${TID}:${TC}#${METHODS}"
Bug: 173761243
Change-Id: I60610d7e56c0d1cf69bfba96b1e0cc6894273340
diff --git a/hostsidetests/appsecurity/src/android/appsecurity/cts/SplitTests.java b/hostsidetests/appsecurity/src/android/appsecurity/cts/SplitTests.java
index 8ab334b..fe773e6 100644
--- a/hostsidetests/appsecurity/src/android/appsecurity/cts/SplitTests.java
+++ b/hostsidetests/appsecurity/src/android/appsecurity/cts/SplitTests.java
@@ -72,6 +72,10 @@
private static final String APK_mips64 = "CtsSplitApp_mips64.apk";
private static final String APK_mips = "CtsSplitApp_mips.apk";
+ private static final String APK_NUMBER_PROVIDER_A = "CtsSplitApp_number_provider_a.apk";
+ private static final String APK_NUMBER_PROVIDER_B = "CtsSplitApp_number_provider_b.apk";
+ private static final String APK_NUMBER_PROXY = "CtsSplitApp_number_proxy.apk";
+
private static final String APK_DIFF_REVISION = "CtsSplitAppDiffRevision.apk";
private static final String APK_DIFF_REVISION_v7 = "CtsSplitAppDiffRevision_v7.apk";
@@ -266,6 +270,15 @@
runDeviceTests(PKG, CLASS, "testNativeRevision_sub_shouldImplementBadly");
getInstallMultiple(instant, useNaturalAbi).inheritFrom(PKG).addFile(revisionApk).run();
runDeviceTests(PKG, CLASS, "testNativeRevision_sub_shouldImplementWell");
+
+ getInstallMultiple(instant, useNaturalAbi).inheritFrom(PKG)
+ .addFile(APK_NUMBER_PROVIDER_A)
+ .addFile(APK_NUMBER_PROVIDER_B)
+ .addFile(APK_NUMBER_PROXY).run();
+ runDeviceTests(PKG, CLASS, "testNative_getNumberADirectly_shouldBeSeven");
+ runDeviceTests(PKG, CLASS, "testNative_getNumberAViaProxy_shouldBeSeven");
+ runDeviceTests(PKG, CLASS, "testNative_getNumberBDirectly_shouldBeEleven");
+ runDeviceTests(PKG, CLASS, "testNative_getNumberBViaProxy_shouldBeEleven");
}
@Test
@@ -352,8 +365,16 @@
for (String apk : ABI_TO_REVISION_APK.values()) {
instInheritFrom.addFile(apk);
}
+ instInheritFrom.addFile(APK_NUMBER_PROVIDER_A);
+ instInheritFrom.addFile(APK_NUMBER_PROVIDER_B);
+ instInheritFrom.addFile(APK_NUMBER_PROXY);
instInheritFrom.run();
runDeviceTests(PKG, CLASS, "testNativeRevision_sub_shouldImplementWell");
+
+ runDeviceTests(PKG, CLASS, "testNative_getNumberADirectly_shouldBeSeven");
+ runDeviceTests(PKG, CLASS, "testNative_getNumberAViaProxy_shouldBeSeven");
+ runDeviceTests(PKG, CLASS, "testNative_getNumberBDirectly_shouldBeEleven");
+ runDeviceTests(PKG, CLASS, "testNative_getNumberBViaProxy_shouldBeEleven");
}
/**
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/jni/Android.bp b/hostsidetests/appsecurity/test-apps/SplitApp/jni/Android.bp
new file mode 100644
index 0000000..8a60617
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/jni/Android.bp
@@ -0,0 +1,128 @@
+//
+// Copyright (C) 2021 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.
+//
+
+cc_defaults {
+ name: "split_native_defaults",
+ gtest: false,
+ cflags: [
+ "-Wall",
+ "-Werror",
+ "-Wno-unused-parameter",
+ ],
+ target: {
+ android_arm: {
+ cflags: [
+ "-D__ANDROID_ARCH__=\"armeabi-v7a\"",
+ ],
+ },
+ android_arm64: {
+ cflags: [
+ "-D__ANDROID_ARCH__=\"arm64-v8a\"",
+ ],
+ },
+ android_x86: {
+ cflags: [
+ "-D__ANDROID_ARCH__=\"x86\"",
+ ],
+ },
+ android_x86_64: {
+ cflags: [
+ "-D__ANDROID_ARCH__=\"x86_64\"",
+ ],
+ },
+ },
+ sdk_version: "current",
+}
+
+cc_defaults {
+ name: "split_number_provider_defaults",
+ defaults: ["split_native_defaults"],
+ srcs: ["number_providers.cpp"],
+}
+
+cc_test_library {
+ name: "libsplitapp_number_provider_a",
+ defaults: ["split_number_provider_defaults"],
+ cflags: [
+ "-DANDROID_SPLIT_APP_NUMBER_PROVIDER_A_SO=1",
+ ],
+}
+
+cc_test_library {
+ name: "libsplitapp_number_provider_b",
+ defaults: ["split_number_provider_defaults"],
+ cflags: [
+ "-DANDROID_SPLIT_APP_NUMBER_PROVIDER_B_SO=1",
+ ],
+}
+
+cc_test_library {
+ name: "libsplitapp_number_proxy",
+ defaults: ["split_number_provider_defaults"],
+ cflags: [
+ "-DANDROID_SPLIT_APP_NUMBER_PROXY_SO=1",
+ ],
+}
+
+
+TARGET_TEST_SUITES = [
+ "cts",
+ "general-tests",
+]
+
+/**
+ * Non-isolated split feature
+ */
+java_defaults {
+ name: "CtsSplitTestHelperApp_defaults",
+ certificate: ":cts-testkey1",
+ aaptflags: [
+ "--replace-version",
+ "--version-code 100",
+ ],
+ test_suites: TARGET_TEST_SUITES,
+}
+
+java_defaults {
+ name: "CtsSplitTestHelperApp_number_provider_defaults",
+ defaults: ["CtsSplitTestHelperApp_defaults"],
+ compile_multilib: "both",
+ test_suites: TARGET_TEST_SUITES,
+}
+
+android_test_helper_app {
+ name: "CtsSplitApp_number_provider_a",
+ defaults: ["CtsSplitTestHelperApp_number_provider_defaults"],
+ manifest: "AndroidManifest_number_provider_a.xml",
+ jni_libs: ["libsplitapp_number_provider_a"],
+ test_suites: TARGET_TEST_SUITES,
+}
+
+android_test_helper_app {
+ name: "CtsSplitApp_number_provider_b",
+ defaults: ["CtsSplitTestHelperApp_number_provider_defaults"],
+ manifest: "AndroidManifest_number_provider_b.xml",
+ jni_libs: ["libsplitapp_number_provider_b"],
+ test_suites: TARGET_TEST_SUITES,
+}
+
+android_test_helper_app {
+ name: "CtsSplitApp_number_proxy",
+ defaults: ["CtsSplitTestHelperApp_number_provider_defaults"],
+ manifest: "AndroidManifest_number_proxy.xml",
+ jni_libs: ["libsplitapp_number_proxy"],
+ test_suites: TARGET_TEST_SUITES,
+}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/jni/AndroidManifest_number_provider_a.xml b/hostsidetests/appsecurity/test-apps/SplitApp/jni/AndroidManifest_number_provider_a.xml
new file mode 100644
index 0000000..1c6f2f1
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/jni/AndroidManifest_number_provider_a.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2021 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.
+-->
+
+<!-- Automatically generated file from build_libs.sh.-->
+<!-- DO NOT MODIFY THIS FILE.-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.cts.splitapp"
+ split="lib_number_provider_a">
+ <application android:hasCode="false" />
+</manifest>
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/jni/AndroidManifest_number_provider_b.xml b/hostsidetests/appsecurity/test-apps/SplitApp/jni/AndroidManifest_number_provider_b.xml
new file mode 100644
index 0000000..ee9baf5
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/jni/AndroidManifest_number_provider_b.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2021 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.
+-->
+
+<!-- Automatically generated file from build_libs.sh.-->
+<!-- DO NOT MODIFY THIS FILE.-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.cts.splitapp"
+ split="lib_number_provider_b">
+ <application android:hasCode="false" />
+</manifest>
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/jni/AndroidManifest_number_proxy.xml b/hostsidetests/appsecurity/test-apps/SplitApp/jni/AndroidManifest_number_proxy.xml
new file mode 100644
index 0000000..9d5c84e
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/jni/AndroidManifest_number_proxy.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2021 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.
+-->
+
+<!-- Automatically generated file from build_libs.sh.-->
+<!-- DO NOT MODIFY THIS FILE.-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.android.cts.splitapp"
+ split="lib_number_proxy">
+ <application android:hasCode="false" />
+</manifest>
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/jni/com_android_cts_splitapp_Native.cpp b/hostsidetests/appsecurity/test-apps/SplitApp/jni/com_android_cts_splitapp_Native.cpp
index 36e3a4c..0329395 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/jni/com_android_cts_splitapp_Native.cpp
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/jni/com_android_cts_splitapp_Native.cpp
@@ -18,12 +18,52 @@
#include <android/log.h>
#include <stdio.h>
+#include <dlfcn.h>
#include "jni.h"
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
+typedef int (*pFuncGetNumber)();
+
+static jint get_number_from_other_library(
+ const char* library_file_name, const char* function_name) {
+ void *handle;
+ char *error;
+ handle = dlopen (library_file_name, RTLD_LAZY);
+ if (!handle) {
+ LOGE("Can't load %s: %s\n", library_file_name, dlerror());
+ return -1;
+ }
+ pFuncGetNumber functionGetNumber = (pFuncGetNumber) dlsym(handle, function_name);
+ if ((error = dlerror()) != NULL) {
+ LOGE("Can't load function %s: %s\n", function_name, error);
+ dlclose(handle);
+ return -2;
+ }
+ int ret = functionGetNumber();
+ dlclose(handle);
+
+ return ret;
+}
+
+static jint get_number_a_via_proxy(JNIEnv *env, jobject thiz) {
+ return get_number_from_other_library("libsplitapp_number_proxy.so", "get_number_a");
+}
+
+static jint get_number_b_via_proxy(JNIEnv *env, jobject thiz) {
+ return get_number_from_other_library("libsplitapp_number_proxy.so", "get_number_b");
+}
+
+static jint get_number_a_from_provider(JNIEnv *env, jobject thiz) {
+ return get_number_from_other_library("libsplitapp_number_provider_a.so", "get_number");
+}
+
+static jint get_number_b_from_provider(JNIEnv *env, jobject thiz) {
+ return get_number_from_other_library("libsplitapp_number_provider_b.so", "get_number");
+}
+
#ifdef __LIVE_ONLY_32BIT__
#define ABI_BITNESS 32
#else // __LIVE_ONLY_32BIT__
@@ -62,6 +102,10 @@
{"add", "(II)I", (void*)add},
{"arch", "()Ljava/lang/String;", (void*)arch},
{"sub", "(II)I", (void*)sub},
+ {"getNumberAViaProxy", "()I", (void*) get_number_a_via_proxy},
+ {"getNumberBViaProxy", "()I", (void*) get_number_b_via_proxy},
+ {"getNumberADirectly", "()I", (void*) get_number_a_from_provider},
+ {"getNumberBDirectly", "()I", (void*) get_number_b_from_provider},
};
static int registerNativeMethods(JNIEnv* env, const char* className, JNINativeMethod* gMethods, int numMethods) {
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/jni/number_providers.cpp b/hostsidetests/appsecurity/test-apps/SplitApp/jni/number_providers.cpp
new file mode 100644
index 0000000..ff19355
--- /dev/null
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/jni/number_providers.cpp
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2021 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.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The content of libsplitapp_number_provider_proxy.so
+ */
+#ifdef ANDROID_SPLIT_APP_NUMBER_PROXY_SO
+#include <dlfcn.h>
+
+const char* kFunctionName = "get_number";
+
+typedef int (*pFuncGetNumber)();
+
+int get_number(const char* libraryFileName) {
+ void *handle;
+ char *error;
+ handle = dlopen (libraryFileName, RTLD_LAZY);
+ if (!handle) {
+ return -1;
+ }
+ pFuncGetNumber functionGetNumber = (pFuncGetNumber) dlsym(handle, kFunctionName);
+ if ((error = dlerror()) != NULL) {
+ dlclose(handle);
+ return -2;
+ }
+ int ret = functionGetNumber();
+ dlclose(handle);
+
+ return ret;
+}
+
+int get_number_a() {
+ return get_number("libsplitapp_number_provider_a.so");
+}
+
+int get_number_b() {
+ return get_number("libsplitapp_number_provider_b.so");
+}
+
+#endif // ANDROID_SPLIT_APP_NUMBER_PROXY_SO
+
+/**
+ * The content of libsplitapp_number_provider_a.so
+ */
+#ifdef ANDROID_SPLIT_APP_NUMBER_PROVIDER_A_SO
+int get_number() {
+ return 7;
+}
+#endif // ANDROID_SPLIT_APP_NUMBER_PROVIDER_A_SO
+
+
+/**
+ * The content of libsplitapp_number_provider_b.so
+ */
+#ifdef ANDROID_SPLIT_APP_NUMBER_PROVIDER_B_SO
+int get_number() {
+ return 11;
+}
+#endif // ANDROID_SPLIT_APP_NUMBER_PROVIDER_B_SO
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/raw/lib/arm64-v8a/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/raw/lib/arm64-v8a/libsplitappjni.so
index c00bfbd..427a89e 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/raw/lib/arm64-v8a/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/raw/lib/arm64-v8a/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/raw_revision/lib/arm64-v8a/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/raw_revision/lib/arm64-v8a/libsplitappjni.so
index a73dd38..86f2b35 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/raw_revision/lib/arm64-v8a/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/arm64-v8a/raw_revision/lib/arm64-v8a/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/raw/lib/armeabi-v7a/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/raw/lib/armeabi-v7a/libsplitappjni.so
index 45b4d57..ddf14e0 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/raw/lib/armeabi-v7a/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/raw/lib/armeabi-v7a/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/raw_revision/lib/armeabi-v7a/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/raw_revision/lib/armeabi-v7a/libsplitappjni.so
index 7d9f217..b5c0be7 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/raw_revision/lib/armeabi-v7a/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi-v7a/raw_revision/lib/armeabi-v7a/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/raw/lib/armeabi/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/raw/lib/armeabi/libsplitappjni.so
index 56f3423..1a979df 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/raw/lib/armeabi/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/raw/lib/armeabi/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/raw_revision/lib/armeabi/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/raw_revision/lib/armeabi/libsplitappjni.so
index 7d25789..d4e34fa 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/raw_revision/lib/armeabi/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/armeabi/raw_revision/lib/armeabi/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/raw/lib/mips/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/raw/lib/mips/libsplitappjni.so
index 535aaae..f50540d 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/raw/lib/mips/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/raw/lib/mips/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/raw_revision/lib/mips/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/raw_revision/lib/mips/libsplitappjni.so
index 1e7c5e2..78b6faf 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/raw_revision/lib/mips/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips/raw_revision/lib/mips/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/raw/lib/mips64/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/raw/lib/mips64/libsplitappjni.so
index 23724ad..bd298c4 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/raw/lib/mips64/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/raw/lib/mips64/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/raw_revision/lib/mips64/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/raw_revision/lib/mips64/libsplitappjni.so
index 9323485..a1e67f2 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/raw_revision/lib/mips64/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/mips64/raw_revision/lib/mips64/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/raw/lib/x86/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/raw/lib/x86/libsplitappjni.so
index 8bb8127..9325b09 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/raw/lib/x86/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/raw/lib/x86/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/raw_revision/lib/x86/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/raw_revision/lib/x86/libsplitappjni.so
index f19983f..d7e2014 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/raw_revision/lib/x86/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86/raw_revision/lib/x86/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/raw/lib/x86_64/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/raw/lib/x86_64/libsplitappjni.so
index 84f7ed0..d977407 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/raw/lib/x86_64/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/raw/lib/x86_64/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/raw_revision/lib/x86_64/libsplitappjni.so b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/raw_revision/lib/x86_64/libsplitappjni.so
index 053bb95..3cc4b22 100755
--- a/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/raw_revision/lib/x86_64/libsplitappjni.so
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/libs/x86_64/raw_revision/lib/x86_64/libsplitappjni.so
Binary files differ
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/Native.java b/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/Native.java
index c132dfe..8759068 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/Native.java
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/Native.java
@@ -25,4 +25,8 @@
public static native String arch();
public static native int sub(int a, int b);
public static native int getAbiBitness();
+ public static native int getNumberAViaProxy();
+ public static native int getNumberBViaProxy();
+ public static native int getNumberADirectly();
+ public static native int getNumberBDirectly();
}
diff --git a/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/SplitAppTest.java b/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/SplitAppTest.java
index dbc6da4..2308b98 100644
--- a/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/SplitAppTest.java
+++ b/hostsidetests/appsecurity/test-apps/SplitApp/src/com/android/cts/splitapp/SplitAppTest.java
@@ -300,6 +300,26 @@
}
@Test
+ public void testNative_getNumberADirectly_shouldBeSeven() throws Exception {
+ assertThat(Native.getNumberADirectly()).isEqualTo(7);
+ }
+
+ @Test
+ public void testNative_getNumberAViaProxy_shouldBeSeven() throws Exception {
+ assertThat(Native.getNumberAViaProxy()).isEqualTo(7);
+ }
+
+ @Test
+ public void testNative_getNumberBDirectly_shouldBeEleven() throws Exception {
+ assertThat(Native.getNumberBDirectly()).isEqualTo(11);
+ }
+
+ @Test
+ public void testNative_getNumberBViaProxy_shouldBeEleven() throws Exception {
+ assertThat(Native.getNumberBViaProxy()).isEqualTo(11);
+ }
+
+ @Test
public void testFeatureWarmBase() throws Exception {
final Resources r = getContext().getResources();
final PackageManager pm = getContext().getPackageManager();