blob: 3218c0b387bb41ec3fe9c6d603be1865e02cdad0 [file] [log] [blame]
markchien0df2ebc42019-09-30 14:40:57 +08001/*
2 * Copyright (C) 2019 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 */
16package android.net.util;
17
18import android.net.INetdUnsolicitedEventListener;
19
20import androidx.annotation.NonNull;
21
22/**
23 * Base {@link INetdUnsolicitedEventListener} that provides no-op implementations which can be
24 * overridden.
25 */
26public class BaseNetdUnsolicitedEventListener extends INetdUnsolicitedEventListener.Stub {
27
28 @Override
29 public void onInterfaceClassActivityChanged(boolean isActive, int timerLabel, long timestampNs,
30 int uid) { }
31
32 @Override
33 public void onQuotaLimitReached(@NonNull String alertName, @NonNull String ifName) { }
34
35 @Override
36 public void onInterfaceDnsServerInfo(@NonNull String ifName, long lifetimeS,
37 @NonNull String[] servers) { }
38
39 @Override
40 public void onInterfaceAddressUpdated(@NonNull String addr, String ifName, int flags,
41 int scope) { }
42
43 @Override
44 public void onInterfaceAddressRemoved(@NonNull String addr, @NonNull String ifName, int flags,
45 int scope) { }
46
47 @Override
48 public void onInterfaceAdded(@NonNull String ifName) { }
49
50 @Override
51 public void onInterfaceRemoved(@NonNull String ifName) { }
52
53 @Override
54 public void onInterfaceChanged(@NonNull String ifName, boolean up) { }
55
56 @Override
57 public void onInterfaceLinkStateChanged(@NonNull String ifName, boolean up) { }
58
59 @Override
60 public void onRouteChanged(boolean updated, @NonNull String route, @NonNull String gateway,
61 @NonNull String ifName) { }
62
63 @Override
64 public void onStrictCleartextDetected(int uid, @NonNull String hex) { }
65
66 @Override
67 public int getInterfaceVersion() {
68 return INetdUnsolicitedEventListener.VERSION;
69 }
70}