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/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index 9b71919..47fd96e 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -47,6 +47,7 @@
import android.os.Process;
import android.os.RemoteException;
import android.os.ResultReceiver;
+import android.os.SystemProperties;
import android.os.UserHandle;
import android.preference.PreferenceManager;
import android.service.carrier.CarrierIdentifier;
@@ -698,6 +699,7 @@
@NonNull private final FeatureFlags mFeatureFlags;
@NonNull private final PackageManager mPackageManager;
+ private final int mVendorApiLevel;
/**
* Constructs a CarrierConfigLoader, registers it as a service, and registers a broadcast
@@ -736,6 +738,8 @@
}
mFeatureFlags = featureFlags;
mPackageManager = context.getPackageManager();
+ mVendorApiLevel = SystemProperties.getInt(
+ "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);
logd("CarrierConfigLoader has started");
PhoneConfigurationManager.registerForMultiSimConfigChange(
@@ -1884,7 +1888,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;
}
diff --git a/src/com/android/phone/ImsRcsController.java b/src/com/android/phone/ImsRcsController.java
index a778f6a..766d719 100644
--- a/src/com/android/phone/ImsRcsController.java
+++ b/src/com/android/phone/ImsRcsController.java
@@ -32,6 +32,7 @@
import android.os.Build;
import android.os.RemoteException;
import android.os.ServiceSpecificException;
+import android.os.SystemProperties;
import android.os.UserHandle;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyFrameworkInitializer;
@@ -85,6 +86,7 @@
private PackageManager mPackageManager;
// set by shell cmd phone src set-device-enabled true/false
private Boolean mSingleRegistrationOverride;
+ private final int mVendorApiLevel;
/**
* For apps targeting Android T and above, support the publishing state on APIs, such as
@@ -119,6 +121,8 @@
TelephonyFrameworkInitializer
.getTelephonyServiceManager().getTelephonyImsServiceRegisterer().register(this);
mImsResolver = ImsResolver.getInstance();
+ mVendorApiLevel = SystemProperties.getInt(
+ "ro.vendor.api_level", Build.VERSION.DEVICE_INITIAL_SDK_INT);
}
/**
@@ -1000,7 +1004,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;
}
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;
}