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

Unverified Commit 19673961 authored by Michael W's avatar Michael W Committed by Michael Bestas
Browse files

SystemUI: Internet tile: Allow long-pressing on mobile network

* The current WiFi network has a setting toggle and also opens the
  settings on single click where the mobile network only allows
  connecting but not opening settings
* Add a long press listener that goes to the subId's network settings,
  allowing for example to disable roaming or change network

Change-Id: Iacc1c64d318b0240da5397f2b4e4dfb59d4834dd
parent a77a95df
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -808,6 +808,10 @@ public class InternetDetailsContentController implements AccessPointController.A

    void launchMobileNetworkSettings(View view) {
        final int subId = getActiveAutoSwitchNonDdsSubId();
        launchMobileNetworkSettings(view, subId);
    }

    void launchMobileNetworkSettings(View view, int subId) {
        if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
            Log.w(TAG, "launchMobileNetworkSettings fail, invalid subId:" + subId);
            return;
+8 −0
Original line number Diff line number Diff line
@@ -356,6 +356,7 @@ public class InternetDialogDelegateLegacy implements
        }
        mLifecycleRegistry.setCurrentState(Lifecycle.State.DESTROYED);
        mMobileNetworkLayout.setOnClickListener(null);
        mMobileNetworkLayout.setOnLongClickListener(null);
        mConnectedWifListLayout.setOnClickListener(null);
        if (mSecondaryMobileNetworkLayout != null) {
            mSecondaryMobileNetworkLayout.setOnClickListener(null);
@@ -463,6 +464,13 @@ public class InternetDialogDelegateLegacy implements
            }
            mInternetDetailsContentController.connectCarrierNetwork();
        });
        mMobileNetworkLayout.setOnLongClickListener(v -> {
            if (!mInternetDetailsContentController.isDeviceLocked()) {
                mInternetDetailsContentController.launchMobileNetworkSettings(v, mDefaultDataSubId);
                return true;
            }
            return false;
        });
        mMobileDataToggle.setOnClickListener(v -> {
            boolean isChecked = mMobileDataToggle.isChecked();
            if (!isChecked && shouldShowMobileDialog()) {