1 /* 2 * Copyright (C) 2011 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 17 package com.android.server.net; 18 19 import android.compat.annotation.UnsupportedAppUsage; 20 import android.net.INetworkManagementEventObserver; 21 import android.net.LinkAddress; 22 import android.net.RouteInfo; 23 24 /** 25 * Base {@link INetworkManagementEventObserver} that provides no-op 26 * implementations which can be overridden. 27 * 28 * @hide 29 */ 30 public class BaseNetworkObserver extends INetworkManagementEventObserver.Stub { 31 32 @UnsupportedAppUsage BaseNetworkObserver()33 public BaseNetworkObserver() { 34 } 35 36 @Override interfaceStatusChanged(String iface, boolean up)37 public void interfaceStatusChanged(String iface, boolean up) { 38 // default no-op 39 } 40 41 @Override interfaceRemoved(String iface)42 public void interfaceRemoved(String iface) { 43 // default no-op 44 } 45 46 @Override addressUpdated(String iface, LinkAddress address)47 public void addressUpdated(String iface, LinkAddress address) { 48 // default no-op 49 } 50 51 @Override addressRemoved(String iface, LinkAddress address)52 public void addressRemoved(String iface, LinkAddress address) { 53 // default no-op 54 } 55 56 @Override interfaceLinkStateChanged(String iface, boolean up)57 public void interfaceLinkStateChanged(String iface, boolean up) { 58 // default no-op 59 } 60 61 @Override interfaceAdded(String iface)62 public void interfaceAdded(String iface) { 63 // default no-op 64 } 65 66 @Override interfaceClassDataActivityChanged(int transportType, boolean active, long tsNanos, int uid)67 public void interfaceClassDataActivityChanged(int transportType, boolean active, long tsNanos, 68 int uid) { 69 // default no-op 70 } 71 72 @Override limitReached(String limitName, String iface)73 public void limitReached(String limitName, String iface) { 74 // default no-op 75 } 76 77 @Override interfaceDnsServerInfo(String iface, long lifetime, String[] servers)78 public void interfaceDnsServerInfo(String iface, long lifetime, String[] servers) { 79 // default no-op 80 } 81 82 @Override routeUpdated(RouteInfo route)83 public void routeUpdated(RouteInfo route) { 84 // default no-op 85 } 86 87 @Override routeRemoved(RouteInfo route)88 public void routeRemoved(RouteInfo route) { 89 // default no-op 90 } 91 } 92