Revert "[BR07.1] Expose setDataSaverEnabled from ConnectivityManager"
Revert submission 2745215-npmsbpf DroidMonitor: Potential culprit for Bug 307256512 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted. Reason for revert: 307256512 Reverted changes: /q/submissionid:2745215-npmsbpf Change-Id: I27119a7484453d1369bbdf71ad2479edec7d664f
This commit is contained in:
committed by
Gerrit Code Review
parent
c279f1830e
commit
457ae0f00f
@@ -26,7 +26,6 @@ import static android.net.NetworkRequest.Type.TRACK_SYSTEM_DEFAULT;
|
||||
import static android.net.QosCallback.QosCallbackRegistrationException;
|
||||
|
||||
import android.annotation.CallbackExecutor;
|
||||
import android.annotation.FlaggedApi;
|
||||
import android.annotation.IntDef;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.Nullable;
|
||||
@@ -116,14 +115,6 @@ public class ConnectivityManager {
|
||||
private static final String TAG = "ConnectivityManager";
|
||||
private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG);
|
||||
|
||||
// TODO : remove this class when udc-mainline-prod is abandoned and android.net.flags.Flags is
|
||||
// available here
|
||||
/** @hide */
|
||||
public static class Flags {
|
||||
static final String SET_DATA_SAVER_VIA_CM =
|
||||
"com.android.net.flags.set_data_saver_via_cm";
|
||||
}
|
||||
|
||||
/**
|
||||
* A change in network connectivity has occurred. A default connection has either
|
||||
* been established or lost. The NetworkInfo for the affected network is
|
||||
@@ -5949,28 +5940,6 @@ public class ConnectivityManager {
|
||||
return new Range(TUN_INTF_NETID_START, TUN_INTF_NETID_START + TUN_INTF_NETID_RANGE - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets data saver switch.
|
||||
*
|
||||
* @param enable True if enable.
|
||||
* @throws IllegalStateException if failed.
|
||||
* @hide
|
||||
*/
|
||||
@FlaggedApi(Flags.SET_DATA_SAVER_VIA_CM)
|
||||
@SystemApi(client = MODULE_LIBRARIES)
|
||||
@RequiresPermission(anyOf = {
|
||||
android.Manifest.permission.NETWORK_SETTINGS,
|
||||
android.Manifest.permission.NETWORK_STACK,
|
||||
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK
|
||||
})
|
||||
public void setDataSaverEnabled(final boolean enable) {
|
||||
try {
|
||||
mService.setDataSaverEnabled(enable);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the specified UID to the list of UIds that are allowed to use data on metered networks
|
||||
* even when background data is restricted. The deny list takes precedence over the allow list.
|
||||
|
||||
Reference in New Issue
Block a user