From c3a28323623f0ff3b98ab15e61141437a0fee90b Mon Sep 17 00:00:00 2001 From: Xiao Ma Date: Thu, 30 Jan 2020 17:00:05 +0900 Subject: Add ScanResultInfo object in ProvisioningConfiguration parcel. Since wifi.ScanResult doesn't implement specific equals() yet, for comparing the ProvisioningConfiguration object better, this change encapuslates ScanResult#SSID and ScanResult#InformationElement member into a new class: ScanResultInfo inside ProvisioningConfiguration. Adding ScanResultInfo object in ProvisioningConfiguration parcelable is to check the InformationElement filed when starting IpClient and detect whether or not the specific OUI is included in the IEs. Bug: 137835398 Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests Change-Id: I247ac7f343ef3e99b64b93b45549e2a25980a407 --- common/networkstackclient/Android.bp | 3 +++ .../android/net/InformationElementParcelable.aidl | 22 ++++++++++++++++++++ .../net/ProvisioningConfigurationParcelable.aidl | 2 ++ .../src/android/net/ScanResultInfoParcelable.aidl | 24 ++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 common/networkstackclient/src/android/net/InformationElementParcelable.aidl create mode 100644 common/networkstackclient/src/android/net/ScanResultInfoParcelable.aidl (limited to 'common/networkstackclient') diff --git a/common/networkstackclient/Android.bp b/common/networkstackclient/Android.bp index 31f3384..dbe8ff0 100644 --- a/common/networkstackclient/Android.bp +++ b/common/networkstackclient/Android.bp @@ -45,6 +45,7 @@ aidl_interface { include_dirs: [ "frameworks/base/core/java", // For framework parcelables. "frameworks/native/aidl/binder/android/os", // For PersistableBundle.aidl + "frameworks/base/wifi/aidl-export", // For wifi parcelables. ], srcs: [ "src/android/net/DhcpResultsParcelable.aidl", @@ -53,10 +54,12 @@ aidl_interface { "src/android/net/INetworkStackConnector.aidl", "src/android/net/INetworkStackStatusCallback.aidl", "src/android/net/InitialConfigurationParcelable.aidl", + "src/android/net/InformationElementParcelable.aidl", "src/android/net/Layer2PacketParcelable.aidl", "src/android/net/NattKeepalivePacketDataParcelable.aidl", "src/android/net/PrivateDnsConfigParcel.aidl", "src/android/net/ProvisioningConfigurationParcelable.aidl", + "src/android/net/ScanResultInfoParcelable.aidl", "src/android/net/TcpKeepalivePacketDataParcelable.aidl", "src/android/net/dhcp/DhcpServingParamsParcel.aidl", "src/android/net/dhcp/IDhcpServer.aidl", diff --git a/common/networkstackclient/src/android/net/InformationElementParcelable.aidl b/common/networkstackclient/src/android/net/InformationElementParcelable.aidl new file mode 100644 index 0000000..c70bf6f --- /dev/null +++ b/common/networkstackclient/src/android/net/InformationElementParcelable.aidl @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2020 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.net; + +parcelable InformationElementParcelable { + int id; + byte[] payload; +} diff --git a/common/networkstackclient/src/android/net/ProvisioningConfigurationParcelable.aidl b/common/networkstackclient/src/android/net/ProvisioningConfigurationParcelable.aidl index 0b6d7d5..9fcb036 100644 --- a/common/networkstackclient/src/android/net/ProvisioningConfigurationParcelable.aidl +++ b/common/networkstackclient/src/android/net/ProvisioningConfigurationParcelable.aidl @@ -19,6 +19,7 @@ package android.net; import android.net.InitialConfigurationParcelable; import android.net.Network; +import android.net.ScanResultInfoParcelable; import android.net.StaticIpConfiguration; import android.net.apf.ApfCapabilities; @@ -36,4 +37,5 @@ parcelable ProvisioningConfigurationParcelable { Network network; String displayName; boolean enablePreconnection; + ScanResultInfoParcelable scanResultInfo; } diff --git a/common/networkstackclient/src/android/net/ScanResultInfoParcelable.aidl b/common/networkstackclient/src/android/net/ScanResultInfoParcelable.aidl new file mode 100644 index 0000000..f5f101d --- /dev/null +++ b/common/networkstackclient/src/android/net/ScanResultInfoParcelable.aidl @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2020 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.net; + +import android.net.InformationElementParcelable; + +parcelable ScanResultInfoParcelable { + String ssid; + InformationElementParcelable[] informationElements; +} -- cgit v1.2.3