diff options
author | Przemyslaw Szczepaniak <pszczepaniak@google.com> | 2019-10-30 15:46:23 +0000 |
---|---|---|
committer | Przemyslaw Szczepaniak <pszczepaniak@google.com> | 2019-11-01 14:59:48 +0000 |
commit | f6c56a74fe66daef11f36eff79305faeb575a2b1 (patch) | |
tree | fb603ca16becb440d536622ec278e0ac0d6bed40 | |
parent | 35e80573e618292845b5617a3e625e2b51e4e626 (diff) | |
download | ml-f6c56a74fe66daef11f36eff79305faeb575a2b1.tar.gz |
Add testing version of NNAPI Apex for e2e tests.
Testing version of NNAPI Apex has version value set to max
int32 value, and always can be used to update existing NNAPI
apex package.
Test: neuralnetworks-e2e-tests
Bug: 143591913
Change-Id: Icecbdc0eeb795044a9be3153df32c6bbf88dd6a6
-rw-r--r-- | nn/apex/Android.bp | 17 | ||||
-rw-r--r-- | nn/apex/AndroidManifest.xml | 29 | ||||
-rw-r--r-- | nn/apex/testing/Android.bp | 25 | ||||
-rw-r--r-- | nn/apex/testing/test_apex_manifest.json | 4 |
4 files changed, 72 insertions, 3 deletions
diff --git a/nn/apex/Android.bp b/nn/apex/Android.bp index 1685eb1ab..75ed80e38 100644 --- a/nn/apex/Android.bp +++ b/nn/apex/Android.bp @@ -25,11 +25,22 @@ android_app_certificate { certificate: "com.android.neuralnetworks", } -apex { - name: "com.android.neuralnetworks", - manifest: "manifest.json", +filegroup { + name: "com.android.neuralnetworks-androidManifest", + srcs: ["AndroidManifest.xml"], +} + +apex_defaults { + name: "com.android.neuralnetworks-defaults", + androidManifest: ":com.android.neuralnetworks-androidManifest", native_shared_libs: ["libneuralnetworks"], compile_multilib: "both", key: "com.android.neuralnetworks.key", certificate: ":com.android.neuralnetworks.certificate", } + +apex { + name: "com.android.neuralnetworks", + defaults: ["com.android.neuralnetworks-defaults"], + manifest: "manifest.json", +} diff --git a/nn/apex/AndroidManifest.xml b/nn/apex/AndroidManifest.xml new file mode 100644 index 000000000..255d2a501 --- /dev/null +++ b/nn/apex/AndroidManifest.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + * Copyright (C) 2019 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.neuralnetworks"> + <!-- APEX does not have classes.dex --> + <application android:hasCode="false" /> + <!-- + * API levels the NeuralNetworks APEX is known to work with. + --> + <uses-sdk + android:minSdkVersion="29" + android:maxSdkVersion="30" + android:targetSdkVersion="30" + /> +</manifest> diff --git a/nn/apex/testing/Android.bp b/nn/apex/testing/Android.bp new file mode 100644 index 000000000..7f6715bf6 --- /dev/null +++ b/nn/apex/testing/Android.bp @@ -0,0 +1,25 @@ +// Copyright (C) 2019 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. + +apex { + name: "test_com.android.neuralnetworks", + visibility: [ + "//system/apex/tests", + ], + defaults: ["com.android.neuralnetworks-defaults"], + manifest: "test_apex_manifest.json", + file_contexts: "com.android.neuralnetworks", + // Test APEX, should never be installed + installable: false, +} diff --git a/nn/apex/testing/test_apex_manifest.json b/nn/apex/testing/test_apex_manifest.json new file mode 100644 index 000000000..ecbb6de66 --- /dev/null +++ b/nn/apex/testing/test_apex_manifest.json @@ -0,0 +1,4 @@ +{ + "name": "com.android.neuralnetworks", + "version": 2147483647 +} |