Show policy transparency dialog if adding Wi-Fi config is not allowed

- When the user is restricted by UserManager.DISALLOW_ADD_WIFI_CONFIG, clicking on a Wi-Fi network will show the Settings policy transparency dialog.

- The "Not allowed by your organization" summary in Wi-Fi networks will be removed in a separate CL.

Bug: 233871529
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=Wifi

Change-Id: Ia978be8e85a5809de1331f3e0edc11fbc8925c80
This commit is contained in:
Weng Su
2022-10-07 02:08:57 +08:00
parent a27418931c
commit a81bb19618
9 changed files with 68 additions and 42 deletions

View File

@@ -36,6 +36,7 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.test.InstrumentationRegistry;
import com.android.settings.wifi.ShadowRestrictedPreference;
import com.android.settings.wifi.WifiEntryPreference;
import com.android.wifitrackerlib.SavedNetworkTracker;
import com.android.wifitrackerlib.WifiEntry;
@@ -45,10 +46,12 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.MockitoAnnotations;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
import java.util.Arrays;
@RunWith(RobolectricTestRunner.class)
@Config(shadows = ShadowRestrictedPreference.class)
public class WifiNetworkListFragmentTest {
private WifiNetworkListFragment mWifiNetworkListFragment;
private Context mContext;