[CS10]Remove the hidden API usage of BitUtils

The connection service will become the main line module.
It is difficult to include BitUtils in the module. and so
Move the hidden API needed in BitUtils to NetworkCapabilitiesUtils.

Bug: 170598012
Test: atest ConnectivityServiceTest
      atest NetworkCapabilitiesTest
      atest DnsUtilsTest
Change-Id: Ibc81827e25a54fc3ff94f78d810fe4f5073e3a98
This commit is contained in:
lifr 2021-03-04 14:08:08 +08:00 • committed by Frank Li
commit c33ea4de7d

View file

@ -29,8 +29,6 @@ import android.system.ErrnoException;
import android.system.Os;
import android.util.Log;
import com.android.internal.util.BitUtils;
import libcore.io.IoUtils;
import java.io.FileDescriptor;
@ -332,7 +330,7 @@ public class DnsUtils {
if (srcByte[i] == dstByte[i]) {
continue;
}
int x = BitUtils.uint8(srcByte[i]) ^ BitUtils.uint8(dstByte[i]);
int x = (srcByte[i] & 0xff) ^ (dstByte[i] & 0xff);
return i * CHAR_BIT + (Integer.numberOfLeadingZeros(x) - 24); // Java ints are 32 bits
}
return dstByte.length * CHAR_BIT;