1 /* 2 * Copyright (C) 2022 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 package com.android.networkstack.apishim.common; 17 18 /** API shim for VpnProfileState. */ 19 public interface VpnProfileStateShim { 20 /** See android.net.VpnProfileState#getState */ getState()21 default int getState() throws UnsupportedApiLevelException { 22 throw new UnsupportedApiLevelException("Only supported starting from API 33"); 23 } 24 /** See android.net.VpnProfileState#getgetSessionId */ getSessionId()25 default String getSessionId() throws UnsupportedApiLevelException { 26 throw new UnsupportedApiLevelException("Only supported starting from API 33"); 27 } 28 /** See android.net.VpnProfileState#isAlwaysOn */ isAlwaysOn()29 default boolean isAlwaysOn() throws UnsupportedApiLevelException { 30 throw new UnsupportedApiLevelException("Only supported starting from API 33"); 31 } 32 /** See android.net.VpnProfileState#isLockdownEnabled */ isLockdownEnabled()33 default boolean isLockdownEnabled() throws UnsupportedApiLevelException { 34 throw new UnsupportedApiLevelException("Only supported starting from API 33"); 35 } 36 } 37