Skip to content
Snippets Groups Projects
Commit 9c15ff77 authored by Junyu Lai's avatar Junyu Lai Committed by Gerrit Code Review
Browse files

Merge "Remove sdk level check when calling getDataSaverEnabled" into main

parents fea003bd 8df4b700
No related branches found
No related tags found
No related merge requests found
......@@ -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) {
......
......@@ -213,7 +213,6 @@ class BpfNetMapsReaderTest {
assertFalse(isUidNetworkingBlocked(TEST_UID3))
}
@IgnoreUpTo(VERSION_CODES.UPSIDE_DOWN_CAKE)
@Test
fun testGetDataSaverEnabled() {
testDataSaverEnabledMap.updateEntry(DATA_SAVER_ENABLED_KEY, U8(DATA_SAVER_DISABLED))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment