[RESTRICT AUTOMERGE] Restrict WifiDialogActivity am: a0409e582c
am: b33f9b8f8a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/26069282 Change-Id: Ie7548054d0a3a63086427b9398e8dd16d84fafd6 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -18,6 +18,7 @@ package com.android.settings.wifi;
|
||||
|
||||
import static android.Manifest.permission.ACCESS_COARSE_LOCATION;
|
||||
import static android.Manifest.permission.ACCESS_FINE_LOCATION;
|
||||
import static android.os.UserManager.DISALLOW_ADD_WIFI_CONFIG;
|
||||
import static android.os.UserManager.DISALLOW_CONFIG_WIFI;
|
||||
|
||||
import static com.android.settings.wifi.WifiDialogActivity.REQUEST_CODE_WIFI_DPP_ENROLLEE_QR_CODE_SCANNER;
|
||||
@@ -240,6 +241,20 @@ public class WifiDialogActivityTest {
|
||||
assertThat(mActivity.isConfigWifiAllowed()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isAddWifiConfigAllowed_hasNoUserRestriction_returnTrue() {
|
||||
when(mUserManager.hasUserRestriction(DISALLOW_ADD_WIFI_CONFIG)).thenReturn(false);
|
||||
|
||||
assertThat(mActivity.isAddWifiConfigAllowed()).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void isAddWifiConfigAllowed_hasUserRestriction_returnFalse() {
|
||||
when(mUserManager.hasUserRestriction(DISALLOW_ADD_WIFI_CONFIG)).thenReturn(true);
|
||||
|
||||
assertThat(mActivity.isAddWifiConfigAllowed()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void hasPermissionForResult_noCallingPackage_returnFalse() {
|
||||
when(mActivity.getCallingPackage()).thenReturn(null);
|
||||
|
Reference in New Issue
Block a user