Remove ConnectivityManager from EnterprisePrivacyFeatureProvider.

It is only used in GlobalHttpPreferenceController. Move it there.

Bug: 173331190
Test: atest SettingsRoboTests
Change-Id: I62c589679052b276927d057d3d5d084bbfb57626
This commit is contained in:
Lorenzo Colitti
2021-02-18 16:32:47 +09:00
parent 5c9a042370
commit cacf9aa485
5 changed files with 10 additions and 34 deletions

View File

@@ -84,11 +84,6 @@ public interface EnterprisePrivacyFeatureProvider {
*/
boolean isAlwaysOnVpnSetInManagedProfile();
/**
* Returns whether the Device Owner set a recommended global HTTP proxy.
*/
boolean isGlobalHttpProxySet();
/**
* Returns the number of failed login attempts that the Device Owner or Profile Owner allows
* before the current user is wiped, or zero if no such limit is set.

View File

@@ -146,11 +146,6 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
VpnUtils.isAlwaysOnVpnSet(mVm, managedProfileUserId);
}
@Override
public boolean isGlobalHttpProxySet() {
return mCm.getGlobalProxy() != null;
}
@Override
public int getMaximumFailedPasswordsBeforeWipeInCurrentUser() {
ComponentName owner = mDpm.getDeviceOwnerComponentOnCallingUser();

View File

@@ -14,26 +14,25 @@
package com.android.settings.enterprise;
import android.content.Context;
import android.net.ConnectivityManager;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.core.AbstractPreferenceController;
public class GlobalHttpProxyPreferenceController extends AbstractPreferenceController implements
PreferenceControllerMixin {
private static final String KEY_GLOBAL_HTTP_PROXY = "global_http_proxy";
private final EnterprisePrivacyFeatureProvider mFeatureProvider;
private final ConnectivityManager mCm;
public GlobalHttpProxyPreferenceController(Context context) {
super(context);
mFeatureProvider = FeatureFactory.getFactory(context)
.getEnterprisePrivacyFeatureProvider(context);
mCm = context.getSystemService(ConnectivityManager.class);
}
@Override
public boolean isAvailable() {
return mFeatureProvider.isGlobalHttpProxySet();
return mCm.getGlobalProxy() != null;
}
@Override