Remove sdk level check when calling getDataSaverEnabled
Follow-up from aosp/2856948, the data saver status value is filled by ConnectivityService before Android V. Thus, calling BpfNetMapsReader#getDataSaverEnabled() is a legit use case, which should not trigger log.wtf. Remove the check accordingly. Test: TH Bug: 314858283 Fix: 316839561 Change-Id: I90c85ab98fbefd1f99ec799a4eec8d1d0cfd47b0
This commit is contained in:
parent
e450df6981
commit
8df4b700dd
1 changed files with 0 additions and 9 deletions
|
|
@ -36,7 +36,6 @@ import android.os.Build;
|
|||
import android.os.ServiceSpecificException;
|
||||
import android.system.ErrnoException;
|
||||
import android.system.Os;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.modules.utils.build.SdkLevel;
|
||||
|
|
@ -278,13 +277,6 @@ public class BpfNetMapsReader {
|
|||
public boolean getDataSaverEnabled() {
|
||||
throwIfPreT("getDataSaverEnabled is not available on pre-T devices");
|
||||
|
||||
// Note that this is not expected to be called until V given that it relies on the
|
||||
// counterpart platform solution to set data saver status to bpf.
|
||||
// See {@code NetworkManagementService#setDataSaverModeEnabled}.
|
||||
if (!SdkLevel.isAtLeastV()) {
|
||||
Log.wtf(TAG, "getDataSaverEnabled is not expected to be called on pre-V devices");
|
||||
}
|
||||
|
||||
try {
|
||||
return mDataSaverEnabledMap.getValue(DATA_SAVER_ENABLED_KEY).val == DATA_SAVER_ENABLED;
|
||||
} catch (ErrnoException e) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue