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

Commit 0002daed authored by Oliver Scott's avatar Oliver Scott Committed by Michael Bestas
Browse files

Only modify network settings on system user

Captive portal, wi-fi and mobile data should not be modified for secondary users without user intervention

Issue: calyxos#1025
Change-Id: Ic24d18268d05b5a1535b3993bdd0a614055847f6
parent 8e8329a0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -312,9 +312,11 @@ public abstract class BaseSetupWizardActivity extends Activity implements Naviga
    }

    protected void onSetupStart() {
        if (SetupWizardUtils.isOwner()) {
            SetupWizardUtils.disableCaptivePortalDetection(getApplicationContext());
            tryEnablingWifi();
        }
    }

    protected void exitIfSetupComplete() {
        if (WizardManagerHelper.isUserSetupComplete(this)) {
+3 −1
Original line number Diff line number Diff line
@@ -37,7 +37,9 @@ public class NetworkSetupActivity extends WrapperSubBaseActivity {

    @Override
    protected void onStartSubactivity() {
        if (SetupWizardUtils.isOwner()) {
            tryEnablingWifi();
        }
        Intent intent = new Intent(ACTION_SETUP_NETWORK);
        if (SetupWizardUtils.hasLeanback(this)) {
            intent.setComponent(SetupWizardUtils.sTvWifiSetupSettingsActivity);
+3 −1
Original line number Diff line number Diff line
@@ -95,7 +95,9 @@ public class SetupWizardApp extends Application {
        NetworkMonitor.initInstance(this);
        PhoneMonitor.initInstance(this);
        SetupWizardUtils.disableComponentsForMissingFeatures(this);
        if (SetupWizardUtils.isOwner()) {
            SetupWizardUtils.setMobileDataEnabled(this, false);
        }
        sStatusBarManager = SetupWizardUtils.disableStatusBar(this);
        mHandler.postDelayed(mRadioTimeoutRunnable, SetupWizardApp.RADIO_READY_TIMEOUT);
    }
+3 −1
Original line number Diff line number Diff line
@@ -40,7 +40,9 @@ public class SetupWizardExitActivity extends BaseSetupWizardActivity {
        if (LOGV) {
            Log.v(TAG, "onCreate savedInstanceState=" + savedInstanceState);
        }
        if (SetupWizardUtils.isOwner()) {
            SetupWizardUtils.enableCaptivePortalDetection(this);
        }
        PhoneMonitor.onSetupFinished();
        if (!getSystemService(UserManager.class).isManagedProfile()) {
            launchHome();