1 /* 2 * Copyright (C) 2021 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.testutils; 18 19 import android.net.NetworkStats; 20 import android.net.netstats.provider.INetworkStatsProviderCallback; 21 import android.os.RemoteException; 22 23 /** 24 * A shim class that allows {@link TestableNetworkStatsProviderCbBinder} to be built against 25 * different SDK versions. 26 */ 27 public class NetworkStatsProviderCbStubCompat extends INetworkStatsProviderCallback.Stub { 28 @Override notifyStatsUpdated(int token, NetworkStats ifaceStats, NetworkStats uidStats)29 public void notifyStatsUpdated(int token, NetworkStats ifaceStats, NetworkStats uidStats) 30 throws RemoteException {} 31 32 @Override notifyAlertReached()33 public void notifyAlertReached() throws RemoteException {} 34 35 /** Added in T. */ notifyLimitReached()36 public void notifyLimitReached() throws RemoteException {} 37 38 /** Added in T. */ notifyWarningReached()39 public void notifyWarningReached() throws RemoteException {} 40 41 /** Added in S, removed in T. */ notifyWarningOrLimitReached()42 public void notifyWarningOrLimitReached() throws RemoteException {} 43 44 @Override unregister()45 public void unregister() throws RemoteException {} 46 } 47