Initial implementation of onShellCommand().
Only the commands related to restrict background whitelisting were
initially added, so they can be used in the CTS test for the new APIs.
BUG: 26451391
Change-Id: I5479073d85c44b99368497448f1f8e36cd99e63c
diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
index 2658489..1d7d24b 100644
--- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
+++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java
@@ -127,6 +127,7 @@
import android.os.INetworkManagementService;
import android.os.IPowerManager;
import android.os.Message;
+import android.os.ResultReceiver;
import android.os.MessageQueue.IdleHandler;
import android.os.PowerManager;
import android.os.PowerManagerInternal;
@@ -2119,6 +2120,13 @@
}
@Override
+ public void onShellCommand(FileDescriptor in, FileDescriptor out, FileDescriptor err,
+ String[] args, ResultReceiver resultReceiver) throws RemoteException {
+ (new NetworkPolicyManagerShellCommand(this)).exec(
+ this, in, out, err, args, resultReceiver);
+ }
+
+ @Override
public boolean isUidForeground(int uid) {
mContext.enforceCallingOrSelfPermission(MANAGE_NETWORK_POLICY, TAG);