system/hardware/interfaces
Révision | 819c7f83e3f9bb1bcdf83cc047e7986196bf4ff0 (tree) |
---|---|
l'heure | 2017-07-27 11:53:03 |
Auteur | Erik Kline <ek@goog...> |
Commiter | android-build-merger |
Revert "resolve merge conflicts of a260b85 to stage-aosp-master"
am: f20322560e
Change-Id: Id765acdfac728a004b3ed516e9923f76c9317e19
@@ -1,6 +1,5 @@ | ||
1 | 1 | // This is an autogenerated file, do not edit. |
2 | 2 | subdirs = [ |
3 | - "net", | |
4 | 3 | "wifi/keystore/1.0", |
5 | 4 | "wifi/keystore/1.0/vts/functional", |
6 | 5 | ] |
@@ -1,5 +0,0 @@ | ||
1 | -// This is an autogenerated file, do not edit. | |
2 | -subdirs = [ | |
3 | - "netd/1.0", | |
4 | - "netd/1.0/vts/functional", | |
5 | -] |
@@ -1,59 +0,0 @@ | ||
1 | -// This file is autogenerated by hidl-gen. Do not edit manually. | |
2 | - | |
3 | -filegroup { | |
4 | - name: "android.system.net.netd@1.0_hal", | |
5 | - srcs: [ | |
6 | - "INetd.hal", | |
7 | - ], | |
8 | -} | |
9 | - | |
10 | -genrule { | |
11 | - name: "android.system.net.netd@1.0_genc++", | |
12 | - tools: ["hidl-gen"], | |
13 | - cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hidl:system/libhidl/transport -randroid.system:system/hardware/interfaces android.system.net.netd@1.0", | |
14 | - srcs: [ | |
15 | - ":android.system.net.netd@1.0_hal", | |
16 | - ], | |
17 | - out: [ | |
18 | - "android/system/net/netd/1.0/NetdAll.cpp", | |
19 | - ], | |
20 | -} | |
21 | - | |
22 | -genrule { | |
23 | - name: "android.system.net.netd@1.0_genc++_headers", | |
24 | - tools: ["hidl-gen"], | |
25 | - cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hidl:system/libhidl/transport -randroid.system:system/hardware/interfaces android.system.net.netd@1.0", | |
26 | - srcs: [ | |
27 | - ":android.system.net.netd@1.0_hal", | |
28 | - ], | |
29 | - out: [ | |
30 | - "android/system/net/netd/1.0/INetd.h", | |
31 | - "android/system/net/netd/1.0/IHwNetd.h", | |
32 | - "android/system/net/netd/1.0/BnHwNetd.h", | |
33 | - "android/system/net/netd/1.0/BpHwNetd.h", | |
34 | - "android/system/net/netd/1.0/BsNetd.h", | |
35 | - ], | |
36 | -} | |
37 | - | |
38 | -cc_library_shared { | |
39 | - name: "android.system.net.netd@1.0", | |
40 | - defaults: ["hidl-module-defaults"], | |
41 | - generated_sources: ["android.system.net.netd@1.0_genc++"], | |
42 | - generated_headers: ["android.system.net.netd@1.0_genc++_headers"], | |
43 | - export_generated_headers: ["android.system.net.netd@1.0_genc++_headers"], | |
44 | - vendor_available: true, | |
45 | - shared_libs: [ | |
46 | - "libhidlbase", | |
47 | - "libhidltransport", | |
48 | - "libhwbinder", | |
49 | - "liblog", | |
50 | - "libutils", | |
51 | - "libcutils", | |
52 | - ], | |
53 | - export_shared_lib_headers: [ | |
54 | - "libhidlbase", | |
55 | - "libhidltransport", | |
56 | - "libhwbinder", | |
57 | - "libutils", | |
58 | - ], | |
59 | -} |
@@ -1,58 +0,0 @@ | ||
1 | -/* | |
2 | - * Copyright 2017 The Android Open Source Project | |
3 | - * | |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | - * you may not use this file except in compliance with the License. | |
6 | - * You may obtain a copy of the License at | |
7 | - * | |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | - * | |
10 | - * Unless required by applicable law or agreed to in writing, software | |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | - * See the License for the specific language governing permissions and | |
14 | - * limitations under the License. | |
15 | - */ | |
16 | - | |
17 | -package android.system.net.netd@1.0; | |
18 | - | |
19 | -/** | |
20 | - * This is the root of the HAL module and is the interface returned when | |
21 | - * loading an implementation of the INetd HAL. | |
22 | - */ | |
23 | -interface INetd { | |
24 | - /** | |
25 | - * Return values for INetd requests | |
26 | - */ | |
27 | - enum StatusCode : int32_t { | |
28 | - OK, | |
29 | - INVALID_ARGUMENTS, | |
30 | - NO_NETWORK, | |
31 | - ALREADY_EXISTS, | |
32 | - PERMISSION_DENIED, | |
33 | - UNKNOWN_ERROR | |
34 | - }; | |
35 | - | |
36 | - /** | |
37 | - * Creates a physical network to be used for interfaces managed by the OEM | |
38 | - * | |
39 | - * @return networkHandle a handle to the OEM network. Zero implies | |
40 | - * no networks are available and created | |
41 | - * @return packetMark The packet mark that vendor network stack configuration code must use when | |
42 | - * routing packets to this network. No applications may use this mark. They must | |
43 | - * instead pass the networkHandle to the android_set*network LL-NDK APIs. | |
44 | - * @return status operation status | |
45 | - */ | |
46 | - @entry | |
47 | - @callflow(next={"*"}) | |
48 | - createOemNetwork() generates (uint64_t networkHandle, uint32_t packetMark, StatusCode status); | |
49 | - | |
50 | - /** | |
51 | - * Destroys the specified network previously created using createOemNetwork() | |
52 | - * | |
53 | - * @return status operation status | |
54 | - */ | |
55 | - @exit | |
56 | - @callflow(next="createOemNetwork") | |
57 | - destroyOemNetwork(uint64_t networkHandle) generates (StatusCode status); | |
58 | -}; |
@@ -1,18 +0,0 @@ | ||
1 | -cc_test { | |
2 | - name: "VtsHalNetNetdV1_0TargetTest", | |
3 | - srcs: [ | |
4 | - "VtsHalNetNetdV1_0TargetTest.cpp", | |
5 | - ], | |
6 | - shared_libs: [ | |
7 | - "liblog", | |
8 | - "libhidlbase", | |
9 | - "libhidltransport", | |
10 | - "libutils", | |
11 | - "android.system.net.netd@1.0", | |
12 | - ], | |
13 | - static_libs: ["VtsHalHidlTargetTestBase"], | |
14 | - cflags: [ | |
15 | - "-O0", | |
16 | - "-g", | |
17 | - ], | |
18 | -} |
@@ -1,67 +0,0 @@ | ||
1 | -/* | |
2 | - * Copyright 2017 The Android Open Source Project | |
3 | - * | |
4 | - * Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | - * you may not use this file except in compliance with the License. | |
6 | - * You may obtain a copy of the License at | |
7 | - * | |
8 | - * http://www.apache.org/licenses/LICENSE-2.0 | |
9 | - * | |
10 | - * Unless required by applicable law or agreed to in writing, software | |
11 | - * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | - * See the License for the specific language governing permissions and | |
14 | - * limitations under the License. | |
15 | - */ | |
16 | -#define LOG_TAG "netd_hidl_test" | |
17 | - | |
18 | -#include <android/system/net/netd/1.0/INetd.h> | |
19 | -#include <log/log.h> | |
20 | -#include <VtsHalHidlTargetTestBase.h> | |
21 | - | |
22 | - | |
23 | -using ::android::system::net::netd::V1_0::INetd; | |
24 | -using ::android::hardware::Return; | |
25 | -using ::android::sp; | |
26 | - | |
27 | -class NetdHidlTest : public ::testing::VtsHalHidlTargetTestBase { | |
28 | -public: | |
29 | - virtual void SetUp() override { | |
30 | - netd = ::testing::VtsHalHidlTargetTestBase::getService<INetd>(); | |
31 | - ASSERT_NE(nullptr, netd.get()) << "Could not get HIDL instance"; | |
32 | - } | |
33 | - | |
34 | - sp<INetd> netd; | |
35 | -}; | |
36 | - | |
37 | -// positive test. Ensure netd creates an oem network and returns valid netHandle, and destroys it. | |
38 | -TEST_F(NetdHidlTest, TestCreateAndDestroyOemNetworkOk) { | |
39 | - auto cb = [this](uint64_t netHandle, | |
40 | - uint32_t packetMark, INetd::StatusCode status) { | |
41 | - | |
42 | - ASSERT_EQ(INetd::StatusCode::OK, status); | |
43 | - ASSERT_NE((uint64_t)0, netHandle); | |
44 | - ASSERT_NE((uint32_t)0, packetMark); | |
45 | - | |
46 | - Return<INetd::StatusCode> retStatus = netd->destroyOemNetwork(netHandle); | |
47 | - ASSERT_EQ(INetd::StatusCode::OK, retStatus); | |
48 | - }; | |
49 | - | |
50 | - Return<void> ret = netd->createOemNetwork(cb); | |
51 | - ASSERT_TRUE(ret.isOk()); | |
52 | -} | |
53 | - | |
54 | -// negative test. Ensure destroy for invalid OEM network fails appropriately | |
55 | -TEST_F(NetdHidlTest, TestDestroyOemNetworkInvalid) { | |
56 | - uint64_t nh = 0x6600FACADE; | |
57 | - | |
58 | - Return<INetd::StatusCode> retStatus = netd->destroyOemNetwork(nh); | |
59 | - ASSERT_EQ(INetd::StatusCode::INVALID_ARGUMENTS, retStatus); | |
60 | -} | |
61 | - | |
62 | -int main(int argc, char** argv) { | |
63 | - ::testing::InitGoogleTest(&argc, argv); | |
64 | - int status = RUN_ALL_TESTS(); | |
65 | - ALOGE("Test result with status=%d", status); | |
66 | - return status; | |
67 | -} |