Merge "Move Ethernet related files to f/b/packages/ConnectivityT."
This commit is contained in:
@@ -114,6 +114,23 @@ filegroup {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ethernet related libraries.
|
||||||
|
|
||||||
|
filegroup {
|
||||||
|
name: "framework-connectivity-ethernet-sources",
|
||||||
|
srcs: [
|
||||||
|
"src/android/net/EthernetManager.java",
|
||||||
|
"src/android/net/EthernetNetworkSpecifier.java",
|
||||||
|
"src/android/net/IEthernetManager.aidl",
|
||||||
|
"src/android/net/IEthernetServiceListener.aidl",
|
||||||
|
"src/android/net/ITetheredInterfaceCallback.aidl",
|
||||||
|
],
|
||||||
|
path: "src",
|
||||||
|
visibility: [
|
||||||
|
"//visibility:private",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
// Connectivity-T common libraries.
|
// Connectivity-T common libraries.
|
||||||
|
|
||||||
filegroup {
|
filegroup {
|
||||||
@@ -130,6 +147,7 @@ filegroup {
|
|||||||
filegroup {
|
filegroup {
|
||||||
name: "framework-connectivity-tiramisu-sources",
|
name: "framework-connectivity-tiramisu-sources",
|
||||||
srcs: [
|
srcs: [
|
||||||
|
":framework-connectivity-ethernet-sources",
|
||||||
":framework-connectivity-ipsec-sources",
|
":framework-connectivity-ipsec-sources",
|
||||||
":framework-connectivity-netstats-sources",
|
":framework-connectivity-netstats-sources",
|
||||||
":framework-connectivity-nsd-sources",
|
":framework-connectivity-nsd-sources",
|
||||||
|
|||||||
@@ -61,11 +61,25 @@ filegroup {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ethernet related libraries.
|
||||||
|
|
||||||
|
filegroup {
|
||||||
|
name: "services.connectivity-ethernet-sources",
|
||||||
|
srcs: [
|
||||||
|
"src/com/android/server/net/IpConfigStore.java",
|
||||||
|
],
|
||||||
|
path: "src",
|
||||||
|
visibility: [
|
||||||
|
"//frameworks/opt/net/ethernet",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
// Connectivity-T common libraries.
|
// Connectivity-T common libraries.
|
||||||
|
|
||||||
filegroup {
|
filegroup {
|
||||||
name: "services.connectivity-tiramisu-sources",
|
name: "services.connectivity-tiramisu-sources",
|
||||||
srcs: [
|
srcs: [
|
||||||
|
":services.connectivity-ethernet-sources",
|
||||||
":services.connectivity-ipsec-sources",
|
":services.connectivity-ipsec-sources",
|
||||||
":services.connectivity-netstats-sources",
|
":services.connectivity-netstats-sources",
|
||||||
":services.connectivity-nsd-sources",
|
":services.connectivity-nsd-sources",
|
||||||
|
|||||||
@@ -44,6 +44,9 @@ import java.net.InetAddress;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class provides an API to store and manage L3 network IP configuration.
|
||||||
|
*/
|
||||||
public class IpConfigStore {
|
public class IpConfigStore {
|
||||||
private static final String TAG = "IpConfigStore";
|
private static final String TAG = "IpConfigStore";
|
||||||
private static final boolean DBG = false;
|
private static final boolean DBG = false;
|
||||||
@@ -78,6 +81,9 @@ public class IpConfigStore {
|
|||||||
return writeConfig(out, configKey, config, IPCONFIG_FILE_VERSION);
|
return writeConfig(out, configKey, config, IPCONFIG_FILE_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write the IP configuration with the given parameters to {@link DataOutputStream}.
|
||||||
|
*/
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public static boolean writeConfig(DataOutputStream out, String configKey,
|
public static boolean writeConfig(DataOutputStream out, String configKey,
|
||||||
IpConfiguration config, int version) throws IOException {
|
IpConfiguration config, int version) throws IOException {
|
||||||
@@ -177,7 +183,7 @@ public class IpConfigStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Deprecated use {@link #writeIpConfigurations(String, ArrayMap)} instead.
|
* @deprecated use {@link #writeIpConfigurations(String, ArrayMap)} instead.
|
||||||
* New method uses string as network identifier which could be interface name or MAC address or
|
* New method uses string as network identifier which could be interface name or MAC address or
|
||||||
* other token.
|
* other token.
|
||||||
*/
|
*/
|
||||||
@@ -192,6 +198,9 @@ public class IpConfigStore {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Write the IP configuration associated to the target networks to the destination path.
|
||||||
|
*/
|
||||||
public void writeIpConfigurations(String filePath,
|
public void writeIpConfigurations(String filePath,
|
||||||
ArrayMap<String, IpConfiguration> networks) {
|
ArrayMap<String, IpConfiguration> networks) {
|
||||||
mWriter.write(filePath, out -> {
|
mWriter.write(filePath, out -> {
|
||||||
@@ -202,6 +211,9 @@ public class IpConfigStore {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read the IP configuration from the destination path to {@link BufferedInputStream}.
|
||||||
|
*/
|
||||||
public static ArrayMap<String, IpConfiguration> readIpConfigurations(String filePath) {
|
public static ArrayMap<String, IpConfiguration> readIpConfigurations(String filePath) {
|
||||||
BufferedInputStream bufferedInputStream;
|
BufferedInputStream bufferedInputStream;
|
||||||
try {
|
try {
|
||||||
@@ -215,7 +227,7 @@ public class IpConfigStore {
|
|||||||
return readIpConfigurations(bufferedInputStream);
|
return readIpConfigurations(bufferedInputStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @Deprecated use {@link #readIpConfigurations(String)} */
|
/** @deprecated use {@link #readIpConfigurations(String)} */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static SparseArray<IpConfiguration> readIpAndProxyConfigurations(String filePath) {
|
public static SparseArray<IpConfiguration> readIpAndProxyConfigurations(String filePath) {
|
||||||
BufferedInputStream bufferedInputStream;
|
BufferedInputStream bufferedInputStream;
|
||||||
@@ -230,7 +242,7 @@ public class IpConfigStore {
|
|||||||
return readIpAndProxyConfigurations(bufferedInputStream);
|
return readIpAndProxyConfigurations(bufferedInputStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @Deprecated use {@link #readIpConfigurations(InputStream)} */
|
/** @deprecated use {@link #readIpConfigurations(InputStream)} */
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static SparseArray<IpConfiguration> readIpAndProxyConfigurations(
|
public static SparseArray<IpConfiguration> readIpAndProxyConfigurations(
|
||||||
InputStream inputStream) {
|
InputStream inputStream) {
|
||||||
Reference in New Issue
Block a user