INetworkPolicyManager.aidl revision d0c6ccbafdebc73d03cf3cd47f02f9f6c78a69ff
13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/*
23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Copyright (C) 2011 The Android Open Source Project
33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Licensed under the Apache License, Version 2.0 (the "License");
53c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * you may not use this file except in compliance with the License.
63c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * You may obtain a copy of the License at
73c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
83c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *      http://www.apache.org/licenses/LICENSE-2.0
93c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Unless required by applicable law or agreed to in writing, software
113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * distributed under the License is distributed on an "AS IS" BASIS,
123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * See the License for the specific language governing permissions and
143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * limitations under the License.
153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry */
163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
173c827367444ee418f129b2c238299f49d3264554Jarkko Poyrypackage android.net;
183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
193c827367444ee418f129b2c238299f49d3264554Jarkko Poyryimport android.net.INetworkPolicyListener;
203c827367444ee418f129b2c238299f49d3264554Jarkko Poyryimport android.net.NetworkPolicy;
213c827367444ee418f129b2c238299f49d3264554Jarkko Poyryimport android.net.NetworkQuotaInfo;
223c827367444ee418f129b2c238299f49d3264554Jarkko Poyryimport android.net.NetworkState;
233c827367444ee418f129b2c238299f49d3264554Jarkko Poyryimport android.net.NetworkTemplate;
243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry/**
263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * Interface that creates and modifies network policy rules.
273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry *
283c827367444ee418f129b2c238299f49d3264554Jarkko Poyry * {@hide}
293c827367444ee418f129b2c238299f49d3264554Jarkko Poyry */
303c827367444ee418f129b2c238299f49d3264554Jarkko Poyryinterface INetworkPolicyManager {
313c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
323c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    /** Control UID policies. */
333c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    void setUidPolicy(int uid, int policy);
343c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    int getUidPolicy(int uid);
353c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    int[] getUidsWithPolicy(int policy);
363c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
373c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    boolean isUidForeground(int uid);
383c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
393c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    void registerListener(INetworkPolicyListener listener);
403c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    void unregisterListener(INetworkPolicyListener listener);
413c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
423c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    /** Control network policies atomically. */
433c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    void setNetworkPolicies(in NetworkPolicy[] policies);
443c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    NetworkPolicy[] getNetworkPolicies();
453c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
463c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    /** Snooze limit on policy matching given template. */
473c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    void snoozeLimit(in NetworkTemplate template);
483c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
493c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    /** Control if background data is restricted system-wide. */
503c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    void setRestrictBackground(boolean restrictBackground);
513c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    boolean getRestrictBackground();
523c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
533c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    NetworkQuotaInfo getNetworkQuotaInfo(in NetworkState state);
543c827367444ee418f129b2c238299f49d3264554Jarkko Poyry    boolean isNetworkMetered(in NetworkState state);
553c827367444ee418f129b2c238299f49d3264554Jarkko Poyry
563c827367444ee418f129b2c238299f49d3264554Jarkko Poyry}
573c827367444ee418f129b2c238299f49d3264554Jarkko Poyry