DynamicDenylistManager shall not exist
Remove DynamicDenylistManager to avoid its conflicting behavior with our firewall. This stops the resetting of firewall policies on boot and for other reasons. The user is in control of these policies and doesn't need them to be unexpectedly reset. Issue: calyxos#2211 Test: Manual: Turn off Background network access for any app. Then, in Firewall, turn off another toggle like Wi-Fi. Reboot, and check the toggles. Background network access and Wi-Fi should still be off. Change-Id: Ie62ddfa3a893c9adf5d4fd0c8670235a5a51e03f
This commit is contained in:
committed by
Michael Bestas
parent
668fe20d73
commit
a8f79a720f
@@ -23,7 +23,6 @@ import android.content.Context;
|
||||
import android.net.NetworkPolicyManager;
|
||||
import android.util.SparseIntArray;
|
||||
|
||||
import com.android.settings.fuelgauge.datasaver.DynamicDenylistManager;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||
import com.android.settingslib.utils.ThreadUtils;
|
||||
@@ -40,7 +39,6 @@ public class DataSaverBackend {
|
||||
private final MetricsFeatureProvider mMetricsFeatureProvider;
|
||||
|
||||
private final NetworkPolicyManager mPolicyManager;
|
||||
private final DynamicDenylistManager mDynamicDenylistManager;
|
||||
private final ArrayList<Listener> mListeners = new ArrayList<>();
|
||||
private SparseIntArray mUidPolicies = new SparseIntArray();
|
||||
private boolean mAllowlistInitialized;
|
||||
@@ -52,7 +50,6 @@ public class DataSaverBackend {
|
||||
mContext = context.getApplicationContext();
|
||||
mMetricsFeatureProvider = FeatureFactory.getFeatureFactory().getMetricsFeatureProvider();
|
||||
mPolicyManager = NetworkPolicyManager.from(mContext);
|
||||
mDynamicDenylistManager = DynamicDenylistManager.getInstance(mContext);
|
||||
}
|
||||
|
||||
public void addListener(Listener listener) {
|
||||
@@ -132,8 +129,7 @@ public class DataSaverBackend {
|
||||
|
||||
public boolean isDenylisted(int uid) {
|
||||
loadDenylist();
|
||||
return mUidPolicies.get(uid, POLICY_NONE) == POLICY_REJECT_METERED_BACKGROUND
|
||||
&& mDynamicDenylistManager.isInManualDenylist(uid);
|
||||
return mUidPolicies.get(uid, POLICY_NONE) == POLICY_REJECT_METERED_BACKGROUND;
|
||||
}
|
||||
|
||||
private void loadDenylist() {
|
||||
|
||||
Reference in New Issue
Block a user