diff options
author | 2023-08-17 15:28:22 +0000 | |
---|---|---|
committer | 2023-08-17 15:32:01 +0000 | |
commit | ee92f9291e26d689293d1f76594d91322dad7be4 (patch) | |
tree | 34ae03193fba1354b097a41289d4e659efc41883 | |
parent | da656f1b50f04ba7a465a285ed4cde5f8bbfb5a2 (diff) |
Add CtsShimAddApkToApex app
CtsShimAddApkToApex app is a simple app with one activity.
It will be used in a cts to test updating the shim apex with a new
version which contains this app then the test will verify that it can
start the app contained in the apex.
Bug: 289535527
Test: m CtsShimAddApkToApex
Change-Id: I98dbe9906e9705cc736269ddca947fd94d23eb81
3 files changed, 92 insertions, 0 deletions
diff --git a/packages/CtsShim/build/Android.bp b/packages/CtsShim/build/Android.bp index af3e2102e430..ae46f80aa257 100644 --- a/packages/CtsShim/build/Android.bp +++ b/packages/CtsShim/build/Android.bp @@ -202,3 +202,22 @@ android_app { ], min_sdk_version: "24", } + +//########################################################## +// Variant: Add apk to an apex +android_app { + name: "CtsShimAddApkToApex", + sdk_version: "current", + srcs: ["shim_add_apk_to_apex/src/android/addapktoapex/app/AddApkToApexDeviceActivity.java"], + optimize: { + enabled: false, + }, + dex_preopt: { + enabled: false, + }, + manifest: "shim_add_apk_to_apex/AndroidManifestAddApkToApex.xml", + apex_available: [ + "//apex_available:platform", + "com.android.apex.cts.shim.v2_add_apk_to_apex", + ], +} diff --git a/packages/CtsShim/build/shim_add_apk_to_apex/AndroidManifestAddApkToApex.xml b/packages/CtsShim/build/shim_add_apk_to_apex/AndroidManifestAddApkToApex.xml new file mode 100644 index 000000000000..0e620b062ed6 --- /dev/null +++ b/packages/CtsShim/build/shim_add_apk_to_apex/AndroidManifestAddApkToApex.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (C) 2023 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="android.addapktoapex.app"> + + <application> + <activity android:name=".AddApkToApexDeviceActivity" + android:exported="true"> + <intent-filter> + <action android:name="android.intent.action.MAIN"/> + <category android:name="android.intent.category.LAUNCHER"/> + </intent-filter> + </activity> + </application> + +</manifest>
\ No newline at end of file diff --git a/packages/CtsShim/build/shim_add_apk_to_apex/src/android/addapktoapex/app/AddApkToApexDeviceActivity.java b/packages/CtsShim/build/shim_add_apk_to_apex/src/android/addapktoapex/app/AddApkToApexDeviceActivity.java new file mode 100644 index 000000000000..c68904b30d6a --- /dev/null +++ b/packages/CtsShim/build/shim_add_apk_to_apex/src/android/addapktoapex/app/AddApkToApexDeviceActivity.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 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. + */ + +package android.addapktoapex.app; + +import android.app.Activity; +import android.os.Bundle; +import android.util.Log; + +/** + * A simple activity which logs to Logcat. + */ +public class AddApkToApexDeviceActivity extends Activity { + + private static final String TAG = AddApkToApexDeviceActivity.class.getSimpleName(); + + /** + * The test string to log. + */ + private static final String TEST_STRING = "AddApkToApexTestString"; + + @Override + public void onCreate(Bundle icicle) { + super.onCreate(icicle); + // Log the test string to Logcat. + Log.i(TAG, TEST_STRING); + } + +} |