Snap for 12289667 from ac2ddae1f03103fbb04e71d43901f0a7c336767e to 24Q4-release
Change-Id: I3cb609ceda9af7d5ffb1abf5d17548bc7a1319ed
diff --git a/common/thread_flags.aconfig b/common/thread_flags.aconfig
index a3f77a7..c11c6c0 100644
--- a/common/thread_flags.aconfig
+++ b/common/thread_flags.aconfig
@@ -12,6 +12,7 @@
flag {
name: "configuration_enabled"
is_exported: true
+ is_fixed_read_only: true
namespace: "thread_network"
description: "Controls whether the Android Thread configuration is enabled"
bug: "342519412"
@@ -20,6 +21,7 @@
flag {
name: "channel_max_powers_enabled"
is_exported: true
+ is_fixed_read_only: true
namespace: "thread_network"
description: "Controls whether the Android Thread setting max power of channel feature is enabled"
bug: "346686506"
diff --git a/service/ServiceConnectivityResources/res/values-eu/strings.xml b/service/ServiceConnectivityResources/res/values-eu/strings.xml
index 81d8ddb..5a0a9d4 100644
--- a/service/ServiceConnectivityResources/res/values-eu/strings.xml
+++ b/service/ServiceConnectivityResources/res/values-eu/strings.xml
@@ -18,7 +18,7 @@
<resources xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="connectivityResourcesAppLabel" msgid="2476261877900882974">"Sistemaren konexio-baliabideak"</string>
- <string name="wifi_available_sign_in" msgid="8041178343789805553">"Hasi saioa Wi-Fi sarean"</string>
+ <string name="wifi_available_sign_in" msgid="8041178343789805553">"Hasi saioa wifi-sarean"</string>
<string name="network_available_sign_in" msgid="2622520134876355561">"Hasi saioa sarean"</string>
<!-- no translation found for network_available_sign_in_detailed (8439369644697866359) -->
<skip />
diff --git a/thread/service/java/com/android/server/thread/ThreadNetworkControllerService.java b/thread/service/java/com/android/server/thread/ThreadNetworkControllerService.java
index 61fa5d0..93b2f70 100644
--- a/thread/service/java/com/android/server/thread/ThreadNetworkControllerService.java
+++ b/thread/service/java/com/android/server/thread/ThreadNetworkControllerService.java
@@ -125,6 +125,7 @@
import com.android.server.thread.openthread.IOtDaemon;
import com.android.server.thread.openthread.IOtDaemonCallback;
import com.android.server.thread.openthread.IOtStatusReceiver;
+import com.android.server.thread.openthread.InfraLinkState;
import com.android.server.thread.openthread.Ipv6AddressInfo;
import com.android.server.thread.openthread.MeshcopTxtAttributes;
import com.android.server.thread.openthread.OnMeshPrefixConfig;
@@ -214,6 +215,7 @@
private boolean mForceStopOtDaemonEnabled;
private OtDaemonConfiguration mOtDaemonConfig;
+ private InfraLinkState mInfraLinkState;
@VisibleForTesting
ThreadNetworkControllerService(
@@ -238,11 +240,8 @@
mInfraIfController = infraIfController;
mUpstreamNetworkRequest = newUpstreamNetworkRequest();
mNetworkToInterface = new HashMap<Network, String>();
- mOtDaemonConfig =
- new OtDaemonConfiguration.Builder()
- .setIsBorderRoutingEnabled(true)
- .setInfraInterfaceName(null)
- .build();
+ mOtDaemonConfig = new OtDaemonConfiguration.Builder().build();
+ mInfraLinkState = new InfraLinkState.Builder().build();
mPersistentSettings = persistentSettings;
mNsdPublisher = nsdPublisher;
mUserManager = userManager;
@@ -571,6 +570,7 @@
}
}
}
+ // TODO: set the configuration at ot-daemon
}
@Override
@@ -1232,51 +1232,45 @@
}
}
- private void configureBorderRouter(OtDaemonConfiguration otDaemonConfig) {
- if (mOtDaemonConfig.equals(otDaemonConfig)) {
+ private void setInfraLinkState(InfraLinkState infraLinkState) {
+ if (mInfraLinkState.equals(infraLinkState)) {
return;
}
- Log.i(TAG, "Configuring Border Router: " + mOtDaemonConfig + " -> " + otDaemonConfig);
- mOtDaemonConfig = otDaemonConfig;
+ Log.i(TAG, "Infra link state changed: " + mInfraLinkState + " -> " + infraLinkState);
+ mInfraLinkState = infraLinkState;
ParcelFileDescriptor infraIcmp6Socket = null;
- if (mOtDaemonConfig.infraInterfaceName != null) {
+ if (mInfraLinkState.interfaceName != null) {
try {
infraIcmp6Socket =
- mInfraIfController.createIcmp6Socket(mOtDaemonConfig.infraInterfaceName);
+ mInfraIfController.createIcmp6Socket(mInfraLinkState.interfaceName);
} catch (IOException e) {
Log.i(TAG, "Failed to create ICMPv6 socket on infra network interface", e);
}
}
try {
getOtDaemon()
- .setConfiguration(
- mOtDaemonConfig,
+ .setInfraLinkState(
+ mInfraLinkState,
infraIcmp6Socket,
- new ConfigureBorderRouterStatusReceiver());
+ new setInfraLinkStateStatusReceiver());
} catch (RemoteException | ThreadNetworkException e) {
Log.w(TAG, "Failed to configure border router " + mOtDaemonConfig, e);
}
}
private void enableBorderRouting(String infraIfName) {
- OtDaemonConfiguration otDaemonConfig =
- newOtDaemonConfigBuilder(mOtDaemonConfig)
- .setIsBorderRoutingEnabled(true)
- .setInfraInterfaceName(infraIfName)
- .build();
+ InfraLinkState infraLinkState =
+ newInfraLinkStateBuilder(mInfraLinkState).setInterfaceName(infraIfName).build();
Log.i(TAG, "Enable border routing on AIL: " + infraIfName);
- configureBorderRouter(otDaemonConfig);
+ setInfraLinkState(infraLinkState);
}
private void disableBorderRouting() {
mUpstreamNetwork = null;
- OtDaemonConfiguration otDaemonConfig =
- newOtDaemonConfigBuilder(mOtDaemonConfig)
- .setIsBorderRoutingEnabled(false)
- .setInfraInterfaceName(null)
- .build();
+ InfraLinkState infraLinkState =
+ newInfraLinkStateBuilder(mInfraLinkState).setInterfaceName(null).build();
Log.i(TAG, "Disabling border routing");
- configureBorderRouter(otDaemonConfig);
+ setInfraLinkState(infraLinkState);
}
private void handleThreadInterfaceStateChanged(boolean isUp) {
@@ -1378,10 +1372,12 @@
}
private static OtDaemonConfiguration.Builder newOtDaemonConfigBuilder(
- OtDaemonConfiguration brConfig) {
- return new OtDaemonConfiguration.Builder()
- .setIsBorderRoutingEnabled(brConfig.isBorderRoutingEnabled)
- .setInfraInterfaceName(brConfig.infraInterfaceName);
+ OtDaemonConfiguration config) {
+ return new OtDaemonConfiguration.Builder();
+ }
+
+ private static InfraLinkState.Builder newInfraLinkStateBuilder(InfraLinkState infraLinkState) {
+ return new InfraLinkState.Builder().setInterfaceName(infraLinkState.interfaceName);
}
private static final class CallbackMetadata {
@@ -1405,8 +1401,9 @@
}
}
- private static final class ConfigureBorderRouterStatusReceiver extends IOtStatusReceiver.Stub {
- public ConfigureBorderRouterStatusReceiver() {}
+ private static final class setOtDaemonConfigurationStatusReceiver
+ extends IOtStatusReceiver.Stub {
+ public setOtDaemonConfigurationStatusReceiver() {}
@Override
public void onSuccess() {
@@ -1415,7 +1412,21 @@
@Override
public void onError(int i, String s) {
- Log.w(TAG, String.format("Failed to configure border router: %d %s", i, s));
+ Log.w(TAG, String.format("Failed to set configurations: %d %s", i, s));
+ }
+ }
+
+ private static final class setInfraLinkStateStatusReceiver extends IOtStatusReceiver.Stub {
+ public setInfraLinkStateStatusReceiver() {}
+
+ @Override
+ public void onSuccess() {
+ Log.i(TAG, "Set the infra link state successfully");
+ }
+
+ @Override
+ public void onError(int i, String s) {
+ Log.w(TAG, String.format("Failed to set the infra link state: %d %s", i, s));
}
}