Remove NetworkMonitor dependency on ICaptivePortal

ICaptivePortal is used in the framework and cannot be used as a
dependency in NetworkMonitor, as the framework class takes precedence
when linking.
Also fix NetworkMonitorTest that was not verifying the right
startCaptivePortalApp call.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 124033493
Change-Id: I8e7bb79e50650ae182a2e4277fb49abf5fb6d910
Merged-In: Ib6a89e54312628662b130fbeec18d11e139f09fa
This commit is contained in:
Remi NGUYEN VAN
2019-02-13 20:58:59 +09:00
parent dacee147b4
commit cfff01e2db
11 changed files with 83 additions and 53 deletions

View File

@@ -3911,15 +3911,16 @@ public class ConnectivityManager {
*
* <p>This endpoint is exclusively for use by the NetworkStack and is protected by the
* corresponding permission.
* @param network Network on which the captive portal was detected.
* @param appExtras Extras to include in the app start intent.
* @hide
*/
@SystemApi
@TestApi
@RequiresPermission(NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK)
public void startCaptivePortalApp(Bundle appExtras) {
public void startCaptivePortalApp(Network network, Bundle appExtras) {
try {
mService.startCaptivePortalAppInternal(appExtras);
mService.startCaptivePortalAppInternal(network, appExtras);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}

View File

@@ -168,7 +168,7 @@ interface IConnectivityManager
void setAcceptUnvalidated(in Network network, boolean accept, boolean always);
void setAvoidUnvalidated(in Network network);
void startCaptivePortalApp(in Network network);
void startCaptivePortalAppInternal(in Bundle appExtras);
void startCaptivePortalAppInternal(in Network network, in Bundle appExtras);
boolean getAvoidBadWifi();
int getMultipathPreference(in Network Network);

View File

@@ -34,6 +34,7 @@ oneway interface INetworkMonitor {
void start();
void launchCaptivePortalApp();
void notifyCaptivePortalAppFinished(int response);
void forceReevaluation(int uid);
void notifyPrivateDnsChanged(in PrivateDnsConfigParcel config);
void notifyDnsResponse(int returnCode);

View File

@@ -26,5 +26,4 @@ oneway interface INetworkMonitorCallbacks {
void notifyPrivateDnsConfigResolved(in PrivateDnsConfigParcel config);
void showProvisioningNotification(String action, String packageName);
void hideProvisioningNotification();
void logCaptivePortalLoginEvent(int eventId, String packageName);
}