Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fc68c23 authored by Yan Yan's avatar Yan Yan
Browse files

Add @RequiresFeature for VcnManager

Add @RequiresFeature to align with the implementation that makes
VCN availability depent on FEATURE_TELEPHONY_SUBSCRIPTION

Bug: 330404031
Test: build
Change-Id: I3e35f3d21014edbfca29fd2abd99d05531916f49
parent 2ecfdb1d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -20,10 +20,12 @@ import static java.util.Objects.requireNonNull;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresFeature;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.content.Context;
import android.content.pm.PackageManager;
import android.net.LinkProperties;
import android.net.NetworkCapabilities;
import android.os.Binder;
@@ -69,8 +71,13 @@ import java.util.concurrent.Executor;
 * tasks. In Safe Mode, the system will allow underlying cellular networks to be used as default.
 * Additionally, during Safe Mode, the VCN will continue to retry the connections, and will
 * automatically exit Safe Mode if all active tunnels connect successfully.
 *
 * <p>Apps targeting Android 15 or newer should check the existence of {@link
 * PackageManager#FEATURE_TELEPHONY_SUBSCRIPTION} before querying the service. If the feature is
 * absent, {@link Context#getSystemService} may return null.
 */
@SystemService(Context.VCN_MANAGEMENT_SERVICE)
@RequiresFeature(PackageManager.FEATURE_TELEPHONY_SUBSCRIPTION)
public class VcnManager {
    @NonNull private static final String TAG = VcnManager.class.getSimpleName();