Cleanup of Test Network service
This follow-up change performs some cleanup changes without affecting functionality Bug: 72950854 Test: Compiles, CTS tests using this pass Change-Id: Ic7394f24f11d713c9374b438182e29d2a02ea236 Merged-In: Ic7394f24f11d713c9374b438182e29d2a02ea236 (cherry picked from commit 7df36ed96a807f258aef43e558ef127b27b90756)
This commit is contained in:
@@ -27,8 +27,6 @@ import android.os.Parcelable;
|
|||||||
*/
|
*/
|
||||||
@TestApi
|
@TestApi
|
||||||
public final class TestNetworkInterface implements Parcelable {
|
public final class TestNetworkInterface implements Parcelable {
|
||||||
private static final String TAG = "TestNetworkInterface";
|
|
||||||
|
|
||||||
private final ParcelFileDescriptor mFileDescriptor;
|
private final ParcelFileDescriptor mFileDescriptor;
|
||||||
private final String mInterfaceName;
|
private final String mInterfaceName;
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ package android.net;
|
|||||||
|
|
||||||
import android.annotation.NonNull;
|
import android.annotation.NonNull;
|
||||||
import android.annotation.TestApi;
|
import android.annotation.TestApi;
|
||||||
import android.content.Context;
|
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
|
||||||
@@ -33,11 +32,9 @@ public class TestNetworkManager {
|
|||||||
@NonNull private static final String TAG = TestNetworkManager.class.getSimpleName();
|
@NonNull private static final String TAG = TestNetworkManager.class.getSimpleName();
|
||||||
|
|
||||||
@NonNull private final ITestNetworkManager mService;
|
@NonNull private final ITestNetworkManager mService;
|
||||||
@NonNull private final Context mContext;
|
|
||||||
|
|
||||||
/** @hide */
|
/** @hide */
|
||||||
public TestNetworkManager(@NonNull Context context, @NonNull ITestNetworkManager service) {
|
public TestNetworkManager(@NonNull ITestNetworkManager service) {
|
||||||
mContext = Preconditions.checkNotNull(context, "missing Context");
|
|
||||||
mService = Preconditions.checkNotNull(service, "missing ITestNetworkManager");
|
mService = Preconditions.checkNotNull(service, "missing ITestNetworkManager");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ class TestNetworkService extends ITestNetworkManager.Stub {
|
|||||||
public void teardownTestNetwork(int netId) {
|
public void teardownTestNetwork(int netId) {
|
||||||
enforceTestNetworkPermissions(mContext);
|
enforceTestNetworkPermissions(mContext);
|
||||||
|
|
||||||
TestNetworkAgent agent;
|
final TestNetworkAgent agent;
|
||||||
synchronized (mTestNetworkTracker) {
|
synchronized (mTestNetworkTracker) {
|
||||||
agent = mTestNetworkTracker.get(netId);
|
agent = mTestNetworkTracker.get(netId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user