Merge "Move IoUtils#deleteContents from CorePlatformApi set to framework"

This commit is contained in:
Nikita Iashchenko
2021-05-18 22:13:56 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 6 deletions

View File

@@ -43,6 +43,7 @@ import androidx.test.filters.SmallTest;
import androidx.test.runner.AndroidJUnit4;
import com.android.frameworks.tests.net.R;
import com.android.internal.util.test.FsUtil;
import libcore.io.IoUtils;
import libcore.io.Streams;
@@ -71,7 +72,7 @@ public class NetworkStatsFactoryTest extends NetworkStatsBaseTest {
public void setUp() throws Exception {
mTestProc = new File(InstrumentationRegistry.getContext().getFilesDir(), "proc");
if (mTestProc.exists()) {
IoUtils.deleteContents(mTestProc);
FsUtil.deleteContents(mTestProc);
}
// The libandroid_servers which have the native method is not available to
@@ -87,7 +88,7 @@ public class NetworkStatsFactoryTest extends NetworkStatsBaseTest {
mFactory = null;
if (mTestProc.exists()) {
IoUtils.deleteContents(mTestProc);
FsUtil.deleteContents(mTestProc);
}
}

View File

@@ -112,13 +112,12 @@ import androidx.test.runner.AndroidJUnit4;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.test.BroadcastInterceptingContext;
import com.android.internal.util.test.FsUtil;
import com.android.server.net.NetworkStatsService.NetworkStatsSettings;
import com.android.server.net.NetworkStatsService.NetworkStatsSettings.Config;
import com.android.testutils.HandlerUtils;
import com.android.testutils.TestableNetworkStatsProviderBinder;
import libcore.io.IoUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
@@ -215,7 +214,7 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
mServiceContext = new MockContext(context);
mStatsDir = context.getFilesDir();
if (mStatsDir.exists()) {
IoUtils.deleteContents(mStatsDir);
FsUtil.deleteContents(mStatsDir);
}
PowerManager powerManager = (PowerManager) mServiceContext.getSystemService(
@@ -285,7 +284,7 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
@After
public void tearDown() throws Exception {
IoUtils.deleteContents(mStatsDir);
FsUtil.deleteContents(mStatsDir);
mServiceContext = null;
mStatsDir = null;