blob: 7934a968242679172790ff140b41a8ed4b513a2b [file] [log] [blame]
Felipe Lemed17fda42016-04-29 11:12:45 -07001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.server.net;
18
19/**
20 * Network Policy Manager local system service interface.
21 *
22 * @hide Only for use within the system server.
23 */
24public abstract class NetworkPolicyManagerInternal {
25
26 /**
27 * Resets all policies associated with a given user.
28 */
29 public abstract void resetUserState(int userId);
Hugo Benichi938ab4f2017-02-11 17:04:43 +090030
31 /**
32 * @return true if the given uid is restricted from doing networking on metered networks.
33 */
34 public abstract boolean isUidRestrictedOnMeteredNetworks(int uid);
35
36 /**
37 * @return true if networking is blocked on the given interface for the given uid according
38 * to current networking policies.
39 */
40 public abstract boolean isUidNetworkingBlocked(int uid, String ifname);
Sudheer Shankaf34f3ec2017-08-03 11:02:56 -070041
42 /**
43 * Informs that an appId has been added or removed from the temp-powersave-whitelist so that
44 * that network rules for that appId can be updated.
45 *
46 * @param appId The appId which has been updated in the whitelist.
47 * @param added Denotes whether the {@param appId} has been added or removed from the whitelist.
48 */
49 public abstract void onTempPowerSaveWhitelistChange(int appId, boolean added);
Felipe Lemed17fda42016-04-29 11:12:45 -070050}