Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b85d8753 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN
Browse files

Prepare CaptivePortalLogin for system_current

Includes small changes to stop using non-SystemApi endpoints.

Test: make CaptivePortalLogin
Test: flashed, login works, SSL certificate invalid flow works
Bug: 112869080
Merged-In: Ic6ce98942959705ea7ef14a7a62d33e3abf7eb72
Change-Id: Ie7ea3bab6aa8629ce4c111adee0c0699d95d4b0e
parent 5b364519
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -109,6 +109,8 @@ public class NetworkMonitor extends StateMachine {
    private static final boolean DBG  = true;
    private static final boolean VDBG = false;
    private static final boolean VDBG_STALL = Log.isLoggable(TAG, Log.DEBUG);
    // TODO: use another permission for CaptivePortalLoginActivity once it has its own certificate
    private static final String PERMISSION_NETWORK_SETTINGS = "android.permission.NETWORK_SETTINGS";
    // Default configuration values for captive portal detection probes.
    // TODO: append a random length parameter to the default HTTPS url.
    // TODO: randomize browser version ids in the default User-Agent String.
@@ -682,7 +684,7 @@ public class NetworkMonitor extends StateMachine {
                                public void appResponse(int response) {
                                    if (response == APP_RETURN_WANTED_AS_IS) {
                                        mContext.enforceCallingPermission(
                                                android.Manifest.permission.CONNECTIVITY_INTERNAL,
                                                PERMISSION_NETWORK_SETTINGS,
                                                "CaptivePortal");
                                    }
                                    sendMessage(CMD_CAPTIVE_PORTAL_APP_FINISHED, response);
@@ -692,7 +694,7 @@ public class NetworkMonitor extends StateMachine {
                                public void logEvent(int eventId, String packageName)
                                        throws RemoteException {
                                    mContext.enforceCallingPermission(
                                            android.Manifest.permission.CONNECTIVITY_INTERNAL,
                                            PERMISSION_NETWORK_SETTINGS,
                                            "CaptivePortal");
                                    mCallback.logCaptivePortalLoginEvent(eventId, packageName);
                                }