Home | History | Annotate | Download | only in vpn2
      1 /*
      2  * Copyright (C) 2017 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.settings.vpn2;
     18 
     19 import android.net.ConnectivityManager;
     20 import android.net.ConnectivityManager.NetworkCallback;
     21 import android.net.Network;
     22 import android.net.NetworkRequest;
     23 import android.os.Handler;
     24 import android.net.ProxyInfo;
     25 
     26 public class ConnectivityManagerWrapperImpl implements ConnectivityManagerWrapper {
     27 
     28     private final ConnectivityManager mCm;
     29 
     30     public ConnectivityManagerWrapperImpl(ConnectivityManager cm) {
     31         mCm = cm;
     32     }
     33 
     34     @Override
     35     public ConnectivityManager getConnectivityManager() {
     36         return mCm;
     37     }
     38 
     39     @Override
     40     public String getAlwaysOnVpnPackageForUser(int userId) {
     41         return mCm.getAlwaysOnVpnPackageForUser(userId);
     42     }
     43 
     44     @Override
     45     public ProxyInfo getGlobalProxy() {
     46         return mCm.getGlobalProxy();
     47     }
     48 
     49     @Override
     50     public void registerNetworkCallback(NetworkRequest request, NetworkCallback callback,
     51             Handler handler) {
     52         mCm.registerNetworkCallback(request, callback, handler);
     53     }
     54 
     55     @Override
     56     public void startCaptivePortalApp(Network network) {
     57         mCm.startCaptivePortalApp(network);
     58     }
     59 }
     60