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

Commit d9dbd635 authored by joonhunshin's avatar joonhunshin Committed by Cherrypicker Worker
Browse files

Skip to check telephony feature mapping when the SDK version of vendor...

Skip to check telephony feature mapping when the SDK version of vendor partition is less thant Android V

Bug: 335362916
Test: manual basic voice call test on ATT
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:70b7c0e04b7219542c860e32a60986f58f71205b)
Merged-In: If0674e7e860962bccd3fba5963bd8fc3f6dc55f5
Change-Id: If0674e7e860962bccd3fba5963bd8fc3f6dc55f5
parent bbca7e4d
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.net.Uri;
import android.os.Binder;
import android.os.Build;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.os.TelephonyServiceManager.ServiceRegisterer;
import android.telephony.ImsiEncryptionInfo;
import android.telephony.PhoneNumberUtils;
@@ -64,6 +65,7 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
    private AppOpsManager mAppOps;
    private FeatureFlags mFeatureFlags;
    private PackageManager mPackageManager;
    private final int mVendorApiLevel;

    public PhoneSubInfoController(Context context) {
        this(context, new FeatureFlagsImpl());
@@ -80,6 +82,8 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {
        mContext = context;
        mPackageManager = context.getPackageManager();
        mFeatureFlags = featureFlags;
        mVendorApiLevel = SystemProperties.getInt(
                "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);
    }

    @Deprecated
@@ -799,7 +803,11 @@ public class PhoneSubInfoController extends IPhoneSubInfo.Stub {

        if (!mFeatureFlags.enforceTelephonyFeatureMappingForPublicApis()
                || !CompatChanges.isChangeEnabled(ENABLE_FEATURE_MAPPING, callingPackage,
                Binder.getCallingUserHandle())) {
                Binder.getCallingUserHandle())
                || mVendorApiLevel < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
            // Skip to check associated telephony feature,
            // if compatibility change is not enabled for the current process or
            // the SDK version of vendor partition is less than Android V.
            return;
        }

+11 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.os.BaseBundle;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemProperties;
import android.os.TelephonyServiceManager.ServiceRegisterer;
import android.os.UserHandle;
import android.provider.Telephony.Sms.Intents;
@@ -70,6 +71,8 @@ public class SmsController extends ISmsImplBase {

    private final Context mContext;
    private final PackageManager mPackageManager;
    private final int mVendorApiLevel;

    @NonNull private final FeatureFlags mFlags;

    @VisibleForTesting
@@ -83,6 +86,9 @@ public class SmsController extends ISmsImplBase {
        if (smsServiceRegisterer.get() == null) {
            smsServiceRegisterer.register(this);
        }

        mVendorApiLevel = SystemProperties.getInt(
                "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);
    }

    private Phone getPhone(int subId) {
@@ -1224,7 +1230,11 @@ public class SmsController extends ISmsImplBase {

        if (!mFlags.enforceTelephonyFeatureMappingForPublicApis()
                || !CompatChanges.isChangeEnabled(ENABLE_FEATURE_MAPPING, callingPackage,
                Binder.getCallingUserHandle())) {
                Binder.getCallingUserHandle())
                || mVendorApiLevel < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
            // Skip to check associated telephony feature,
            // if compatibility change is not enabled for the current process or
            // the SDK version of vendor partition is less than Android V.
            return;
        }

+10 −1
Original line number Diff line number Diff line
@@ -31,8 +31,10 @@ import android.content.SharedPreferences;
import android.content.pm.ComponentInfo;
import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.Build;
import android.os.Handler;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.service.euicc.EuiccProfileInfo;
@@ -75,6 +77,7 @@ public class EuiccCardController extends IEuiccCardController.Stub {
    private UiccController mUiccController;
    private FeatureFlags mFeatureFlags;
    private PackageManager mPackageManager;
    private final int mVendorApiLevel;

    private static EuiccCardController sInstance;

@@ -143,6 +146,8 @@ public class EuiccCardController extends IEuiccCardController.Stub {
        mEuiccController = euiccController;
        mFeatureFlags = featureFlags;
        mPackageManager = context.getPackageManager();
        mVendorApiLevel = SystemProperties.getInt(
                "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);

        if (isBootUp(mContext)) {
            mSimSlotStatusChangeReceiver = new SimSlotStatusChangedBroadcastReceiver();
@@ -1541,7 +1546,11 @@ public class EuiccCardController extends IEuiccCardController.Stub {

        if (!mFeatureFlags.enforceTelephonyFeatureMappingForPublicApis()
                || !CompatChanges.isChangeEnabled(ENABLE_FEATURE_MAPPING, callingPackage,
                Binder.getCallingUserHandle())) {
                Binder.getCallingUserHandle())
                || mVendorApiLevel < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
            // Skip to check associated telephony feature,
            // if compatibility change is not enabled for the current process or
            // the SDK version of vendor partition is less than Android V.
            return;
        }

+10 −1
Original line number Diff line number Diff line
@@ -34,7 +34,9 @@ import android.content.pm.ComponentInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.provider.Settings;
@@ -124,6 +126,7 @@ public class EuiccController extends IEuiccController.Stub {
    private final AppOpsManager mAppOpsManager;
    private final PackageManager mPackageManager;
    private final FeatureFlags mFeatureFlags;
    private final int mVendorApiLevel;

    // These values should be set or updated upon 1) system boot, 2) EuiccService/LPA is bound to
    // the phone process, 3) values are updated remotely by server flags.
@@ -172,6 +175,8 @@ public class EuiccController extends IEuiccController.Stub {
        mAppOpsManager = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
        mPackageManager = context.getPackageManager();
        mFeatureFlags = featureFlags;
        mVendorApiLevel = SystemProperties.getInt(
                "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);
    }

    /**
@@ -2351,7 +2356,11 @@ public class EuiccController extends IEuiccController.Stub {

        if (!mFeatureFlags.enforceTelephonyFeatureMappingForPublicApis()
                || !CompatChanges.isChangeEnabled(ENABLE_FEATURE_MAPPING, callingPackage,
                Binder.getCallingUserHandle())) {
                Binder.getCallingUserHandle())
                || mVendorApiLevel < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
            // Skip to check associated telephony feature,
            // if compatibility change is not enabled for the current process or
            // the SDK version of vendor partition is less than Android V.
            return;
        }

+10 −1
Original line number Diff line number Diff line
@@ -312,6 +312,9 @@ public class SubscriptionManagerService extends ISub.Stub {
    @NonNull
    private final int[] mSimState;

    /** Vendor API level from system property. */
    private final int mVendorApiLevel;

    /**
     * {@code true} if a user profile can only see the SIMs associated with it, unless it possesses
     * no SIMs on the device.
@@ -466,6 +469,8 @@ public class SubscriptionManagerService extends ISub.Stub {
        mEuiccManager = context.getSystemService(EuiccManager.class);
        mAppOpsManager = context.getSystemService(AppOpsManager.class);
        mPackageManager = context.getPackageManager();
        mVendorApiLevel = SystemProperties.getInt(
                "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);

        mUiccController = UiccController.getInstance();
        mHandler = new Handler(looper);
@@ -4445,7 +4450,11 @@ public class SubscriptionManagerService extends ISub.Stub {

        if (!mFeatureFlags.enforceTelephonyFeatureMappingForPublicApis()
                || !CompatChanges.isChangeEnabled(ENABLE_FEATURE_MAPPING, callingPackage,
                Binder.getCallingUserHandle())) {
                Binder.getCallingUserHandle())
                || mVendorApiLevel < Build.VERSION_CODES.VANILLA_ICE_CREAM) {
            // Skip to check associated telephony feature,
            // if compatibility change is not enabled for the current process or
            // the SDK version of vendor partition is less than Android V.
            return;
        }