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

Commit 7c3a2d8c authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fixed Settings crashes issues in WEP Wi-Fi networks" into main

parents 4b974c3d ed450728
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -510,9 +510,9 @@ open class WifiUtils {
                        AdvancedProtectionManager.FEATURE_ID_DISALLOW_WEP,
                        AdvancedProtectionManager.SUPPORT_DIALOG_TYPE_BLOCKED_INTERACTION)
                    intent.putExtra(DIALOG_WINDOW_TYPE, dialogWindowType)
                    onStartActivity(intent)
                    withContext(Dispatchers.Main) { onStartActivity(intent) }
                } else if (wifiManager.isWepSupported == true && wifiManager.queryWepAllowed()) {
                    onAllowed()
                    withContext(Dispatchers.Main) { onAllowed() }
                } else {
                    val intent = Intent(Intent.ACTION_MAIN).apply {
                        component = ComponentName(
@@ -522,7 +522,7 @@ open class WifiUtils {
                        putExtra(DIALOG_WINDOW_TYPE, dialogWindowType)
                        putExtra(SSID, ssid)
                    }.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                    onStartActivity(intent)
                    withContext(Dispatchers.Main) { onStartActivity(intent) }
                }
            }

+3 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;

@@ -211,10 +212,12 @@ public class WifiUtilsTest {
        WifiUtils.InternetIconInjector iconInjector = new WifiUtils.InternetIconInjector(mContext);

        for (int level = 0; level <= 4; level++) {
            Mockito.reset(mContext);
            iconInjector.getIcon(false /* noInternet */, level);
            verify(mContext).getDrawable(
                    WifiUtils.getInternetIconResource(level, false /* noInternet */));

            Mockito.reset(mContext);
            iconInjector.getIcon(true /* noInternet */, level);
            verify(mContext).getDrawable(
                    WifiUtils.getInternetIconResource(level, true /* noInternet */));