Move IoUtils#deleteContents from CorePlatformApi set to framework
As a part of internal core libraries cleanup move usages of IoUtils#deleteContents from CorePlatformApi set to framework. Bug: 154796679 Test: m update-api Change-Id: If7037029026b6753ab64be09aa52c40e04d5c7b1
This commit is contained in:
@@ -43,6 +43,7 @@ import androidx.test.filters.SmallTest;
|
|||||||
import androidx.test.runner.AndroidJUnit4;
|
import androidx.test.runner.AndroidJUnit4;
|
||||||
|
|
||||||
import com.android.frameworks.tests.net.R;
|
import com.android.frameworks.tests.net.R;
|
||||||
|
import com.android.internal.util.test.FsUtil;
|
||||||
|
|
||||||
import libcore.io.IoUtils;
|
import libcore.io.IoUtils;
|
||||||
import libcore.io.Streams;
|
import libcore.io.Streams;
|
||||||
@@ -71,7 +72,7 @@ public class NetworkStatsFactoryTest extends NetworkStatsBaseTest {
|
|||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
mTestProc = new File(InstrumentationRegistry.getContext().getFilesDir(), "proc");
|
mTestProc = new File(InstrumentationRegistry.getContext().getFilesDir(), "proc");
|
||||||
if (mTestProc.exists()) {
|
if (mTestProc.exists()) {
|
||||||
IoUtils.deleteContents(mTestProc);
|
FsUtil.deleteContents(mTestProc);
|
||||||
}
|
}
|
||||||
|
|
||||||
// The libandroid_servers which have the native method is not available to
|
// The libandroid_servers which have the native method is not available to
|
||||||
@@ -87,7 +88,7 @@ public class NetworkStatsFactoryTest extends NetworkStatsBaseTest {
|
|||||||
mFactory = null;
|
mFactory = null;
|
||||||
|
|
||||||
if (mTestProc.exists()) {
|
if (mTestProc.exists()) {
|
||||||
IoUtils.deleteContents(mTestProc);
|
FsUtil.deleteContents(mTestProc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -112,13 +112,12 @@ import androidx.test.runner.AndroidJUnit4;
|
|||||||
|
|
||||||
import com.android.internal.util.ArrayUtils;
|
import com.android.internal.util.ArrayUtils;
|
||||||
import com.android.internal.util.test.BroadcastInterceptingContext;
|
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;
|
||||||
import com.android.server.net.NetworkStatsService.NetworkStatsSettings.Config;
|
import com.android.server.net.NetworkStatsService.NetworkStatsSettings.Config;
|
||||||
import com.android.testutils.HandlerUtils;
|
import com.android.testutils.HandlerUtils;
|
||||||
import com.android.testutils.TestableNetworkStatsProviderBinder;
|
import com.android.testutils.TestableNetworkStatsProviderBinder;
|
||||||
|
|
||||||
import libcore.io.IoUtils;
|
|
||||||
|
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.junit.Ignore;
|
import org.junit.Ignore;
|
||||||
@@ -213,7 +212,7 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
|
|||||||
mServiceContext = new MockContext(context);
|
mServiceContext = new MockContext(context);
|
||||||
mStatsDir = context.getFilesDir();
|
mStatsDir = context.getFilesDir();
|
||||||
if (mStatsDir.exists()) {
|
if (mStatsDir.exists()) {
|
||||||
IoUtils.deleteContents(mStatsDir);
|
FsUtil.deleteContents(mStatsDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerManager powerManager = (PowerManager) mServiceContext.getSystemService(
|
PowerManager powerManager = (PowerManager) mServiceContext.getSystemService(
|
||||||
@@ -283,7 +282,7 @@ public class NetworkStatsServiceTest extends NetworkStatsBaseTest {
|
|||||||
|
|
||||||
@After
|
@After
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
IoUtils.deleteContents(mStatsDir);
|
FsUtil.deleteContents(mStatsDir);
|
||||||
|
|
||||||
mServiceContext = null;
|
mServiceContext = null;
|
||||||
mStatsDir = null;
|
mStatsDir = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user