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
Change-Id: I9ad1180ba7f69c64ba362c9571bbe444226cdda9
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 2779bdb..9e5461c 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -76,6 +76,7 @@
import android.os.ResultReceiver;
import android.os.ServiceSpecificException;
import android.os.SystemClock;
+import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
import android.os.WorkSource;
@@ -437,6 +438,7 @@
private final RadioInterfaceCapabilityController mRadioInterfaceCapabilities;
private AppOpsManager mAppOps;
private PackageManager mPackageManager;
+ private final int mVendorApiLevel;
/** User Activity */
private final AtomicBoolean mNotifyUserActivity;
@@ -2482,6 +2484,9 @@
mPackageManager = app.getPackageManager();
mSatelliteAccessController = SatelliteAccessController.getOrCreateInstance(
getDefaultPhone().getContext(), featureFlags);
+ mVendorApiLevel = SystemProperties.getInt(
+ "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);
+
PropertyInvalidatedCache.invalidateCache(TelephonyManager.CACHE_KEY_PHONE_ACCOUNT_TO_SUBID);
publish();
CarrierAllowListInfo.loadInstance(mApp);
@@ -14096,7 +14101,11 @@
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;
}