Add WRITE_ALLOWLISTED_DEVICE_CONFIG when modifying DeviceConfig

Bug: 380648508
Test: atest ThreadNetworkControllerServiceTest
Change-Id: I36908316f5eef6a3712c98f5901a5c162db3471c
This commit is contained in:
Yang Sun 2024-11-25 09:58:37 +08:00
commit 4b43c079ff

View file

@ -17,6 +17,7 @@
package com.android.server.thread;
import static android.Manifest.permission.NETWORK_SETTINGS;
import static android.Manifest.permission.WRITE_ALLOWLISTED_DEVICE_CONFIG;
import static android.Manifest.permission.WRITE_DEVICE_CONFIG;
import static android.net.NetworkCapabilities.NET_CAPABILITY_INTERNET;
import static android.net.NetworkCapabilities.NET_CAPABILITY_NOT_VPN;
@ -266,6 +267,7 @@ public final class ThreadNetworkControllerServiceTest {
public void tearDown() throws Exception {
runAsShell(
WRITE_DEVICE_CONFIG,
WRITE_ALLOWLISTED_DEVICE_CONFIG,
() -> DeviceConfig.deleteProperty("thread_network", "TrelFeature__enabled"));
}
@ -338,6 +340,7 @@ public final class ThreadNetworkControllerServiceTest {
public void initialize_trelFeatureDisabled_trelDisabledAtOtDaemon() throws Exception {
runAsShell(
WRITE_DEVICE_CONFIG,
WRITE_ALLOWLISTED_DEVICE_CONFIG,
() ->
DeviceConfig.setProperty(
"thread_network", "TrelFeature__enabled", "false", false));
@ -352,6 +355,7 @@ public final class ThreadNetworkControllerServiceTest {
public void initialize_trelFeatureEnabled_setTrelEnabledAtOtDamon() throws Exception {
runAsShell(
WRITE_DEVICE_CONFIG,
WRITE_ALLOWLISTED_DEVICE_CONFIG,
() ->
DeviceConfig.setProperty(
"thread_network", "TrelFeature__enabled", "true", false));