Merge Android R

Bug: 168057903
Merged-In: Ice3e441cc9c0df8d0a6acc016bb74375e081bd67
Change-Id: I1d85742f594be2007c99841b290e502b6ede624e
This commit is contained in:
Xin Li
2020-09-09 20:21:10 -07:00
11 changed files with 23 additions and 90 deletions

View File

@@ -35,7 +35,9 @@ java_defaults {
"net-utils-device-common",
],
libs: [
"framework-statsd.stubs.module_lib",
"framework-tethering.impl",
"framework-wifi",
"unsupportedappusage",
],
plugins: ["java_api_finder"],
@@ -98,7 +100,7 @@ java_defaults {
"res",
],
libs: [
"framework-tethering.impl",
"framework-tethering",
],
jarjar_rules: "jarjar-rules.txt",
optimize: {

View File

@@ -20,8 +20,10 @@
<application android:hasCode="false" />
<!-- b/145383354: Current minSdk is locked to Q for development cycle, lock it to next version
before ship. -->
<uses-sdk
<!-- TODO: Uncomment this when the R API level is fixed. b/148281152 -->
<!--uses-sdk
android:minSdkVersion="29"
android:targetSdkVersion="29"
/>
-->
</manifest>

View File

@@ -1,4 +1,4 @@
{
"name": "com.android.tethering",
"version": 290000000
"version": 300000000
}

View File

@@ -16,19 +16,9 @@
java_sdk_library {
name: "framework-tethering",
defaults: ["framework-module-defaults"],
impl_library_visibility: ["//frameworks/base/packages/Tethering:__subpackages__"],
// Allow access to the stubs from anywhere.
visibility: ["//visibility:public"],
// Restrict access to implementation library.
impl_library_visibility: [
"//visibility:override", // Ignore the visibility property.
"//frameworks/base/packages/Tethering:__subpackages__",
],
srcs: [
":framework-tethering-srcs",
],
srcs: [":framework-tethering-srcs"],
jarjar_rules: "jarjar-rules.txt",
installable: true,

View File

@@ -1,39 +0,0 @@
// Baseline format: 1.0
ActionValue: android.net.TetheringConstants#EXTRA_ADD_TETHER_TYPE:
Inconsistent extra value; expected `android.net.extra.ADD_TETHER_TYPE`, was `extraAddTetherType`
ActionValue: android.net.TetheringConstants#EXTRA_PROVISION_CALLBACK:
Inconsistent extra value; expected `android.net.extra.PROVISION_CALLBACK`, was `extraProvisionCallback`
ActionValue: android.net.TetheringConstants#EXTRA_REM_TETHER_TYPE:
Inconsistent extra value; expected `android.net.extra.REM_TETHER_TYPE`, was `extraRemTetherType`
ActionValue: android.net.TetheringConstants#EXTRA_RUN_PROVISION:
Inconsistent extra value; expected `android.net.extra.RUN_PROVISION`, was `extraRunProvision`
ActionValue: android.net.TetheringConstants#EXTRA_SET_ALARM:
Inconsistent extra value; expected `android.net.extra.SET_ALARM`, was `extraSetAlarm`
ActionValue: android.net.TetheringManager#ACTION_TETHER_STATE_CHANGED:
Inconsistent action value; expected `android.net.action.TETHER_STATE_CHANGED`, was `android.net.conn.TETHER_STATE_CHANGED`
ActionValue: android.net.TetheringManager#EXTRA_ACTIVE_TETHER:
Inconsistent extra value; expected `android.net.extra.ACTIVE_TETHER`, was `tetherArray`
ActionValue: android.net.TetheringManager#EXTRA_AVAILABLE_TETHER:
Inconsistent extra value; expected `android.net.extra.AVAILABLE_TETHER`, was `availableArray`
ActionValue: android.net.TetheringManager#EXTRA_ERRORED_TETHER:
Inconsistent extra value; expected `android.net.extra.ERRORED_TETHER`, was `erroredArray`
CallbackInterface: android.net.TetheringManager.StartTetheringCallback:
Callbacks must be abstract class instead of interface to enable extension in future API levels: StartTetheringCallback
CallbackInterface: android.net.TetheringManager.TetheringEventCallback:
Callbacks must be abstract class instead of interface to enable extension in future API levels: TetheringEventCallback
ManagerConstructor: android.net.TetheringManager#TetheringManager(android.content.Context, java.util.function.Supplier<android.os.IBinder>):
Managers must always be obtained from Context; no direct constructors
MissingGetterMatchingBuilder: android.net.TetheringManager.TetheringRequest.Builder#setShouldShowEntitlementUi(boolean):
android.net.TetheringManager.TetheringRequest does not declare a `shouldShowEntitlementUi()` method matching method android.net.TetheringManager.TetheringRequest.Builder.setShouldShowEntitlementUi(boolean)
MissingGetterMatchingBuilder: android.net.TetheringManager.TetheringRequest.Builder#setStaticIpv4Addresses(android.net.LinkAddress, android.net.LinkAddress):
android.net.TetheringManager.TetheringRequest does not declare a `getStaticIpv4Addresses()` method matching method android.net.TetheringManager.TetheringRequest.Builder.setStaticIpv4Addresses(android.net.LinkAddress,android.net.LinkAddress)
StaticFinalBuilder: android.net.TetheringManager.TetheringRequest.Builder:
Builder must be final: android.net.TetheringManager.TetheringRequest.Builder

View File

@@ -1,25 +0,0 @@
// Baseline format: 1.0
ActionValue: android.net.TetheringManager#ACTION_TETHER_STATE_CHANGED:
Inconsistent action value; expected `android.net.action.TETHER_STATE_CHANGED`, was `android.net.conn.TETHER_STATE_CHANGED`
ActionValue: android.net.TetheringManager#EXTRA_ACTIVE_TETHER:
Inconsistent extra value; expected `android.net.extra.ACTIVE_TETHER`, was `tetherArray`
ActionValue: android.net.TetheringManager#EXTRA_AVAILABLE_TETHER:
Inconsistent extra value; expected `android.net.extra.AVAILABLE_TETHER`, was `availableArray`
ActionValue: android.net.TetheringManager#EXTRA_ERRORED_TETHER:
Inconsistent extra value; expected `android.net.extra.ERRORED_TETHER`, was `erroredArray`
CallbackInterface: android.net.TetheringManager.StartTetheringCallback:
Callbacks must be abstract class instead of interface to enable extension in future API levels: StartTetheringCallback
CallbackInterface: android.net.TetheringManager.TetheringEventCallback:
Callbacks must be abstract class instead of interface to enable extension in future API levels: TetheringEventCallback
MissingGetterMatchingBuilder: android.net.TetheringManager.TetheringRequest.Builder#setShouldShowEntitlementUi(boolean):
android.net.TetheringManager.TetheringRequest does not declare a `shouldShowEntitlementUi()` method matching method android.net.TetheringManager.TetheringRequest.Builder.setShouldShowEntitlementUi(boolean)
MissingGetterMatchingBuilder: android.net.TetheringManager.TetheringRequest.Builder#setStaticIpv4Addresses(android.net.LinkAddress, android.net.LinkAddress):
android.net.TetheringManager.TetheringRequest does not declare a `getStaticIpv4Addresses()` method matching method android.net.TetheringManager.TetheringRequest.Builder.setStaticIpv4Addresses(android.net.LinkAddress,android.net.LinkAddress)
StaticFinalBuilder: android.net.TetheringManager.TetheringRequest.Builder:
Builder must be final: android.net.TetheringManager.TetheringRequest.Builder

View File

@@ -290,7 +290,7 @@ public class TetheringManager {
new Thread(() -> {
while (true) {
try {
Thread.sleep(200);
Thread.sleep(CONNECTOR_POLL_INTERVAL_MILLIS);
} catch (InterruptedException e) {
// Not much to do here, the system needs to wait for the connector
}

View File

@@ -51,8 +51,10 @@
<!-- List of regexpressions describing the interface (if any) that represent tetherable
Wifi P2P interfaces. If the device doesn't want to support tethering over Wifi P2p this
should be empty. An example would be "p2p-p2p.*" -->
should be empty. An example would be "p2p-p2p\\d-.*" -->
<string-array translatable="false" name="config_tether_wifi_p2p_regexs">
<item>"p2p-p2p\\d-.*"</item>
<item>"p2p\\d"</item>
</string-array>
<!-- List of regexpressions describing the interface (if any) that represent tetherable

View File

@@ -638,7 +638,7 @@ public class Tethering {
mLog.e("setWifiTethering: failed to get WifiManager!");
return TETHER_ERROR_SERVICE_UNAVAIL;
}
if ((enable && mgr.startSoftAp(null /* use existing wifi config */))
if ((enable && mgr.startTetheredHotspot(null /* use existing softap config */))
|| (!enable && mgr.stopSoftAp())) {
mWifiTetherRequested = enable;
return TETHER_ERROR_NO_ERROR;

View File

@@ -60,6 +60,7 @@ java_defaults {
"framework-minus-apex",
"framework-res",
"framework-tethering.impl",
"framework-wifi.stubs.module_lib",
],
jni_libs: [
// For mockito extended

View File

@@ -116,7 +116,7 @@ import android.net.ip.RouterAdvertisementDaemon;
import android.net.util.InterfaceParams;
import android.net.util.NetworkConstants;
import android.net.util.SharedLog;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.SoftApConfiguration;
import android.net.wifi.WifiManager;
import android.net.wifi.p2p.WifiP2pGroup;
import android.net.wifi.p2p.WifiP2pInfo;
@@ -983,12 +983,12 @@ public class TetheringTest {
// TODO: Test with and without interfaceStatusChanged().
@Test
public void failingWifiTetheringLegacyApBroadcast() throws Exception {
when(mWifiManager.startSoftAp(any(WifiConfiguration.class))).thenReturn(true);
when(mWifiManager.startTetheredHotspot(any(SoftApConfiguration.class))).thenReturn(true);
// Emulate pressing the WiFi tethering button.
mTethering.startTethering(createTetheringRequestParcel(TETHERING_WIFI), null);
mLooper.dispatchAll();
verify(mWifiManager, times(1)).startSoftAp(null);
verify(mWifiManager, times(1)).startTetheredHotspot(null);
verifyNoMoreInteractions(mWifiManager);
verifyNoMoreInteractions(mNetd);
@@ -1011,12 +1011,12 @@ public class TetheringTest {
// TODO: Test with and without interfaceStatusChanged().
@Test
public void workingWifiTetheringEnrichedApBroadcast() throws Exception {
when(mWifiManager.startSoftAp(any(WifiConfiguration.class))).thenReturn(true);
when(mWifiManager.startTetheredHotspot(any(SoftApConfiguration.class))).thenReturn(true);
// Emulate pressing the WiFi tethering button.
mTethering.startTethering(createTetheringRequestParcel(TETHERING_WIFI), null);
mLooper.dispatchAll();
verify(mWifiManager, times(1)).startSoftAp(null);
verify(mWifiManager, times(1)).startTetheredHotspot(null);
verifyNoMoreInteractions(mWifiManager);
verifyNoMoreInteractions(mNetd);
@@ -1087,13 +1087,13 @@ public class TetheringTest {
// TODO: Test with and without interfaceStatusChanged().
@Test
public void failureEnablingIpForwarding() throws Exception {
when(mWifiManager.startSoftAp(any(WifiConfiguration.class))).thenReturn(true);
when(mWifiManager.startTetheredHotspot(any(SoftApConfiguration.class))).thenReturn(true);
doThrow(new RemoteException()).when(mNetd).ipfwdEnableForwarding(TETHERING_NAME);
// Emulate pressing the WiFi tethering button.
mTethering.startTethering(createTetheringRequestParcel(TETHERING_WIFI), null);
mLooper.dispatchAll();
verify(mWifiManager, times(1)).startSoftAp(null);
verify(mWifiManager, times(1)).startTetheredHotspot(null);
verifyNoMoreInteractions(mWifiManager);
verifyNoMoreInteractions(mNetd);
@@ -1380,7 +1380,7 @@ public class TetheringTest {
// 2. Enable wifi tethering.
UpstreamNetworkState upstreamState = buildMobileDualStackUpstreamState();
initTetheringUpstream(upstreamState);
when(mWifiManager.startSoftAp(any(WifiConfiguration.class))).thenReturn(true);
when(mWifiManager.startTetheredHotspot(any(SoftApConfiguration.class))).thenReturn(true);
mTethering.interfaceStatusChanged(TEST_WLAN_IFNAME, true);
mLooper.dispatchAll();
tetherState = callback.pollTetherStatesChanged();