Apply admin restriction when network reset is disallowed
- Refactored network restriction checking logic into a checker class to share across different places - Added test Test: make RunSettingsRoboTests Change-Id: I6b7ea78f28fd1b61aacb070c377821150e441a74 Fix: 37134598
This commit is contained in:
@@ -22,13 +22,16 @@ import com.android.settings.core.PreferenceController;
|
||||
|
||||
public class NetworkResetPreferenceController extends PreferenceController {
|
||||
|
||||
private final NetworkResetRestrictionChecker mRestrictionChecker;
|
||||
|
||||
public NetworkResetPreferenceController(Context context) {
|
||||
super(context);
|
||||
mRestrictionChecker = new NetworkResetRestrictionChecker(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return NetworkResetActionMenuController.isAvailable(mContext);
|
||||
return !mRestrictionChecker.hasRestriction();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user