Merge "Replace @hide APIs in IpSecService" am: e2c0dcfe1c am: 7633796ca2

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1870457

Change-Id: I3a8a8c3df2d71ed190b0f42d0116ecc0f6079db8
This commit is contained in:
Paul Hu
2021-11-01 07:02:00 +00:00
committed by Automerger Merge Worker

View File

@@ -58,13 +58,13 @@ import android.system.OsConstants;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.util.Range; import android.util.Range;
import android.util.Slog;
import android.util.SparseArray; import android.util.SparseArray;
import android.util.SparseBooleanArray; import android.util.SparseBooleanArray;
import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.GuardedBy;
import com.android.internal.annotations.VisibleForTesting; import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.Preconditions; import com.android.internal.util.Preconditions;
import com.android.net.module.util.BinderUtils;
import com.android.net.module.util.NetdUtils; import com.android.net.module.util.NetdUtils;
import com.android.net.module.util.PermissionUtils; import com.android.net.module.util.PermissionUtils;
@@ -1056,9 +1056,9 @@ public class IpSecService extends IIpSecService.Stub {
public void systemReady() { public void systemReady() {
if (isNetdAlive()) { if (isNetdAlive()) {
Slog.d(TAG, "IpSecService is ready"); Log.d(TAG, "IpSecService is ready");
} else { } else {
Slog.wtf(TAG, "IpSecService not ready: failed to connect to NetD Native Service!"); Log.wtf(TAG, "IpSecService not ready: failed to connect to NetD Native Service!");
} }
} }
@@ -1332,7 +1332,7 @@ public class IpSecService extends IIpSecService.Stub {
final INetd netd = mSrvConfig.getNetdInstance(); final INetd netd = mSrvConfig.getNetdInstance();
netd.ipSecAddTunnelInterface(intfName, localAddr, remoteAddr, ikey, okey, resourceId); netd.ipSecAddTunnelInterface(intfName, localAddr, remoteAddr, ikey, okey, resourceId);
Binder.withCleanCallingIdentity(() -> { BinderUtils.withCleanCallingIdentity(() -> {
NetdUtils.setInterfaceUp(netd, intfName); NetdUtils.setInterfaceUp(netd, intfName);
}); });